Logic Box Quick Reference

Expressions

Integer6758
VariableFooBar11
RecordFooBar[expression, expression, expression…]

Predicates

Equalexpression = expression
ANDpredicate & predicate & predicate …
ORpredicate | predicate | predicate …
Exists~variable predicate
CallFooBar{expression, expression, expression…}

Primitives

PRIM_True{}
Predicate that always succeeds. By default, True{} is an alias to this.
PRIM_False{}
Predicate that always fails. By default, False{} is an alias to this.
PRIM_FieldsHeadTail{record, head, tail}

Succeeds if taking “tail” (which must be a record expression) and prepending “head” as a new field yields “record” (which must also be a record expression). For example, PRIM_FieldsHeadTail{Tuple[1, 2, 3], 1, Tuple[2, 3]} succeeds.

In the usual logic-programming style, this predicate can be used both to join a head and a tail together to make a new record, or to split a record apart to make a head and a tail. Note that either the “record” argument or the “tail” argument must be a record, or the predicate point-blank fails. (It won't matter if it's a variable which later becomes a record; by then, the predicate has already failed.)