Reference manual / Z-related commands / In situ replacement commands / quantify by unification

The quantify by unification command performs reasoning analogous to the quantification tac built-in tactic, except that the values for the quantified declarations are supplied not explicitly but instead are determined by unification of two expressions. It should be applied to the two expressions to be unified. Both expressions must be within antecedent or consequent predicates of a goal. At least one of the expressions should be within a quantified predicate. Those quantified predicates should be entire antecedents or consequents, or else should be indicated by selection immediately after selecting the corresponding expression. They cannot be the same quantified predicate. The declarations of those quantified predicates are the jokers for the unification. If the two expressions are unifiable, a most general unifier is calculated and used to perform quantifications on the quantified predicates.

For example, if x + 0 and succ 0 + 0 are selected...

 | x : x + 0 = x ? succ 0 + 0 = succ 0 ( x : x + 0 = x) ( x : | x = succ 0 x + 0 = x) ? succ 0 + 0 = succ 0

When both predicates are quantified and the expression found to match a declaration refers to out-of-scope jokers of the other predicate, universal quantifications of those jokers are introduced (the references are moved outside the scope of the jokers' original declarations).

 | a : a = 0 ? b : 2*b = 0 ( a : a = 0) ( b : a : | a = 2*b a = 0) ? b : 2*b = 0

These additional quantified declarations are like those of the jokers, i.e. they are not necessarily in terms of carrier sets, but can include implicit constraints. If those constraints refer to other declarations that are similarly out-of-scope, then those are quantified similarly, etc.

In some cases, there isn't a unique most general unifier, but several possibilities. One of these is calculated and used. Selecting the two arguments in reverse may result in a different most general unifier, and hence a different quantification being performed.

Tactic example

"quantify by unification" e1 e2

This example applies the quantify by unification rule to the expressions e1 and e2.

IT 28-Dec-2005