Differences

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

Link to this comparison view

tutorials:beginner:motion_designators [2019/03/07 12:44]
gkazhoya [Designators: an overview]
tutorials:beginner:motion_designators [2019/03/07 12:50] (current)
gkazhoya [Defining inference rules for designators]
Line 99: Line 99:
  
 ==== Defining inference rules for designators ==== ==== Defining inference rules for designators ====
 +
 +The function ''​reference''​ uses the CRAM Prolog engine to ground a motion designator into specific motion parameters.
 +CRAM Prolog engine is a Prolog interpreter / compiler implemented as a domain-specific language within Lisp.
 +To learn more about CRAM Prolog look at the [[cram_prolog|Using Prolog for reasoning]] tutorial.
 +To ''​reference''​ a motion designator, ''​motion-grounding''​ Prolog rule is being called on the given designator and the rule binds a tuple of command and specific motion parameters to its second argument.
  
 Append the following to your ''​motion-designators.lisp''​ file: Append the following to your ''​motion-designators.lisp''​ file:
Line 136: Line 141:
 Let's see what this code does. The defstruct declares a structure type to hold values resulting from the inference. It's an instantiation of our motion in a space of (possibly) continuous parameters, which we deduce from a symbolic description of the designator via rules given in the def-fact-group. Let's see what this code does. The defstruct declares a structure type to hold values resulting from the inference. It's an instantiation of our motion in a space of (possibly) continuous parameters, which we deduce from a symbolic description of the designator via rules given in the def-fact-group.
  
-As for the inference rules themselves, these are Prolog code embedded in Lisp, for it is Prolog that powers the inference behind designator resolution. To learn more about CRAM Prolog look at the [[cram_prolog|Using Prolog for reasoning]] tutorial. The ''​def-fact-group''​ is a collection of several rules, each of similar structure, so it helps to look at one of them in more detail:+As for the inference rules themselves, these are Prolog code embedded in Lisp, for it is Prolog that powers the inference behind designator resolution. The ''​def-fact-group''​ is a collection of several rules, each of similar structure, so it helps to look at one of them in more detail:
  
 <code lisp> <code lisp>