Variables
- Clips uses lists for its variables. They call them facts.
- So, you define a fact by for instance a 3-ary predicate like:
(age-of Chris 52).
- The developer and the reader knows that the age of Chris is 52, when
he sees this fact.
- It doesn't matter how many you have.
- If the facts are involved in rules you can use variables with a
? in front of them.
- So (age-of ?X 52) matches any fact like (age-of Chris 52)
including (age-of Ian 52)
- So, here's an example rule:
- if (Feature ?X colour green) and (Feature ?X type fruit) then
(Feature ?X subtype Watermelon)