Go backward to 5.2 Semantic Concepts
Go up to 5 Architectural Specifications
Go forward to 5.4 Example

5.3 Language Constructs

This section provides examples that illustrate the CASL language constructs for use in architectural specifications: architectural specification definitions, unit declarations, unit definitions, unit specifications, and unit expressions.

Architectural Specifications:

A definition of an architectural specification specifies some units and how to compose them, e.g.:

arch spec
Imp_Nat_List =
units
N : Nat ;
F : Nat -> List [Nat]
result
F[N]
A model of the above architectural specification consists of a unit N, a unit function F, and the unit F[N], which is itself a model of the structured specification List [Nat].

Unit Declarations and Definitions:

A unit declaration names a unit that is to be developed, and gives its type. When the type is an ordinary specification, the unit is to be an ordinary model of it; when the type is a function type, the unit is to be a function from (compatible) ordinary models to ordinary models that extend the arguments. Some examples of unit declarations:

N : Nat
L : List [Nat] given N
F : Nat -> List [Nat]
The form of unit declaration using `given' provides an implicit declaration of a unit function that gets applied just once. If the declaration of F were to be replaced by that of L in the architectural specification example given above (letting the result be simply L as well) then an implementation of the architectural specification would still involve providing a function that could give an implementation of List [Nat] extending any implementation N of Nat.

A unit definition names a unit that can be obtained from previous units (in the same architectural specification), possibly involving fitting, hiding, translation, etc.:

L = F[N]
L = F[N fit...] hide...
The unit expressions in the right-hand sides of unit definitions are of the same form as used for specifying the result unit of an architectural specification (as explained below).

Unit Specifications:

A unit specification definition names a unit type, allowing it to be reused. E.g.:

unit spec
Gen_List = Nat -> List [Nat]
A unit declaration may then refer to it, as in F : Gen_List.

Architectural specifications themselves may also be used as unit specifications.

Unit Expressions:

The various forms of unit expression mostly resemble those of structured specifications:

However, the semantics of unit expressions involves operations on individual models, rather than on entire model classes. In particular, amalgamation of models requires that any common symbols are interpreted the same way. Note that abstraction is needed to allow architectural specifications whose results are unit functions.
CoFI Document: CASL/GuidedTour -- Version: 1 -- July 1999.
Comments to pdmosses@brics.dk

Go backward to 5.2 Semantic Concepts
Go up to 5 Architectural Specifications
Go forward to 5.4 Example