Knowledge Base
- The Knowledge Base consists of rules and working memory (WM)
- Rules are if then statements
- On the if side you have conditional expressions, (e.g.
(Feature ?X colour green))
- You can have variables in here, in this case ?X is a variable.
- On the then side you usually have assignments.
- That is you set or modify working memory items.
- In Clips you set values by (assert (fact)); so on the then
side we (assert (Feature ?X1 subtype watermelon))
- You compare by stating the fact in the if part or by
using (test (func params)). E.g (test (> ?a 3))
- The if part is conjoined by and by default
and you can use
the and or, and not functions
- Variables cross expression e.g.:
- If (favorite-colour ?Val) then (assert
(pick Colour ?Val)