| | 73 | === The bundle type: `$bundle` |
| | 74 | |
| | 75 | CIVL-C includes a type named `$bundle`, declared in the CIVL-C standard header `bundle.cvh`. A bundle is basically a sequence of data, wrapped into an atomic package. A bundle is created using a function that specifies a region of memory. One can create a bundle from an array of integers, and another bundle from an array of reals. Both bundles have the same type, `$bundle`. They can therefore be entered into an array of `$bundle`, for example. Hence bundles are useful for mixing objects of different (even statically unknown) types into a single data structure. Later, the contents of a bundle can be extracted with another function that specifies a region of memory into which to unpack the bundle; if that memory does not have the right type to receive the contents of the bundle, a runtime error is generated. The bundle type and its functions are provided by the library `bundle.cvh`. |
| | 76 | The relevant functions for creating and manipulating bundles are given in ... |
| | 77 | |
| | 78 | === The `$scope` type |
| | 79 | |
| | 80 | An object of type `$scope` is a reference to a dynamic scope. It may be thought of as a “dynamic |
| | 81 | scope ID, ” but it is not an integer and cannot be converted to an integer. Operations defined on scopes are discussed in Section .... |
| | 82 | |
| | 83 | === The `$range` and `$domain` types |
| | 84 | |
| | 85 | CIVL-C provides certain abstract datatypes that are useful for representing iteration spaces of loops in an abstract way. |
| | 86 | First, there is a built-in type `$range`. An object of this type represents an ordered set of integers. There are expressions for specifying range values; these are described in Section .... Ranges are typically used as a step in constructing domains, described next. |
| | 87 | |
| | 88 | A domain type is used to represent a set of tuples of integer values. Every tuple in a domain object has the same arity (i.e., number of components). The arity must be at least 1, and is called the dimension of the domain object. |
| | 89 | |
| | 90 | For each integer constant expression n, there is a type `$domain(n)`, representing domains of dimension n. The universal domain type, denoted `$domain`, represents domains of all positive dimensions, i.e., it is the union over all n ≥ 1 of `$domain(n)`. In particular, each `$domain(n)` is a subtype of `$domain`. |
| | 91 | There are expressions for specifying domain values; these are described in Section 6.2.3.2. There are also certains statements that use domains, such as the “CIVL-for” loop `$for`; see Section ... |