




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 (Macintosh version) - 22 Dec 2009




