The commutation command swaps the operands of commutative operators. There are two categories of commutations: elementary ones that are built-in to cadiz, and ones that are coded explicitly as Z rewrite rules. An example of the latter is as follows.
[X] ![]() ![]() ![]() ![]() ![]() ![]() |
The form of a rewrite rule must be as specified in rewrite by rule, and moreover its name must have commutation as a sub-string. The effect of a rewrite rule is also explained in rewrite by rule.
The built-in elementary commutations are as follows. They take precedence over any matching explicit rewrite rule.
e1 = e2 | ![]() | e2 = e1 |
p1 ![]() | ![]() | p2 ![]() |
e1 ![]() | ![]() | e2 ![]() |
p1 ![]() | ![]() | p2 ![]() |
e1 ![]() | ![]() | e2 ![]() |
p1 ![]() | ![]() | p2 ![]() |
e1 ![]() | ![]() | e2 ![]() |
p1 ![]() | ![]() | p2 ![]() |
e1 ![]() | ![]() | e2 ![]() |
"commutation" p3 p4
This example applies the commutation command to predicates p3 and p4.