在工作之后,我得到了一些事实,例如:事实2。 如何以编程方式获取有关此事实的信息?
答案 0 :(得分:1)
CLIPS> (clear)
CLIPS> (deftemplate person (slot name) (slot address))
CLIPS> (assert (person (name "Sam Jones") (address "123 Main Street")))
<Fact-1>
CLIPS> (assert (person (name "Sue Smith") (address "456 Maple Drive")))
<Fact-2>
CLIPS> (facts)
f-0 (initial-fact)
f-1 (person (name "Sam Jones") (address "123 Main Street"))
f-2 (person (name "Sue Smith") (address "456 Maple Drive"))
For a total of 3 facts.
CLIPS> (fact-relation 2)
person
CLIPS> (fact-slot-value 2 name)
"Sue Smith"
CLIPS> (fact-slot-value 2 address)
"456 Maple Drive"
CLIPS>