CADiZ

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


The absorption command performs simplifications that typically remove parts of formulae or at least make them smaller. There are two categories of absorptions: 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_absorption ==

[X] \vdash? \forall S : \power X @ S \cup {} = S

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

The built-in elementary absorptions are as follows. They take precedence over any matching explicit rewrite rule. In each of the following subsections, the earliest applicable elementary simplification in the list is the one that is applied.

Contents of this page

Predicates

Negations

\lnot false   \trarrow   true
\lnot true   \trarrow   false
\lnot \lnot p   \trarrow   p

Conjunctions

p \land false   \trarrow   false
false \land p   \trarrow   false
p \land \lnot p   \trarrow   false
\lnot p \land p   \trarrow   false
p \land true   \trarrow   p
true \land p   \trarrow   p
p \land p   \trarrow   p

p NL false   \trarrow   false
false NL p   \trarrow   false
p NL \lnot p   \trarrow   false
\lnot p NL p   \trarrow   false
p NL true   \trarrow   p
true NL p   \trarrow   p
p NL p   \trarrow   p

Disjunctions

p \lor true   \trarrow   true
true \lor p   \trarrow   true
p \lor \lnot p   \trarrow   true
\lnot p \lor p   \trarrow   true
p \lor false   \trarrow   p
false \lor p   \trarrow   p
p \lor p   \trarrow   p

Implications

false \implies p   \trarrow   true
p \implies true   \trarrow   true
p \implies p   \trarrow   true
true \implies p   \trarrow   p
\lnot p \implies p   \trarrow   p
p \implies false   \trarrow   \lnot p
p \implies \lnot p   \trarrow   \lnot p

Equivalences

p \iff p   \trarrow   true
p \iff \lnot p   \trarrow   false
\lnot p \iff p   \trarrow   false
true \iff p   \trarrow   p
p \iff true   \trarrow   p
false \iff p   \trarrow   \lnot p
p \iff false   \trarrow   \lnot p

Universal quantifications

\forall ds | false @ p   \trarrow   true
\forall s @ true   \trarrow   true
\forall ds | p @ p   \trarrow   true
\forall | true @ p   \trarrow   p
\forall | p1 @ p2   \trarrow   p1 \implies p2
\forall ds1 @ \forall ds2 | p1 @ p2   \trarrow   \forall ds1; ds2 | p1 @ p2

where the last rule is applicable only if no name is declared in both ds1 and ds2, and there are no references to ds1 from ds2.

Existential quantifications

\exists ds | false @ p   \trarrow   false
\exists s @ false   \trarrow   false
\exists | true @ p   \trarrow   p
\exists ds | p @ p   \trarrow   \exists ds @ p
\exists | p1 @ p2   \trarrow   p1 \land p2
\exists ds1 @ \exists ds2 | p1 @ p2   \trarrow   \exists ds1; ds2 | p1 @ p2

where the last rule is applicable only if no name is declared in both ds1 and ds2, and there are no references to ds1 from ds2.

Unique existential quantifications

\exists1 ds | false @ p   \trarrow   false
\exists1 s @ false   \trarrow   false
\exists1 | true @ p   \trarrow   p
\exists1 ds | p @ p   \trarrow   \exists1 ds @ p
\exists1 | p1 @ p2   \trarrow   p1 \land p2

Relations

e = e   \trarrow   true
e1 = e2   \trarrow   false where e1 and e2 are distinct literals.
e1 \in e2   \trarrow   true where e2 denotes the carrier set of the non-empty type of e1.
i \in e   \trarrow   true where i's declaration is of the form i : e.
i \in e2   \trarrow   true where i's declaration is of the form i : e and e2 is the carrier set of e.
i . b \in eb   \trarrow   true where i's declaration is of the form i : e1 \cross ... \cross eb \cross ... \cross en.
i . b \in eb2   \trarrow   true where i's declaration is of the form i : e1 \cross ... \cross eb \cross ... \cross en and eb2 is the carrier set of eb.
e1 . i \in e   \trarrow   true where i's declaration in the signature of e1 is of the form i : e.
e1 . i \in e2   \trarrow   true where i's declaration in the signature of e1 is of the form i : e and e2 is the carrier set of e.

Literals are numbers, strings, or extensions (sets, tuples, bindings) containing nothing but literals.

A type is non-empty in the following circumstances. The given type \arithmos is known to be non-empty (this follows from the prelude), and free types that contain at least one element (nullary constructor) are known to be non-empty, but other given types cannot be assumed to be non-empty. Powerset types are known to be non-empty. Cartesian product and schema types are non-empty if all of their components are non-empty. Generic types cannot be assumed to be non-empty. So a type could be empty if it uses any empty given or generic types other than within powerset types.

Schema predicates

e   \trarrow   true

where e is a schema predicate, and there is an inclusion declaration e in scope, and the environment of the schema predicate is given entirely by that declaration.

Expressions

{ ds | false @ e }   \trarrow   { }
{ | true @ e }   \trarrow   { e }
\lambda ds | false @ e   \trarrow   { }
\mu | true @ e   \trarrow   e
let | true @ e   \trarrow   e
\lblot i1 == e1, ..., in == en \rblot . ik   \trarrow   ek
( e1, ..., en ) . b   \trarrow   eb
if true then e1 else e2   \trarrow   e1
if false then e1 else e2   \trarrow   e2
if p then e else e   \trarrow   e
{ \lblot ds \rblot }   \trarrow   [ ds ]
[ ds | false ]   \trarrow   { }

Tactic example

"absorption" e p

This example applies the absorption command to expression e and predicate p.


IT 29-Nov-2001