Facts have the following syntax:
(<new-relation-name>|<fact-template-name> <value>|<slot-value>|<multi-slot-value>*)
where for <new-relation-name> or a fact template with no slots,
<value> = <constant>|<variable>|<function-call>
and <slot-value> and <multi-slot-value> are invalid
and for fact templates with slots,
<slot-value> = (<valid-slot-name> <constant>|<variable>|<function-call>)
<multi-slot-value> = (<valid-multislot-name> <constant>|<variable>|<function-call>*)
and <value> is invalid.
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 Definitions
Assuming the following fact templates:
(deftemplate person (slot name (default Tom)) (slot age) (multislot phone))
(deftemplate employee)
valid facts are:
(person (name David))
(person (age 35))
(person (name David) (age 35))
(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 Definitions
(person David 35) <- No slot names, invalid
(employee (name David)) <- No such slot in employee fact template
(person (name David Johnson)) <- name slot is not a multi-slot