next up previous contents index
Next: 5.6 Predefined Types Up: 5 Reference Manual Previous: 5.4 Definition of Operators

5.5 Definition of Phyla

external

Phyla  may be introduced implicitly or explicitly.

An operator definition implicitly defines the codomain of its signature as a phylum if is not already declared. So most of the phyla in an abstract syntax will be implicitly defined.

The definition

pair : Elem # Elem -> Pair;

defines Pair as a phylum, and pair as an operator whose codomain is Pair. This definition does not define Elem that must be defined somewhere else.

external

5.5.1 external Type Inclusion

A type inclusion  implicitly defines the container as a phylum if it is not already declared.

The following example of type inclusion expresses the fact that an identifier is also an expression.

Example:

Id < Exp;

Predefined types cannot be used in a type inclusion.

Circular definitions of phyla results in equal phyla and will be indicated by the type-checker as a warning.

external

5.5.2 external Union of Phyla

A phylum can also be defined explicitly as the union of other phyla . In this case, it is not possible to include some other phylum in it later on, neither to use it as the co-domain of an operator.

Example:

Exp_Stat = Exp + Stat;

external

5.5.3 external Modularity

Explicit definition of phyla and phyla inclusion may use some phyla imported from a previously defined formalism, allowing modular definition of abstract syntaxes.

external Formalism Inclusion, Typed Names

external

5.5.4 external Syntax

Here is the complete syntax of phyla inclusion and phyla union:

inclusion --> tid "<" sinclusion ";"
sinclusion -->   id
               | id "<" sinclusion
union --> id "=" tid ("+" tid)* ";"

external


next up previous contents index
Next: 5.6 Predefined Types Up: 5 Reference Manual Previous: 5.4 Definition of Operators

Thierry Despeyroux
Fri May 16 15:24:06 MET DST 1997