There are several entry points provided for calling Prolog from Lisp. The main interface function is called
logic and has numerous options. The basic form is:
(logic <goal >
:return-type <return-type >
:all <all-type >
:bag-exp <bag-exp >)
The keyword arguments are interpreted as follows:
:return-type describes what to do with a solution when one is found. Possible values of
Display variable bindings and prompt user (the option used by the
Instantiate the goal expression and return it.
Instantiate <bag-exp> and return it.
Return an alist of variables and bindings.
The default is
:all tells what to do with multiple solutions. Possible values of
Return the first solution.
Return multiple solutions as multiple values.
Return a list of the solutions.
:bag-exp is an expression that should be instantiated with the bindings from a solution. This is only meaningful if
KnowledgeWorks and Prolog User Guide (Windows version) - 26 Feb 2015