WORKING MEMORY (assert ) Add to working memory. should have the form ( ) where can be an arbitrarily long list of arguments to the predicate. (retract ) Delete the fact associated with from working memory. (deffacts ) Define a knowledge base named containing . (reset) Reset working memory to its initial state, including any facts from active KBs. (clear) Empty working memory and production memory. PRODUCTION MEMORY (defrule => ) Define a production rule named . The LHS contains a set of conditions that must be satisfied in order for the action on the RHS to be executed. LHS CONDITIONS The left-hand-side of a production contains a set of conditions that must be satisfied. These conditions can be any of a number of things: 1) Individual facts, such as (parent bob ann). 2) Facts containing variables, such as (parent bob ?x). ?x is the variable in this example. Any name starting with a ? will be interpreted as a variable. 3) Boolean tests of values, i.e. (test (> ?x 0)) (test (and (> ?x 0) (< ?x 10)) etc. 4) Disjunctions of facts. It is implicit in the design of CLIPS that the list of facts without any other information is a conjunction (AND) list. You can make a disjunction (OR) list using the or function which has the form (or ) where can be of arbitrary length, such as: (or (parent bob ann) (parent bob martha)) (or (parent ann jill) (sister jill martha) (parent bob martha) RHS ACTIONS For our purposes, the only actions your agent needs to perform are (assert ) and (retract ). You can also print things out using the printout function, if you so desire. To get the fact number of a fact you want to retract, you must ON THE LHS store the fact number in a variable using the <- operator, as in: ?p <- (parent bob ann)