Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorials:beginner:cram_prolog [2022/05/24 14:49] – [Using built-in predicates] schimpftutorials:beginner:cram_prolog [2022/05/26 12:32] (current) – [Using built-in predicates] schimpf
Line 48: Line 48:
 It is important to remember that the ` is needed for unbound variables, not the ' or you will get an error. It is important to remember that the ` is needed for unbound variables, not the ' or you will get an error.
  
 +=== No solution ===
 If there are no solutions for the query Prolog returns NIL: If there are no solutions for the query Prolog returns NIL:
 <code lisp> <code lisp>
Line 61: Line 61:
 (NIL) (NIL)
 </code> </code>
 +=== Using lisp with prolog code ===
 The CRAM Prolog interpreter finds solutions by performing a depth first search over the predicate tree, that it, it first searches for possible bindings for the first predicate, then branches into multiple search paths, one per each assignment, and continues with the second predicate, and so on. The mechanism is the same as in any other Prolog implementation. The CRAM Prolog interpreter finds solutions by performing a depth first search over the predicate tree, that it, it first searches for possible bindings for the first predicate, then branches into multiple search paths, one per each assignment, and continues with the second predicate, and so on. The mechanism is the same as in any other Prolog implementation.