The typedefs file is used for specification of the set of initial configurations. - each file contains a set of types, the memory is then assembled from the nodes of this types connected by selectors - there are 2 types of selectors * direct links (= no routing expression) * undirect links - described by a path over the direct links - "-next" = folow the selector next "backwards" "next" = folow the selector next forward - the "routing expression" is composed from the "backward" part and "forward" (one of them may be empty) Examples of rouing expressions: /*? -left + -right ?*/ = "follow selectors left or right backward" /*? -left, -right, left ?*/ = "folow selector left backward, right backward, and left forward /*? (-left + - right), (left + right) ?*/ = "follow backwards left or right, and then forward left or right" - the selectors, which are not defined inside the type are automatically set to "undefined". Let us describe it on examples. -------------------------------------------------------- The following definition is for 2 independent doubly-linked list with at least 2 elements, where the head of the first one is pointed by pointer variable "list1" and the head of the second one by pointer variable "list2": - there are 2 types of nodes, the most top one, and the inner ones. The reason to distinguish this is the "back" pointer - from the most top node (Tinit) is "null", and from the inner one (T2) is pointing to the previous one. typedef struct Tinit /*? list1 list2 ?*/ { struct T2 * next ; struct T2 * back ; /*? null ?*/ }; typedef struct T2 { struct T2 * next ; /*? null ?*/ struct Any * back ; /*? -next ?*/ } + { struct T2 * next ; struct Any * back ; /*? -next ?*/ }; --------------------------------------------------------- The binary tree with parent pointers and at least one node is described as follows (the top node is pointed by variable tree): typedef struct Top /*? tree ?*/ { struct Inner * left ; struct Inner * right ; struct Any * back ; /*? null ?*/ } + { struct Inner * left ; /*? null ?*/ struct Inner * right ; /*? null ?*/ struct Any * back ; /*? null ?*/ }; typedef struct Inner { struct Inner * left ; struct Inner * right ; struct Any * back ; /*? -left + -right ?*/ } + { struct Inner * left ; /*? null ?*/ struct Inner * right ; /*? null ?*/ struct Any * back ; /*? -left + -right ?*/ }; ------------------------------------------------------------------ A binary tree pointed by variable top is described as follows: (there are only direct links and null pointers). typedef struct T /*? top ?*/ { struct T * left ; struct T * right ; } + { struct T * left ; /*? null ?*/ struct T * right ; } + { struct T * left ; struct T * right ; /*? null ?*/ } + { struct T * left ; /*? null ?*/ struct T * right ; /*? null ?*/ };