Rules
- A rule has the format
if Boolean-Expr then Stmt
- if and then are keywords
- Expr and Stmt refer to expression and statement. They refer
to programming language concepts, that I'm not going to
fully explain.
- A simplified version is that an expression has a value
and a statement does something.
- The if is itself a statement, though it recursively uses statement.
- Another type of statement is the assignment:
a = 3;
- Loops and procedure calls are also statements, as are compound
statements (with curly braces).
- An expression has a value, and a boolean expression has a value
of type boolean.
- For example:
a == 3
is an expression that has the value true or false depending
on the value stored in the variable a.
- You can also have compound expressions combined using And
Or, or Not
- For example (a > 1) And (a < 10). In Clips
(value ?a)(test (> ?a 1))(test (< ?a 10))
which is the same as
(and(value ?a)(test (> ?a 1))(test (< ?a 10)))
- This stuff is the same for many programming languages, so it should
not be new to you.