CADiZ

Reference manual / Z-related commands / In situ replacement commands / distribution


There are two categories of distributions: 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.

union_distribution ==

[X] \vdash? \forall S, T, U : \power X @ S \cup (T \cup U) = (S \cup T) \cup U

The form of a rewrite rule must be as specified in rewrite by rule, and moreover its name must have distribution as a sub-string. The effect of a rewrite rule is also explained in rewrite by rule.

The built-in elementary distributions spread out, or distribute, the selected formula into the immediate parent formula of which it is a part. These distributions behave as in situ replacements of the parents. In each of the distribution rules, the left-hand side depicts the parent formula, with the inspected formula shown parenthesized. Only one distribution can be performed at once. They take precedence over any matching explicit rewrite rule. In each of the following subsections, the earliest applicable distribution in the list is the one that is applied.

Contents of this page

Predicate

Conjunction

p1 \land (p2 \land p3)   \trarrow   (p1 \land p2) \land p3
(p1 \land p2) \land p3   \trarrow   p1 \land (p2 \land p3)
p1 \land (p2 \lor p3)   \trarrow   (p1 \land p2) \lor (p1 \land p3)
(p1 \lor p2) \land p3   \trarrow   (p1 \land p3) \lor (p2 \land p3)
p1 \land (\lnot p2)   \trarrow   \lnot (p1 \implies p2)
(\lnot p1) \land p2   \trarrow   \lnot (p2 \implies p1)
p1 \land (p2 \implies p3)   \trarrow   (p1 \implies p2) \implies (p1 \land p3)
(p1 \implies p2) \land p3   \trarrow   (p3 \implies p1) \implies (p2 \land p3)
p1 \land (p2 \iff p3)   \trarrow   p1 \land p2 \iff p1 \implies p3
(p1 \iff p2) \land p3   \trarrow   p3 \implies p1 \iff p2 \land p3
p1 \land (\exists s @ p2)   \trarrow   \exists s @ p1 \land p2
(\exists s @ p1) \land p2   \trarrow   \exists s @ p1 \land p2
p1 \land (\exists1 s @ p2)   \trarrow   \exists1 s @ p1 \land p2
(\exists1 s @ p1) \land p2   \trarrow   \exists1 s @ p1 \land p2

Disjunction

p1 \lor (p2 \land p3)   \trarrow   (p1 \lor p2) \land (p1 \lor p3)
(p1 \land p2) \lor p3   \trarrow   (p1 \lor p3) \land (p2 \lor p3)
p1 \lor (p2 \lor p3)   \trarrow   (p1 \lor p2) \lor p3
(p1 \lor p2) \lor p3   \trarrow   p1 \lor (p2 \lor p3)
p1 \lor (\lnot p2)   \trarrow   p2 \implies p1
(\lnot p1) \lor p2   \trarrow   p1 \implies p2
p1 \lor (p2 \implies p3)   \trarrow   p2 \implies (p1 \lor p3)
(p1 \implies p2) \lor p3   \trarrow   p1 \implies (p2 \lor p3)
p1 \lor (p2 \iff p3)   \trarrow   p2 \implies p1 \iff p3 \implies p1
(p1 \iff p2) \lor p3   \trarrow   p1 \implies p3 \iff p2 \implies p3
p1 \lor (\forall s @ p2)   \trarrow   \forall s @ p1 \lor p2
(\forall s @ p1) \lor p2   \trarrow   \forall s @ p1 \lor p2

Negation

\lnot (p1 \land p2)   \trarrow   \lnot p1 \lor \lnot p2
\lnot (p1 \lor p2)   \trarrow   \lnot p1 \land \lnot p2
\lnot (p1 \implies p2)   \trarrow   p1 \land \lnot p2
\lnot (p1 \iff p2)   \trarrow   \lnot p1 \iff p2

Implication

p1 \implies (p2 \land p3)   \trarrow   (p1 \implies p2) \land (p1 \implies p3)
(p1 \land p2) \implies p3   \trarrow   p1 \implies (p2 \implies p3)
p1 \implies (p2 \lor p3)   \trarrow   (p1 \implies p2) \lor p3
(p1 \lor p2) \implies p3   \trarrow   (p1 \implies p3) \land (p2 \implies p3)
p1 \implies (\lnot p2)   \trarrow   \lnot (p1 \land p2)
(\lnot p1) \implies p2   \trarrow   p1 \lor p2
p1 \implies (p2 \implies p3)   \trarrow   (p1 \land p2) \implies p3
(p1 \implies p2) \implies p3   \trarrow   (p1 \lor p3) \land (p2 \implies p3)
p1 \implies (p2 \iff p3)   \trarrow   (p1 \land p2) \iff (p1 \land p3)
(p1 \iff p2) \implies p3   \trarrow   (p1 \lor p3) \iff (p2 \implies p3)
p1 \implies (\forall s @ p2)   \trarrow   \forall s @ p1 \implies p2
(\exists s @ p1) \implies p2   \trarrow   \forall s @ p1 \implies p2

Equivalence

p1 \iff (\lnot p2)   \trarrow   \lnot (p1 \iff p2)
(\lnot p1) \iff p2   \trarrow   \lnot (p1 \iff p2)
p1 \iff (p2 \iff p3)   \trarrow   (p1 \iff p2) \iff p3
(p1 \iff p2) \iff p3   \trarrow   p1 \iff (p2 \iff p3)

Universal quantification

\forall ds | (p1 \lor p2) @ p3   \trarrow   (\forall ds | p1 @ p3) \land (\forall ds | p2 @ p3)
\forall s @ (p1 \land p2)   \trarrow   (\forall s @ p1) \land (\forall s @ p2)
\forall s @ (p1 \lor p2)   \trarrow   (\forall s @ p1) \lor (\forall s @ p2) where s has only == decs
\forall s @ (p1 \implies p2)   \trarrow   (\exists s @ p1) \implies (\forall s @ p2) where s has only == decs

See also separation.

Existential quantification

\exists ds | (p1 \lor p2) @ p3   \trarrow   (\exists ds | p1 @ p3) \lor (\exists ds | p2 @ p3)
\exists s @ (p1 \land p2)   \trarrow   (\exists s @ p1) \land (\exists s @ p2) where s has only == decs
\exists s @ (p1 \lor p2)   \trarrow   (\exists s @ p1) \lor (\exists s @ p2)
\exists s @ (p1 \implies p2)   \trarrow   (\forall s @ p1) \implies (\exists s @ p2)

See also separation.

Unique existential quantification

\exists1 s @ (p1 \land p2)   \trarrow   (\exists1 s @ p1) \land (\exists1 s @ p2) where s has only == decs
\exists1 s @ (p1 \lor p2)   \trarrow   (\exists1 s @ p1) \lor (\exists1 s @ p2) where s has only == decs
\exists1 s @ (p1 \implies P2)   \trarrow   (\exists1 s @ p1) \implies (\exists1 s @ p2) where s has only == decs

See also separation.

Relation

relop (..., (if p then e1 else e2), ... )   \trarrow   (p \implies relop (..., e1, ...)) \land (\lnot p \implies relop (..., e2, ...))
relop (..., (\mu s @ e), ...)   \trarrow   \exists s @ relop (..., e, ...) where s has only == decs
e1 \in { ds | (p1 \lor p2) @ e2 }   \trarrow   e1 \in { ds | p1 @ e2 } \lor e1 \in { ds | p2 @ e2 }
e1 \in \lambda ds | (p1 \lor p2) @ e2   \trarrow   e1 \in \lambda ds | p1 @ e2 \lor e1 \in \lambda ds | p2 @ e2
e \in (e1 \land e2)   \trarrow   e \in e1 \land e \in e2 where e1 and e2 are of the same type
e \in (e1 \lor e2)   \trarrow   e \in e1 \lor e \in e2 where e1 and e2 are of the same type
e \in (e1 \implies e2)   \trarrow   e \in e1 \implies e \in e2 where e1 and e2 are of the same type
e \in (e1 \iff e2)   \trarrow   e \in e1 \iff e \in e2 where e1 and e2 are of the same type
e \in (\lnot e2)   \trarrow   \lnot e \in e2

Expression

Schema construction

[ds | (p1 \land p2)]   \trarrow   [ds | p1] \land [ds | p2]
[ds | (p1 \lor p2)]   \trarrow   [ds | p1] \lor [ds | p2]
[ds | (p1 \implies p2)]   \trarrow   [ds | p1] \implies [ds | p2]
[ds | (p1 \iff p2)]   \trarrow   [ds | p1] \iff [ds | p2]
[ds | (\lnot p)]   \trarrow   \lnot [ds | p]

Schema decoration

(\lblot i1 == e1, ..., in == en \rblot) +   \trarrow   \lblot i1+ == e1, ..., in+ == en \rblot
([ d1; ...; dn | p ]) +   \trarrow   [ d1+; ...; dn+ | p + ]
(\lnot e) +   \trarrow   \lnot (e +)
(e1 \land e2) +   \trarrow   (e1 +) \land (e2 +)
(e1 \lor e2) +   \trarrow   (e1 +) \lor (e2 +)
(e1 \implies e2) +   \trarrow   (e1 +) \implies (e2 +)
(e1 \iff e2) +   \trarrow   (e1 +) \iff (e2 +)
(e1 \xor e2) +   \trarrow   (e1 +) \xor (e2 +)

Schema renaming

([ d1; ...; dn | p ]) [..., jk/ik, ...]   \trarrow   [ d1[..., jk/ik, ...]; ...; dn[..., jk/ik, ...] | p [..., jk/ik, ...] ]
(\lnot e) [..., jk/ik, ...]   \trarrow   \lnot (e [..., jk/ik, ...])
(e1 \land e2) [..., jk/ik, ...]   \trarrow   (e1 [..., jk/ik, ...]) \land (e2 [..., jk/ik, ...])
(e1 \lor e2) [..., jk/ik, ...]   \trarrow   (e1 [..., jk/ik, ...]) \lor (e2 [..., jk/ik, ...])
(e1 \implies e2) [..., jk/ik, ...]   \trarrow   (e1 [..., jk/ik, ...]) \implies (e2 [..., jk/ik, ...])
(e1 \iff e2) [..., jk/ik, ...]   \trarrow   (e1 [..., jk/ik, ...]) \iff (e2 [..., jk/ik, ...])
(e1 \xor e2) [..., jk/ik, ...]   \trarrow   (e1 [..., jk/ik, ...]) \xor (e2 [..., jk/ik, ...])

Schema precondition

pre (e1 \lor e2)   \trarrow   pre e1 \lor pre e2

Schema quantification

\forall ds1 | p1 @ ([ds2 | p2])   \trarrow   [ds2 \ ds1 | \forall ds1 | p1 @ p2]
\exists ds1 | p1 @ ([ds2 | p2])   \trarrow   [ds2 \ ds1 | \exists ds1 | p1 @ p2]
\exists1 ds1 | p1 @ ([ds2 | p2])   \trarrow   [ds2 \ ds1 | \exists1 ds1 | p1 @ p2]

where there are no schema inclusions in ds1 or ds2.

Schema text

...; ([ds | p1]); ... | p2   \trarrow   ...; ds; ... | p1 \land p2

where the selection is a schema inclusion declaration, and the schema text is not immediately within a lambda expression.

Sequent

...; ([ds | p]); ... | ps \vdash? qs   \trarrow   ...; ds; ... | p, ps \vdash? qs

where the selection is a schema inclusion declaration.

Tactic example

"distribution" p

This example applies the distribution command to predicate p.

Any jokers bound to the selected formula are rebound to the whole result, where those are both of the same syntactic category.


IT 6-Jul-2000