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,...,UTnWhen 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.