All Manuals > KnowledgeWorks and Prolog User Guide > A Common Prolog > A.6 Calling Prolog From Lisp

NextPrevUpTopContentsIndex

A.6.1 Examples

(logic '(color ?x) :return-type :display)

writes:

?X = RED<wait for input> (logic '(color ?x) :return-type :fill)

returns:

(COLOR RED)
T
(logic '(color ?x) :return-type :alist)

returns:

((?X . RED))
T
(logic '(color ?x) :all :list)

returns:

((COLOR RED) (COLOR BLUE) (COLOR GREEN))
T
(logic '(color ?x)
       :return-type :bag
       :bag-exp '(?x is a color)
       :all :values)

returns:

(RED IS A COLOR)
(BLUE IS A COLOR)
(GREEN IS A COLOR)

KnowledgeWorks and Prolog User Guide (Unix version) - 26 Feb 2015

NextPrevUpTopContentsIndex