Predicates
Normal Predicates
Predicates are specified with is? (same as if?) keyword and negated with a preceeding not?.
Set membership test in a set is specified by in? keyword.
Relative qualifications can also be subject of predicates.
> is not green-block taller red-cube.
no
> is 2 in {4, 1 + 1}.
yes
> is green-lego color = green.
yes
> is green-lego on-top-of the-table.
no
Time Referenced Predicates?
It is possible to ask a predicate at a specific point in time. For example:
> is at time 2 Robot position = A4.
Action Predicates?
Another way to ask a question is to ask a query assuming an action is taken. In that case the interpreter would answer the question assuming that action is performed (without really applying it).
The upon? keyword is used to hypothesize an action is run. Note that the hypothaticaal upon? action run does not check any action rules, and simply tests the predicate upon applying the action assignments temporarily.
Syntax:
> is upon <action run> do <predicate>.
Here is a chess example:
> is upon White do move E2 E3 do White checked = yes.