Prev Up Next
Go backward to 4.1 Subsort Declarations
Go up to 4 Subsorting Constructs
Go forward to 4.3 Datatype Declarations

4.2 Axioms and Terms

As for many-sorted specifications, an atomic formula is well-formed (with respect to the current declarations) if it is well-sorted and expands to a unique atomic formula for constructing sentences of the underlying institution--but now for subsorted specifications, uniqueness is required only up to an  equivalence on atomic formulae and terms. Equivalence between fully-qualified terms t, t' is the least congruence including the following cases:

Equivalence between fully-qualified atomic formulae is the least congruence including the following cases:

The notions of when an atomic formula or term is well-sorted and of its expansion are indicated below for the various subsorting constructs. Due not only to overloading of predicate and/or function symbols, but also to implicit embeddings from subsorts into supersorts, a well-sorted atomic formula or term may have several non-equivalent expansions, preventing it from being well-formed. Qualifications on function and predicate symbols, or explicit sorts on terms, may be used to determine the intended expansion (up to the equivalence indicated above) and make it well-formed.

ATOM             ::=  ... | MEMBERSHIP
MEMBERSHIP       ::=  membership TERM SORT
Atomic formulae ATOM are extended with a construct for testing membership in subsorts. A membership formula is well-sorted if the specified TERM is well-sorted for a supersort s' of the specified SORT s. It expands to an application of the pre-declared predicate symbol for testing s' values for membership in the embedding of s.

TERM             ::=  ... | CAST
CAST             ::=  cast TERM SORT
Term formation is extended too, by providing a casting construct CAST for projections (there are no implicit casts). The cast of the specified TERM to a SORT s is well-sorted if the term is well-sorted for a supersort s' of s. It expands to an application of the pre-declared function symbol for projecting from s' to s.

Term formation is also extended by letting a well-formed term of a subsort s be regarded as a well-sorted term of a supersort s' as well, which provides implicit embedding. It expands to the explicit application of the pre-declared function symbol for embedding s into s'. Also a SORTED-TERM expands to an explicit application of an embedding, provided that the apparent sort of the component TERM is a subsort of the specified SORT.


CoFI Document: CASL/Summary-v0.97 --Version 0.97-- 20 May 1997.
Comments to cofi-language@brics.dk

Prev Up Next