Up Next
Go up to 8.1 Unit Declarations and Definitions
Go forward to 8.1.2 Unit Definitions

8.1.1 Unit Declarations

      UNIT-DECL    ::= unit-decl UNIT-NAME UNIT-SPEC UNIT-IMPORTS
      UNIT-IMPORTS ::= unit-imports UNIT-TERM*
      UNIT-NAME    ::= SIMPLE-ID

A unit declaration UNIT-DECL is written:

UN : USP given UT1,...,UTn
When the list UNIT-TERM* of unit terms is empty, it is simply written:
UN : USP

It provides not only a unit specification USP but also a unit name UN, which is used for referring to the unit in subsequent unit expressions, so that the same unit may be used more than once in a composition.

In addition, the UNIT-IMPORTS lists any units UT1, ...,UTn that are imported for the implementation of the declared unit (corresponding to implementing a generic unit function and applying it only once, to the imported units, [CHANGED:] the type of the generic function being merely the union of the signatures of the UTi). [] [CHANGED:] The unit specification USP is treated as an extension of the signatures of the imported units, thus being given a non-empty local environment, in general. []


CoFI Document: CASL/Summary-v1.0 -- Version: 1.0 -- 22 October 1998.
Comments to cofi-language@brics.dk

Up Next