A type definition group TYPE-DEFN-GROUP provides a concise way of specifying a collection of sorts equipped with function symbols called constructors and selectors. The intended interpretation is as a freely-generated extension: terms built with the constructors evaluate to distinct values, unless their equality is a consequence of the specified axioms.BASIC-ITEM ::= ... | TYPE-DEFN-GROUP TYPE-DEFN-GROUP::= type-defn-group TYPE-DEFN+ AXIOM*
The order of the type definitions TYPE-DEFN in a TYPE-DEFN-GROUP is insignificant.
When each ALTERNATIVE in a TYPE-DEFN is a SORT, the
defined type corresponds to a sort union (which need not be a disjoint
union).
When all the ALTERNATIVE constructs are constants without
components, the defined type corresponds to an (unordered) enumeration
type.
A COMPONENTS with a list FUN-NAME* of length n>0 provides
n copies of its SORT as argument sorts for the constructor for
the enclosing CONSTRUCT. Moreover, it declares each function
FUN-NAME as a selector, with the argument sort given by the
enclosing TYPE-DEFN, and with the indicated result sort. The
function is declared as total if there is only one CONSTRUCT
in the enclosing TYPE-DEFN, otherwise as partial.
A function symbol may be used more than once in a type definition
group, giving rise to overloading.
A type-definition TYPE-DEFN declares its component SORT.
For each alternative CONSTRUCT it declares the required
constructor and selector functions, and determines axioms asserting
the expected relationship between any selectors and the constructors.
It declares each SORT that occurs as an ALTERNATIVE to be a
subsort of the SORT of the enclosing TYPE-DEFN. All sorts
used in each ALTERNATIVE must be declared in the enclosing
TYPE-DEFN-GROUP or in the local environment provided to it.
TYPE-DEFN ::= type-defn SORT ALTERNATIVE+
ALTERNATIVE ::= CONSTRUCT | SORT
A function FUN-NAME specified in a CONSTRUCT is declared as
a total constructor. Each COMPONENTS specifies one or more
argument sorts for the constructor; its result sort is the SORT
of the enclosing TYPE-DEFN.
CONSTRUCT ::= construct FUN-NAME COMPONENTS*
A COMPONENTS with an empty list FUN-NAME* of selector
functions merely provides its SORT as an argument sort for the
constructor for the enclosing CONSTRUCT.
COMPONENTS ::= components FUN-NAME* SORT
When a TYPE-DEFN-GROUP occurs as a BASIC-ITEM in a
BASIC-SPEC, it corresponds to an EXTENSION of the
TYPE-DEFN-GROUP by the rest of the BASIC-SPEC.
Regarding visibility of symbols, however, basic items that occur
before the TYPE-DEFN-GROUP are not allowed to refer to the
symbols declared by it.
BASIC-ITEM ::= ... | TYPE-DEFN-GROUP
CoFI Tentative Document: LanguageSummary --Version 0.95-- March 6, 1997.
Comments to cofi-language@brics.dk