if_then_else_fi, and qualification operators are
included. These structures belong to the so-called extended signature of
a module. The main structures added in the extended signature of a module are:
op (_).S : S -> S .
This helps in the disambiguation of ad-hoc overloaded constants and terms. As an
example, remember from Section 3.6 that if we
declare 0 as an ad-hoc overloaded constant for natural numbers and
for natural numbers modulo 3, then we can disambiguate the expression
0 + 0 by writing, for example, 0 + (0).Nat and
0 + (0).Nat3, or (0 + 0).Nat and (0 + 0).Nat3.
As another example, in the module META-MODULE (see Section 11.3),
the term none is ambiguous, since the operator none is used
as the empty set of operator declarations, equations, rules, etc. We can
disambiguate it by writing (none).OpDeclSet. Of course, these
disambiguation operators can be used not only for constants, but for any term.
For example, we can write (2 + 3).Nat as a valid term in the predefined
module NAT.
op (_) : S -> S .
for each sort S in its signature.
These operators allow the use of parentheses
without having to declare a parentheses operator for each sort. For example,
(2 + 3), (2 + 3) + 5, (2 + (3) + 5),
(((2 + 3)) + 5),
are all valid terms in NAT, thanks to these declarations.
_+_(2, 3) is equivalent to 2 + 3, and the terms
if true then 2 + 3 else - 3 fi
and
if_then_else_fi(true, _+_(2, 3), -_(3)) are equivalent;
any combination is possible so
if_then_else_fi(true, 2 + 3, - 3) is also valid.
gcd(2, 3, 4) is a valid term in
NAT, where gcd is the greater common divisor operator, which
is declared as a binary associative operator. Of course, this term can always
be written in the standard format as gcd(2, gcd(3, 4)) or
gcd(gcd(2, 3), 4). Furthermore, we can combine this possibility with the
single-identifier form to write things like _+_(2, 3, 4) instead of
_+_(_+_(2, 3), 4) or _+_(2, _+_(3, 4)), but of course, since _+_
is declared with the assoc attribute in the predefined module NAT,
we can just write 2 + 3 + 4.
if_then_else_fi, _==_, and _=/=_) are generated
for each sort in the module; in addition, for each sort S, a sort
predicate _:: S is also added.
All these modules and operators are fully explained in Section 7.1.