Allows rule syntax to be embedded in Lisp code.
A list of variables (each starting with
A rule body.
This macro enables rule syntax to be embedded within Lisp. The
is executed just as if it were the right hand side of a forward or backward chaining rule. All variables in the body (each starting with
) are taken to be unbound unless found in the list
, in which case its value is taken from the Lisp variable of the same name. It is similar to the function
but can be compiled for efficiency.
if the body succeeds (that is, all clauses are successfully executed) or
if any of the clauses fail.
Any subgoals that match the object base will only find objects from the current inferencing state.
(defun my-fn (?x)
"prints all the lists which append to give ?x and
then returns NIL"
(append ?a ?b ?x)
((format t "~%~S and ~S append to give ~S"
?a ?b ?x))
KnowledgeWorks and Prolog User Guide (Windows version) - 22 Dec 2009