The Virtual Language of the Tower Model

The language for defining virtual structures is based upon an observation in relational databases: while relational query languages cannot express all desirable programs and hence have to be augmented by high-level programming languages, they can be used for expressing many programs, especially by less experienced users. Moreover, they permit the specification of these programs at the conceptual level of the data model (i.e. in terms of relations) instead of at the lower level of an actual programming language. Additionally, such limited languages are efficiently implementable, and their optimization problem is tractable in contrast to general programming languages.

Accordingly, the tower model comes with a limited language for the definition of virtual structures in our data model. The language does not define all virtual structures needed, but it can be used to define some of them: specifically, at the level of views within a city.

The virtual structure definition language is an FP-like language made of two layers corresponding to the layering of structures into constructors and objects. The first layer is a small set of functional forms that are higher-order operators (functions), constructing new functions (operators) from given ones. They abstract useful patterns for manipulating the modeling constructs of the Tower Model. These operators are generic, meaning that they are applicable to all instantiations of a modeling construct. For example, the filter operator selects elements of a composite object according to a predicate, irrespective of the actual composite object constructor used to build the object. A second layer consists of operators specific to particular types of structures; e.g. set-theoretic operators for set composite objects.

The first three generic operators are applicable to the values of the objects built by means of our three modeling constructs: composite objects, towers, and cities. These operators are defined in terms of manipulating elements of the values of these objects. These elements are the components of a composite object, the levels of a tower, and the views in a city, respectively.

The fourth operation can only be applied to composite objects: These operators are illustrated by an example with apply-to-all and abstraction and an example with a filter.