Facts sets have the following syntax:
(deffacts [<module-name>::]<fact-set-name> ["optional comment"]
<fact definition>+)
:: = Module separator. Module name is optional. If not specified, a rule belongs to the currently active module
where <fact-set-name> must be a unique name.
Note: Brackets ([) and (]) define optional elements of the construct. The (|) character defines an or condition. An asterisk (*) defines zero or more of the preceding element (or disjunction of elements). A plus sign (+) defines one or more of the preceding element.
Valid Fact Set Definitions
Assuming the following fact templates:
(deftemplate person (slot name (default Tom)) (slot age) (multislot phone))
(deftemplate employee)
valid facts sets are:
(deffacts people "some people, two Daves and a Tom"
(person (name David))
(person (age 35))
(person (name David) (age 35)))
(deffacts more-people "some more people and an employee"
(person (name David) (phone 555 555 5555))
(employee David 35 555 555 5555)
(person (name "David Johnson"))
(person (name David) (age (+ 3 30))))
Invalid Fact Set Definitions
(deffacts people "some people, two Daves and a Tom"
person (name David)
person (age 35)
person (name David) (age 35)) <- missing parentheses for facts
(deffacts <- missing deffacts name
(person (name David))
(person (age 35))
(person (name David) (age 35)))