Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
tutorials:beginner:cram_prolog [2016/01/25 11:47] – gkazhoya | tutorials:beginner:cram_prolog [2022/05/24 14:49] – [Using built-in predicates] schimpf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using Prolog for reasoning ====== | ====== Using Prolog for reasoning ====== | ||
+ | **Description: | ||
+ | |||
+ | **Previous Tutorial:** [[tutorials: | ||
+ | **Next Tutorial:** [[tutorials: | ||
==== Using built-in predicates ==== | ==== Using built-in predicates ==== | ||
Line 27: | Line 31: | ||
(((?X . 1)) ((?X . 2)) ((?X . 3))) | (((?X . 1)) ((?X . 2)) ((?X . 3))) | ||
</ | </ | ||
+ | |||
+ | === Using unbound variables === | ||
Variables in CRAM Prolog are represented by any symbol that starts with ''?'' | Variables in CRAM Prolog are represented by any symbol that starts with ''?'' | ||
Line 39: | Line 45: | ||
</ | </ | ||
Then we get one correct possible assignment for all the variables as one entry of the lazy list. | Then we get one correct possible assignment for all the variables as one entry of the lazy list. | ||
+ | |||
+ | It is important to remember that the ` is needed for unbound variables, not the ' or you will get an error. | ||
+ | |||
If there are no solutions for the query Prolog returns NIL: | If there are no solutions for the query Prolog returns NIL: | ||
Line 100: | Line 109: | ||
(((? | (((? | ||
</ | </ | ||
+ | |||
+ | |||
+ | Now that we are familiar with the CRAM Prolog syntax, let's dive right into resolving CRAM abstract entity descriptions, | ||
+ | |||
+ | **Next Tutorial:** [[tutorials: |