NextPrevUpTopContentsIndex

A.6.2.2 Example

(deflogfun break-up (y) (append ?a ?b y) (?a ?b))

then:

(break-up '(foo bar baz))

returns:

(NIL (FOO BAR BAZ))
T
(break-up '(foo bar baz) :all :values)

returns:

(NIL (FOO BAR BAZ))
((FOO) (BAR BAZ))
((FOO BAR) (BAZ))
((FOO BAR BAZ) NIL)
(break-up '(foo bar baz) :all :list)

returns:

((NIL (FOO BAR BAZ)) 
 ((FOO) (BAR BAZ)) 
 ((FOO BAR) (BAZ))
 ((FOO BAR BAZ) NIL))
T

A final interface mechanism is with-prolog. with-prolog allows one to embed prolog into an arbitrary lisp function. Lisp variables are referenced in Prolog using " ?.< name > ".


KnowledgeWorks and Prolog User Guide (Macintosh version) - 29 Feb 2008

NextPrevUpTopContentsIndex