Content

## Data

Each computer program collects, processes and outputs data. Therefore we can simplify a computer program as DATA + ALGORITHM. Here we focus on the DATA.

The data of a computer program is a representation of a model which lives in our mind about our world. The elements of a model are objects and the semantics of a model is based on the relations between these objects. An object in essence is an association with a pattern in our world and its relations with other objects in our mind. With our senses: sight, hearing, taste, smell or touch, we are able to map patterns to objects. The whole purpose of our mind is in fact to monitor events in our surroundings and take appropriate actions. An event is a measurement of some facts relating to a context. When we communicate with each other we use a language. A language is a mapping from the model in our mind to tokens and vice-versa. It just enables us to interface with other humans, which is usefull to coordinate actions in a group of individuals. Of course for one to understand the communication one need to understand the mapping of these tokens to the model. This requires that we share a certain model about our world.

The data of a computer program is similar and consists of:

• objects
• relations between objects
• facts

We introduce some terminology to facilitate our further study. We call classes of objects dimensions. As the whole purpose of the model is to measure events, it make sense to call the axis along which we measure: dimensions. Therefore we call the data model of a computer program a dimensional model. Each object is an instance of the object that represents a class of objects, a dimension. We call this an instance relation (IS_A) between the object and its class. The relation between objects is defined by a relation between a dimension I with another dimension II. This relation we call a characteristic of a dimension (HAS_CHAR) and is bidirectional. A characteristic defines subsets of a dimension. Facts are represented by tokens (like numbers and characters) which follow some syntax rules or just patterns (like streams of bits for sound and image). A fact is specified by a data type, DATA, which represents the pattern of tokens and a length in bytes of the pattern, LEN. A fact which relates to one dimension is called a property of that dimension (HAS_PROP) and belongs to the dimension PROPERTY. When the distinction between property or characteristic is not important we will use the term attribute. Facts related to more than one dimension we will call a measurement of an event (HAS_MEASURE). An event is just a dimension, but of a certain kind. We use a dimension EVENT to classify all dimensions which are events. All other dimensions we call referential data for events.

Notice that everything in our data model is an instance direct or indirect of a root DIMENSION. We assume that each instance has an identifier, ID. Instances of an EVENT type have no ID. These instances are identified by characteristics.

We define a number of functions to work with the dat in our data model.

The first function is ID() which returns a new unique ID.

Each instance must be an instance of either a dimension or an event type. We define the function IS_A(i)=d/e which defines i as an instance of dimension d or event type e. The relation IS_A(i) returns the dimension d or event type e of the instance i.

For interfacing with the data model we need tokens. We assume that each ID of an instance has a one-to-one relation with a property CODE. CODE is a token representation of the instance. We define the following functions CODE(i) which returns a token of instance i and I(token) which returns an instance i.

A CODE is in terms of our data model an instance of the dimension PROPERTY. A property is represented by a stream of tokens. We must define the some essential properties of this stream. For that we need two new properties: DATA for the data type and LEN for the length in bytes of the stream of tokens. We add DATA and LEN as instances to the dimension PROPERTY. Each instance of PROPERTY has now 3 properties: CODE, DATA and LEN.

The PROPERTY dimension defines relation types between an instance of a dimension and a token representation. We define the following functions:

• I_PROP(i,p):returns the token representation of a property p for an instance i of a dimension.
• PROP_I(p,pattern):return all instances for which the property p has a token representation that matches pattern.
• I_PROP(p,i)=token: assigment of token to property p of instance i, token=NULL is removal of property
• DIM_PROP(d):returns properties for dimension d.
• DIM_PROP(d,p,+/-):Add/Remove property p to/from dimension d.
• PROP_DIM(p):returns dimension which have property p.

The CHARACTERISTIC dimension defines relation types between two instances. These instances can be of the same dimension or of different dimensions. We define the same type of relations as for the PROPERTY dimension:

• I_CHAR(i,c): returns for instance i the related instance of characteristic c
• CHAR_I(c,i): return the instances that are related to instance i of characteristic c
• I_CHAR(i,c)=j: assignment of instance j of characteristic c to instance i,token=NULL is removal of characteristic
• DIM_CHAR(d,c,+/-):Add/Remove characteristic c to/from dimension d.
• DIM_CHAR(d):defines characteristics for dimension d
• CHAR_DIM(c):returns dimensions which have characteristic c.

The meta model consist of the following objects and relations:

• ID=1;IS_A(1)=1; I_PROP(1,6):"DIMENSION";DIM_PROP(1):6
• ID=2;IS_A(2)=1; I_PROP(2,6):"EVENT"
• ID=3;IS_A(3)=1; I_PROP(3,6):"CHARACTERISTIC"
• ID=4;IS_A(4)=1; I_PROP(4,6):"PROPERTY"; DIM_PROP(4):6,7,8
• ID=5;IS_A(5)=1; I_PROP(5,6):"MEASURE"
• ID=6;IS_A(6)=4; I_PROP(6,6):"CODE",I_PROP(6,7):"CHAR",I_PROP(6,8):"12"
• ID=7;IS_A(7)=4; I_PROP(7,6):"DATA",I_PROP(7,7):"CHAR",I_PROP(7,8):"12"
• ID=8;IS_A(8)=4; I_PROP(8,6):"DATA",I_PROP(8,7):"CHAR",I_PROP(8,8):"12"