Logic of Change: Semantics of Object Systems with Active Relations
I.Bider ilia@ibissoft.se
IbisSoft, Box 19567, SE-10432, Stockholm, Sweden
M.Khomyakov maxim@mag7.ulter.msk.su
Magnificent Seven, 1-st Baltiyskiy per. 6/21-3, Moscow, Russian Federation
E.Pushchinsky
UAbstract. In traditional approaches to object-oriented programming, objects are "active", while relations between them are "passive". The activeness of an object reveals itself when the object invokes a method (function) as a reaction on a message from another object (or itself). While this model is suitable for some tasks, like arranging interactions between windows, widgets and the end-user in a typical GUI environment, it’s not appropriate for others. Business applications development is one of the examples. In this domain, relations between conceptual objects are at least as important as objects themselves and the more appropriate model for this field would be the one where relations are "active" while objects are "passive". A version of such a model is presented in the paper. The model considers a system as consisting of a set of objects, a code of laws, and a set of connectors, each connector hanging on a group of objects that must obey a certain law. Formal logical semantics of this model is presented as a way of analyzing the set of all possible trajectories of all possible systems. The analysis allows to differentiate valid trajectories from invalid ones. The procedural semantics is presented as a state machine that given an initial state, generates all possible trajectories that can be derived from this state. This generator can be considered as a model of a connectors scheduler that allows various degrees of parallelism, from sequential execution to the maxim possible parallelism. In conclusion, a programming language that could be appropriate for the proposed computer environment is discussed, and the problems of applying the model to the business domain are outlined.
Keywords: formal semantics, persistent action, law-based programming, business process, process management.
1. Motivation
When first appeared, the computers were mainly used to complete computational tasks which had a great influence on the evolution of the discipline of programming in the future. The first program abstraction, black box, considered the program as a rigid computational device that having been supplied with a query, would compute the reply, and then stop. The stop was an essential feature of the program, and nonstop symbolized the erroneous behavior.
When nonstop and communication between different programs became a necessity, the problems where first practically solved on the level of operating systems. Later, these requirements lead to evolving the multi-component languages and environments. In AI, this lead to the collaborative agents’ abstraction while in programming - to the object-oriented programming languages, like, Smalltalk, C++, Java. However, the black box abstraction can still be traced in those new environments as individual components, i.e. objects, are often viewed as "black boxes".
Any traditional object-oriented system can be considered as consisting of objects and relations between them. Relations are usually "passive", while objects are "active. Objects possess both the structure and the ability to complete actions. Relations serve as a means of expressing the complex structure of objects, and as the channels for inter-objects communication. The objects interact with each other by exchanging messages, each message triggering the invocation of a method (function, etc.) in the receiver. Communication with the external world, e.g., end-users, external devices, is also defined in the form of messages that come from outside.
The above model is suitable for many computational and non-computational tasks. Arranging interactions between windows, widgets and the end-user in a GUI environment is a typical example were it works very well. In recent years, this model, without major modifications, started to be applied to the design of business applications where it doesn’t fit very well. All leading manuals on object-oriented analysis (see, for example, Rumbaugh et al., 1991, p.153; Coad and Yourdon, 1990, p. 61; Graham, 1995, p. 301) suggest searching for nouns when analyzing the business language of a particular domain. Nouns become objects, while verbs become methods inside those objects. The typical result of using the object-centered approach to the business application design is an employee object that has a method of calculating it’s own wages. This point of view is in apparent contradiction with common sense.
One difference between GUI and business environment is that the latter is driven by changes rather than by receiving external signals (messages). For example, a new purchase order may result from the number of goods in the stock falling below the minimal norm, i.e. the order is initiated by a change in one of the "business objects". Moreover, to calculate the right quantities of goods to order, the history of the stock changes is required, e.g., to know how fast the stock was falling. The result of the purchase process is also a change, the one that restores the normal level of the stock.
Another difference between business and technical domains is that in the business world relations are at least as important as objects themselves, and this tradition goes back to the ER model (Chen, 1976). From the business point of view, the calculation of wages is more natural to represent as a relation between the amount of money on the employee’s account and the time he/she worked for the company this month, rather than a method inside the employee class. (Obviously, this is not the only relation that affects the amount of money on the employee’s account.)
The third major feature of the business domain is that business processes are "human-assisted". The human beings need to have the flexibility not only to change the passive structure of business objects, but also the actions currently planned for them.
The limitations of the classical object-oriented approach are well known, see, for example, the extensive critique in (Kurki-Suonio and Mikkonen, 1999). So called generalized object models, which allow several objects to participate in the same action, where proposed in order to overcome those limitations, e.g., (Kilov and Ross, 1994), (Kurki-Suonio and Mikkonen, 1997). By now, the notion of generalized object model has already found its place in various object-oriented standards, see, for example, (Reference Model for Object Data Management, 1993).
We suggest another approach to the problems while remaining in the frame of the object-oriented paradigm. It consists in reversing the roles assigned to objects and relations. The relations become active, while objects become (relatively) passive. The distribution of roles becomes more even. The objects retain their complex structure (expressed by relations), but "lose" the ability to produce actions. Instead, this ability is handed over to the relations. Messaging disappears from the model while reaction on changes in the objects becomes the main means of communication. The connections with the external world is no longer based on messages received from outside. They are represented by relations that connect objects inside the system with the outside world, human beings becoming part of those "external" relations. From inside, the external relations behave non-deterministically, while their structural properties are the same as for the internal relations.
Note. On a very abstract level, our proposal of moving the weight from objects to relations resembles the main idea of category theory, see, for example (Barr and Wells, 1995).
2. What is discussed
The main topic of discussion in this paper is a precise semantics of a model with active relations. The experience of using this model for business software development, though slightly touched in sections 7, 9, is discussed elsewhere (Bider, 1997a, Bider and Khomyakov, 1997, 1998a, 1998b).
The need for formal semantics is well understood in the theory and practice of programming languages and systems. Currently, this is a topic of ongoing object-oriented standardization activities, see, for example (Kilov, 1993). Our model with active relations is aimed to express the laws of business reality and to help in building business applications, especially those that deal with process management, workflow, etc. These applications tend to become very complex in the end, even when the development starts on a small scale. The absence of a well-defined semantics may easily result in a system that does not fulfill the business requirements.
Conceptually, our approach to defining semantics is very close to the one outlined in (Kurki-Suonio and Mikkonen, 1999). Instead of trying to describe the behavior of any possible system with active relations, we concentrate on finding a practically interesting class of systems the semantics of which can be defined in a straightforward way. We also explore the closed system concept; i.e. the environment is included into the system specification, however incomplete it may be.
Our approach to formalization is similar to the one adopted in the field of logic programming (Lloyd, 1993), but only to some point: in our research, we are not interested in deductive reasoning, but in describing the behavior of dynamic systems. In our formalism, we use the notion of possible worlds that was developed in the field of modal logic starting with the works of Hintikka (Hintikka, 1962), and Kripke (Kripke, 1963). However, we don’t use this notion for speculation about different truth-values of a given formula in different worlds. We use it to formally differentiate valid worlds from invalid ones. Another difference is that we view a possible world not as a set of predicates that describes it, but as an infinite sequence of its states - the world’s history.
The paper has the following structure. In section 3, we give an informal description of the suggested model. In section 4, we present a formal logical semantics of it. In section 5, we discuss the model's procedural semantics without presenting the complete version of it. Section 6 is devoted to discussing a programming environment that would be suitable for our model. Section 7 discusses the issues of business process modeling from which the model with active relations originated. Section 8 reviews the related works. Section 9 contains a brief history of the project, and underlines the advantages of the model with active relations.
3. Informal Discussion
In this section, we will try to introduce all main notions of our model informally, i.e. using as little formal notation as possible. The discussion is not complete and sometimes is not precise, the goal is to offer a general view on our approach. Our aim is to give a definition of a valid world which we present as consisting of:
In a valid world all objects behave properly, i.e. their life is defined by the law imposed on them by a connector.
3.1 Constituents
Our approach to describing the dynamic behavior is state oriented as defined, for example, in (Saaltink and Selic, 1997). We start with the set of objects O that are the main constituents of our world. An object may possess a complex structure the nature of which will be discussed later. For now, we will assume that there is a set S that lists all possible object states.
A function
st: O -> S
that assigns each object o
Î O its state is called a state function. A function w that maps the time axis T into the set of all possible state functions ST:w: T -> ST
is called a world. The world determines the state w(t)(o) of any object o at any point of time t. For simplicity, we consider the discrete time axis with starting point, i.e., it consist of all nonnegative integers called time ticks. A moment of time t in which the value of function w changes is called an event.
We are interested in observing the collective behavior of a selected group of objects, where each object has its own role. Such group may be defined by an n-tuple of objects z = <o1,…, on> which we call an n-component system. The behavior of the system z in the world w can be described by the trace function tracez,w(t) which for each t in T gives the states of all system components (objects). The important instance of a collective behavior is individual one when the system consists of only one object.
An n-ary law
l is defined as a triple <name, condition, action>. The name assigns a name to the law. The condition is a predicate that given a trace of an n-component system, and a point of time t, determines whether the law holds for this system at time t. The action provides the next state of the system for those points for which the law is broken. In other words the action assigns a punishment for breaking the law. The simplest type of laws is a trivial law for which the condition is always true, and the action is always empty.The laws are analogues to the predicates of logical programming. However, they differ from the latter in two important aspects:
In a dynamic world, a system is exposed to external (for this system) disturbances that may change its state. If the law is broken it will take some time to restore it. Therefore, we can’t require the law to hold at each point. We need a more liberal definition of law preservation.
Let H be an integer. We say that a law
l is H-preserved for a system z on an interval r if any interval r' inside r for which the law is broken is no longer than H. We will also say that the behavior of the system H-complies with the law. Thus, the life of a system is a chain of breaking the law and receiving punishment that returns the system to proper life, as illustrated on Fig. 1.
Figure
1. Behavior of the system <X,Y> under the law imposed by the connector C. Dashed intervals on time axis show moments when the law is broken.Now, we can introduce the last element of our world, a connector, as a pair c=<
l,z>, where l is an n-ary law, and z is an n-component system. Objects included in the system are called operands of the connector. If the connector c exists in the world w during an interval r, we will say that the law l is imposed on the system z during this interval. The role of a connector is to watch the behavior of thesystem and see to it that the law is preserved.
3.2 Global Principles and Constraints
We define the validness of the world with the help of Four Global Principles:
The world that satisfies the above principles can be generated by a machine in which a connector is regarded as a processing unit that monitors its operands. A connector
The machine has also a central unit that resolves conflicts when several connectors need access to the same objects. Thus interpreted, the connector behaves as an actor whose motive is a change in his environment and whose intention is to restore the law that has been entrusted to him. In other words, the connector aside from being an "active relationship" between its operands realizes the idea of "persistent action".
The connector machine gives the natural interpretation to the Four Global Principles defined above:
To ensure that a valid world is computable, i.e. the connector machine can generate it, we need to introduce some constraints on any law that can be imposed in the world. The most important are the following two:
Other constraints can be expressed as various symmetries. They ensure that any code of a law is a "finite text":
Thus, there is only a finite set of all possible (factorized) l-tails that can be mentioned in a code of any law.
3.3 Non-determinism and Proactiveness
The universe described in the previous sections may be called quasi-deterministic. If the initial state is fixed, the difference between two worlds derived from it could be explained by different choices of what connector has been fired first in case of a conflict. Such determinism would be justified if when modeling the reality, we could have the exact knowledge of all laws that act in it. This is not true in practice where we always model only a part of the reality. To express this fact we exploit a notion of non-deterministic law. Its nature may be clarified by a so-called boundary connector, i.e. a connector part of which is outside the world being modeled. This part may include some operands (invisible inside our world) and/or some fragments of the law text. What we see inside is a projection of the connector from the bigger world on our world.
We differentiate two types of non-determinism: firing non-determinism, and action non-determinism. For a law with firing non-determinism, an action can be defined even for those points of a trace where the law holds. A connector that imposes such a law may be awoken even when none of its operands have been changed. This connector may, for example, be viewed as a projection of a connector with an additional operand that changes in the outer world, as illustrated on Fig. 2.

Figure 2. The two Worlds. Deterministic connector a. Boundary connectors: b – non-deterministic firing; c – non-deterministic code of law; d – fully non-deterministic.
A law with action non-determinism can specify two different actions for the same point of a trace. A connector entrusted with such a law appears to be taking different courses of action in the same situation. This connector may, for example, be viewed as a projection of a connector with a more detailed text of the law, as illustrated on Fig.2. Those details actually determine what measures should be undertaken to restore the law.
So far, our model has been built as purely reactive, i.e., changes in objects are made as a reaction to changes in other objects. The proactiveness is achieved by the way we define the object structure. The state of an object is determined by a set of connectors currently residing inside it. An exception to this rule is a special state
^ which shows that the object has not been born yet. The state construction rules allow a connector to reside inside one (or more) of its own operands, see Fig.3. Such object structure results in connectors being added and deleted under law restoration which makes the system proactive. Putting inside an object a connector that has this object as one of its operands may result in the chain of actions that in due time will lead to achieving some predefined goal.
Figure 3. An object includes a connector that uses it as his left operand.
3.4 Decomposition
A connector entrusted to guard a law over its operands is the main programming unit of our model. As such, it may be compared with a function in a traditional programming language, like C, or a method in an objet-oriented programming language, like Smalltalk, Java, or C++. The power of a programming language depends on the possibility of decomposing complex computations into simpler ones, including the recursive decomposition. In traditional languages, this power is obtained through (recursive) procedure calls, or function invocations. In object-oriented languages, the same is gained by one object sending a message to another one, or itself which may include direct or indirect recursion.
In our model, the connector guarding the law can’t directly invoke (or send a message to) another connector. The philosophy of decomposition in the model is completely different, and it corresponds to the nature of the programming units. The task of the connector is not to do calculations, but watch its operands and restore order in them. Decomposition for this goal may mean that the "main" law requires that there should always be connectors that guard some "local" laws between (part of) the main connector’s operands. If those connectors are absent, the main connector will add them. Then it is up to the local connectors to ensure that the local laws are satisfied. In case a local law is equal to the main one, we’ll get the recursive decomposition (see example in section 6).
A similar way of decomposition may be found in the programming language REFAL (Turchin, 1989). REFAL has a notion of working area where pure data can be mixed with calls to executable functions. If one function "wants" to invoke another one, it can place a call to the second function in the working area (instead of direct invoking the latter). This call is activated later when the processor of working area reaches it.
It’s worthwhile to mention that the above decomposition does not guarantee that the main law will be satisfied in the end. Changes introduced by other connectors can create a situation were all local laws of the given decomposition are never satisfied simultaneously. Decomposition guarantees only that if nothing else stays in the way, the main law will be satisfied in the end.
4. Logical Semantics - Definition of Valid Worlds
The goal with this section is to prove that our model has precise semantics, and thus it can serve as a sound basis for building software systems. The section consists of a number of definitions that follow the path: signature, interpretation, model. The definitions are built in the normal for logic programming way (as outlined in Lloyd,1993) with the reservation mentioned in section 2. When formally defining the notion of state, we use an approach similar to the one outlined in the club systems (Borshchev and Khomyakov, 1976).
Mostly, the text below just formalizes the notions that have already been discussed informally. However, two extensions are introduced in this section:
The formal text does not follow exactly the line of thought presented under informal discussion. To make the text more readable, we tried when possible to use the terms informally explained in section 3. Another link to the informal discussion consists of the references to the global principles and law constraints in all places we consider relevant.
4.1 Signature
Let A be an alphabet that consists of:
Every constant from V is assigned a type
t from W . By Vt , we will denote the set of all constants of the type t . Every predicate p from P is assigned an arity n > 0, and a type t 1 x t 2 x ... x t k, k ³ 0 where t iÎ W . As P is a finite set, there always is a maximum for both arity n, and length of type k.Let:
then the expression c = pv(z) is called a (well-formed) connector. Objects x1, ..., xn are called the operands of connector c; the set of all operands will be denoted as op(c).
Let UC (Universal set of Connectors) be the set of all possible connectors, and b is a positive integer called capacity. Denote as CARb the set of all subsets from UC that does not include more than b connectors. Let st be a function
st: O -> CARb
È {^ },and alive(st) be the set of objects o
Î O for which st(o)¹ ^ . Then st is called a (well-formed) state if:Denote the set of all possible states with capacity b as USTb (Universal set of States).
Definition. Let c = p(z) be a connector, and there is an object o in a state st such that c Î st(o). Then we'll say that the connector c exists or takes place in state st. We also say that connector c hangs on its operands, the objects from op(c).
Definition. Let st be a state, st Î UST, and s be a subset of objects, and d be a nonnegative integer. Then the set of objects
æ
s , when d = 0gutsd(s, st) = í {o | o Î gutsd-1(s, st), or there exists an object o1 Î gutsd-1(s, st)
è
and a connector c Î st(o1) such that o Î op(c) }, when d > 0is called the guts of depth d of set s in state st. Apart from the objects from the original subset, the guts comprises all sub-objects that are directly, or indirectly included in one of the original objects. The depth of the inclusion is determined by constant d.
Definition. Let st be a state, s be a subset of objects from alive(st), and d be a positive integer. Then the restriction of function st on the subset gutsd-1(s, st,) is called the d-depth body of set s in state st, and is denoted as bodyd(s, st).
Note. The notion of d-depth body is introduced in order to restrict the visibility of the connector’s operands to a certain depth.
Consider a function that assigns a state to each time tick
w: T -> USTb
such that for any t, t' Î T, t' > t: alive(w(t)) Í alive(w(t')). ( When born, never disappear.)
Let t Î T, t > 0, be a moment of time such that w(t) ¹ w(t-1), we'll call such moment an event. Denote the set of objects that were born during the event t as born(w,t):
born(w,t) = {o | o Î O, o Î alive(w(t) and o Ï alive(w(t-1))}
Denote the set of objects whose states were changed during the event t as changed(w,t):
changed(w,t) = {o | o Î alive(w(t-1)) and w(t)(o) ¹ w(t-1)(o)}
Let d, h be positive integers. A function w: T -> USTb is called a (well-formed) world with depth d, capacity b, and inertness h if for any event t there exists a connector c, such that:
The connector c is called the author of the event t. In the above, (a) formalizes the principle of inertness. (b-e) formalize the principle of localism, i.e., changes are localized to the d-depth bodies of the author’s operands. However, new objects may be born there.
The set of all possible worlds for a given alphabet A, depth d, capacity b, and inertness h is called the (A,d,b,h)-chaos language. Denote this set by UWd(A,b,h) (Universal set of Worlds).
4.2 Tracks
The definitions in this subsection prepare a way to formally define the law properties: quasi-idempotentness, fullness, fairness, liveliness, and limited memory.
Let w be a world from UWd, r be a time interval r=[t',t''], and z = <x1, ..., xn> be an n-tuple of objects such that {x1, ..., xn}
Í alive(w(t')). Then the function trajectoryd(z,w,r)(t) defined on the interval r as:trajectoryd(z,w,r)(t) = bodyd({x1, ..., xn}, w(t))
is called a d-depth trajectory of tuple z in world w. The pair <z, trajectoryd(z,w,r)> is called an n-component track; z is called the track's system, d is called the track's depth, and r is called the track's observation period. The moments of time t1, ..., tl, t' < t1 < ,..., < tl < t'', such that trajectoryd(z,w,r)(ti)
¹ trajectoryd (z,w,r)(ti - 1), are called the track's events, and the number of events l is called the track's length.Let tr be a track, then denote:
Denote the set of all possible n-component tracks with depth d and length l in all possible worlds from UWd as UTRd,l,n (Universal set of Tracks).
A track tr
Î UTRd,l,n such that period(tr) = [0, t'] is called a starting track. Denote the set of all possible starting tracks with the length less than or equal to l as USTRd,l,n. (Universal set of Starting Tracks). Note: If l < 0, then USTRd,l,n is considered to be equal to Æ .Definition. Let tr1 be a track, tr1
Î UTRd,l,n, l > 0, and let [t',t''] = period(tr1), and <e1, ..., el> = events(tr1). Then a track tr2Î UTRd,l-1,n such that sys(tr2) = sys(tr1), period(tr2) = [u', t''], where e1 £ u' < e2, events(tr2) = <e2,...,el>, is called a reduction of the track tr1 if:traj(tr2)(t) = traj(tr1)(t) for all t Î period(tr2).
Denote the fact of reduction as tr2 << tr1.
Note. Reduction "truncates" the oldest event. This notion is used when formalizing the quasi-idempotentness property.
Definition. Let tr1 be a track, tr1 Î UTRd,l,n, and let [t',t''] = period(tr1), and <e1, ..., el> = events(tr1). Then a track tr2 Î UTRd,l+1,n such that sys(tr2) = sys(tr1), period(tr2) = [t', u''], where u'' > t'', events(tr2) = < e1, ..., el, el+1>, where el+1<u'', is called an extension of the track tr1 if:
traj(tr2)(t) = traj(tr1)(t) for all t Î period(tr1)
Denote the fact of extension as tr2 >> tr1.
Note. Extension "adds" a new event. This notion is used when formalizing the fullness property.
Definition. Let tr1, tr2 be tracks such that tr1, tr2 Î UTRd,l,n, sys(tr1) = sys(tr2), and let period(tr1) = [t',t''], period(tr2) = [u', u''], events(tr1) = <t1, ..., tl>, and events(tr2) = <u1, ..., ul>. We’ll call these two tracks event-equivalent if:
traj(tr1)(t') = traj(tr2)(u'), traj(tr1)(t1) = traj(tr2)(u1), ..., traj(tr1)(tl) = traj(tr2)(ul), traj(tr1)(t'') = traj(tr2)(u'').
Event-equivalent tracks share the same sequence of events.
Definition. Let tr1, tr2 Î UTRd,l,n be tracks such that period(tr1) = period(tr2). And let sys(tr1) = <x1,...,xn>, sys(tr2) = <y1,...yn>. We’ll call these two tracks object-equivalent if there exists a one to one map of objects:
m: O -> O
such that:
def(traj(tr2)(t)) = {m(o) | o Î def(traj(tr1)(t))},
where def(f) is a set of objects for which function f is defined
traj(tr2)(t)(o) = ^ , if o = m(o') and traj(tr1)(t)(o') = ^ , or
traj(tr2)(t)(o) = {pv(<m(o1),...,m(on)>) |
pv(<o1,...,on>)
Î traj(tr1)(t)(o'), where o = m(o')}, if otherwise.Object-equivalent tracks share the same object structure during the observation period.
Definition. Two tracks tr1, tr2 are called equivalent, denote as tr1
Û tr2, if they are object equivalent, or they are event equivalent, or if there exists a third track tr3 such that tr1 and tr3 are event-equivalent, and tr3 and tr2 are object-equivalent.Note. The notion of track equivalence is used to formalize the law symmetries, i.e., fairness, and liveliness.
4.3 Interpretations
Let l be a positive integer, then an l-interpretation I of an (A,d,b,h)-chaos language L consists of:
p
c: (Dt1 x ... x Dtk) x (UTRd,l-1,n È USTRd,l-2,n) -> {true, false},p
a: (Dt1 x ... x Dtk) x (UTRd,l,n È USTRd,l-1,n) -> {true, false},for each n-ary predicate symbol of type t1 x t2 x ... x tk, k ³ 0. These predicates should satisfy the constraints listed below.
Let v = <v1, ..., vk> Î Vt1 x Vt2 x ...x Vtk be a k-tuple of constants, then by m(v) we will denote the k-tuple <m(v1), ..., m(vk)> Î Dt1 x ... x Dtk. Using this notation, the constraints on the predicates are formulated as follows:
Integer l is called a history length. The pair <pc,pa> is called the meaning of predicate symbol p in interpretation I. The triple <p, pc, pa> is called a law. The condition predicate determines when the system obeys the law. The action predicate shows the way of restoring the law.
Note. The limited memory constraint is introduced implicitly by making the predicates pc and pa work on tracks, instead of full traces.
4.4 Models
Definition. Let w be a world, t'' be a time tick, and c be a connector c = pv(z) such that c takes place in w(t''). We say that c is satisfied at time t'' in the world w in interpretation I if there is a track tr
Î UTRd,l-1,n È USTRd,l-2,n, such that sys(tr) = z, period(tr) = [t', t''], and:Otherwise we say that c is unsatisfied in world w at time t in interpretation I.
Definition. Let e be an event in a world w and a connector c = pv(z) be the author of this event. We say that e is a legal event in interpretation I, if there exist a track tr Î UTRd,l,n È USTRd,l-1,n, such that sys(tr) = z, events(tr)=<e1, ..., ej,e>, where 0 £ j < l, and:
Let I be an l-interpretation of a (A,d,b,h)-chaos language L, H be a positive number (H >> h), and w be a world, w Î UWd(A,b,h). We say that world w is H-valid in interpretation I, if:
An l-interpretation I in which a world w is H-valid is called an (l,H)-model of world w. If for a world w Î UWd(A,b,h), there exists an (l,H)-model, w is called a (d,l)-chaos, or a chaos with depth d, and history length l. A (1,1)-chaos is called a root chaos. In the root chaos, laws do not take into consideration objects’ history, and they don’t "see" the objects deeper than one level.
In this section we present an alternative approach to defining the semantics of valid worlds. This time it has the form of a formal procedure that given an initial state (at time 0) produces an H-valid world (chaos) in an l-interpretation I. We call such procedure a Chaos Generator (CG). An advantage of the procedural approach to defining semantics is twofold:
When defining CG, we will consider only a chaos for which the cardinality of the set CON(w(t)) (the set of all connectors taking place in a world w at time t) is limited for any t
Î T:| CON(w(t)) |
£ M, where M ³ H/hThe above ensures that the principle of limited lawlessness is observed.
Our Chaos Generator works in steps. At each step it produces an extension of the history generated at the previous step. Aside from the history produced so far, the state of the chaos generator is defined by 5-tuple GEN[i]:
GEN[i] = <SCON[i], ECON[i], ACON[i], etime[i], atime[i]>,
where:
SCON[i] - the set of satisfied connectors,
ECON[i] - the set of excited connectors,
ACON[i] - the set of active connectors,
etime[i]: ECON[i]
atime[i]: ACON[i] -> T - time when became active.
Sets SCON[i], ECON[i], and ACON[i] do not intersect, and SCON[i] È ECON[i] È ACON[i] = CON(his[i](i)), where his[i] is the chaos history produced up to the step i. The sets SCON, ECON, ACON are built as follows:
Note. A law is called trivial if its condition predicate is always true, and its action predicate is always false (see informal discussion in section 3). Otherwise the law is called nontrivial.
The idea of CG can be described as a connector’s circulation in nature, see Fig. 4.

Figure 4. Connector’s circulation in nature.
By choosing different algorithms of transferring connectors from one set to another, we can model different ways of solving possible conflicts between connectors that hang on common objects. Three basic types of CG functioning are possible:
Initial state of CG is defined as:
GEN[0] = <SCON[0] = TCON[w(0)], ECON[0] = NTCON[w(0)] - {c}, ACON[0] = {c}, etime[0], atime[0]>,
where:
w[0] - the given initial state of the world;
TCON[w(0)] - the set of connectors with trivial laws (in the initial state of the world);
NTCON[w(0)] - the set of connectors with nontrivial laws (in the initial state of the world);
c
Î NTCON[w(0)] - an arbitrary chosen connector with nontrivial law (from the initial state);etime[0](c') = 0 for any c' Î NTCON[w(0)];
atime[0](c) = 0.
The Chaos Generator described above can be considered as a model of a connector’s scheduler. This model clarifies the relationship between h and H. The condition h*M <= H ensures the principle of limited lawlessness in the worst case: there exist M connectors, and all of them are linked to each other via common objects. Three different algorithms of activating connectors that were mentioned above can be used as a basis for implementing the connector scheduler in three different environments:
6. CHAOS Programming Environment
This section discusses some topics that concern a CHAOS programming environment. The discussion touches such issues as elementary types and classes, communication with external world, and a suitable programming language for writing laws.
6.1 Basic Elements
The model described in the previous sections consists of:
Objects and connectors are the main elements of the model. They are the building blocks of complex structures. Constants are foreigners in this world since they are used to incorporate external data types. Constants may be of simple types, like integer, float, or string, or of some complex types, but even the latter are treated as unstructured entities (so called blobs).
Connectors express objects’ properties and relations. An unary connector expresses properties of its only operand with the help of the k constants (if any). If the connector’s law is trivial, it just assigns properties to the object. If the law is nontrivial, the connector forces the object’s structure and behavior to comply with those properties.
An n-ary connector expresses a relationship between its operands, where constants (if any) describe properties of this relationship. If the connector’s law is trivial it just expresses the (passive) relationship between the objects eventually assigning some properties to the relationship. If the law is nontrivial, the connector forces the objects’ structure and behavior to be in sync with each other and, possibly, with the properties of the relationship.
6.2 Classes
The notion of class is absent from our model. Objects are primary elements of it. A class may be represented as an unary connector that forces the object on which it hangs to have a predefined structure. Moreover, a class may be represented by a binary connector where one operand serves as a template of the structure that should be imposed on the other. The notion of class hierarchy may be represented as a chain of class connectors, where one hangs on the template of the next one in the chain adding additional elements to the previous template.
With our concept of class, an object can change its class during its lifetime. This happens when one class connector is substituted with another one. After that, it’s up to the second connector to rearrange the structure of the object so that it satisfies the requirements of the second class.
As several connectors can hang on the same object, several classes can be assigned to simulating multiple inheritance. It's up to class connectors to solve the inheritance conflicts in one way or another. If the connectors are defined in an incompatible way, hanging them on the same object can lead to the unstable behavior where one connector will always undo the changes done by the others.
6.3 Communication with External World
Boundary connectors are the primary mechanism to model communication with the external world, e.g., people, or electronic devices. A boundary connector may be thought of as having a terminal where a human being can help the connector to do its job.
Let us assume that a connector’s law has action non-determinism. Then it is up to the connector to request the human assistance via the terminal when its operands have been changed, for example, by beeping, blinking, etc. After providing assistance, the human being may return to his other occupations, drinking coffee, for example, until the connector calls him again. Action non-determinism may vary from allowing any possible structural changes in the connector’s operands to a selection from a list of predefined choices (menu).
Now, let a connector’s law have firing non-determinism. Such connector can be represented as a big button that the user presses from time to time based on observations that lie beyond the boundaries of the computer system. Then it’s up to the connector to do the rest of the job.
All other situations of non-determinism may be considered as a combination of the two cases described above, see Fig.5.

Figure 5. Communication with External World.
6.4 Programming Language
A chaos runtime environment consists of a connector scheduler, and a connector executor. The connector scheduler decides when and which connectors should get access to their operands and start their law-enforcement work. The generation procedure described in section 5 outlines the main principles of the scheduler. The executor is a device that given the text of the law, changes the connector’s operands according to it. To facilitate the work of the executor we need a programming language for writing laws.
A law language should have two types of operations:
Different approaches to constructing a law language can be used. For example, it may be built as a relatively low-level language with basic operations, like add/delete connector. However, for dealing with complex structures, a pattern matching and transformation technique would be more appropriate. The sophisticated pattern matching technique has been developed in AI for LISP, PROLOG, and other AI languages. This technique could be used for creating a high-level chaos programming language.
Building a real law programming language lies beyond the scope of this work. To demonstrate the difference between normal and law programming we present two simple examples. One of them is written in a would-be low-level law programming language. It mimics C-syntax, and has loop operations, set operations, and simple pattern matching operations. The other one demonstrates recursive decomposition and is represented by a picture. This picture may be viewed as a prototype for a visual law programming language.
Those two examples are classical: a shallow mirror (corresponds to the shallow_copy function), and a deep mirror (corresponds to the deep_copy function). We use the word mirror instead of copy to stress that we deal with persistent actions rather than functions. Both examples belong to the root chaos as they don’t take into consideration any historic data, and don’t "see" the objects deeper than one level. Nevertheless, those examples demonstrate the basic principles of law programming.
6.5 Examples
Example 1. The shallow_mirror(o1,o2) law enforces object o2 to contain the same connectors as object o1 with one exception. If a connector c from o1 has o1 as one of its operands, connector c1 is included in o2 instead of c, where c1 is derived from c by substituting the operand o1 with o2.
deterministic scheme shallow_mirror( read-only object o1, object o2 )
{
/* Delete from o2 all connectors that do not belong to o1. Loop over all connectors in o2 */
for each c in o2
{
c1 = subst(c, o2/o1)
/* Operation subst(c, x/y) converts connector c in connector c1 by substituting any occurrence of object x by object y */
if c1 not in o1
{
delete(o2, c);
/* Operation delete(o,c) deletes connector c from the body of object o */
}
}
/* Add to o2 all connectors from o1 that are not in o2. Loop over all connectors in o1 */
for each c in o1
{
c1 = subst(c, o1/o2)
if c1 not in o2
{
add(o2, c1);
/* Operation add(o,c) adds connector c to the body of object o */
}
}
}
Example 2. The deep_mirror(o1,o2, buffer) law enforces object o2 to contain images of objects and connectors from the body of object o1. The third operand is used as a buffer for recursive decomposition defined as follows:
This low is declared as:
deterministic law deep_mirror( read-only object o1, object o2, object buffer)
Its functioning is specified by Fig. 6. The figure shows a configuration that should be built in buffer, and o2 based on what is inside o1. Double lines shows universal quantifies "for each connector in o1", "for each operand that is equal to o1", and "for each operand that is not equal to o1". In addition, the correctness of o2, and buffer is determined by the principle of minimalism, i.e. the configuration should be achieved with the minimal set of connectors. The principle will assure that there is only one image for each sub-object, even when several connectors hang on it. The punishment is also defined by the principle of minimalism: to restore the configuration with the minimum of operations add/delete connector. This will ensure that already existing images will still remain.

Figure 6. The deep-mirror law.
Note: The law described above won’t handle properly the situation when an object coincides with its own sub-object on the level deeper than one. It also won’t work if the number of sub-objects in o1 is greater than the capacity b. Then the law will delete the latest added connectors from o1, or signal an exception in some other way.
7. Business Process Modeling
The notion of active relations originated from our work on object-oriented business process modeling. We have found that the objects representing business processes posses some interesting properties that require special consideration, e.g.:
These properties make it not practical using the traditional object-oriented approach to represent business processes. Even the generalized model that allows several objects to participate in the action doesn’t help much. We believe that the model proposed in this paper is better equipped for dealing with the above properties, as it includes time, history, configuration changes etc. However, even this model is too low-level for practical purposes.
The need for higher-level model can be derived from the following conceptual understanding of a business process. A business process serves as a framework for activities that should lead to a well defined objective, e.g., closing a sale, getting money for an incoming order (after delivering the goods), etc. At any given moment of time, the process is characterized by its state that shows how far it is from the objective. The process is driven forward through a set of stipulated states until it reaches the final state. The final state shows that the process objective has been achieved, e.g., all money invoiced for the goods delivered have been received. The objective can be defined as a set of conditions that indicate when the state of the process is considered to be final, see Fig 7.

Figure 7. The order process is not in the final state. The final state is reached when invoiced = to_pay, and paid = invoiced.
The process is driven forward by activities being executed either automatically or with a
human being assistance. Activities can be planned first and executed later. The activities currently planned for the process are included in the process’s state. That allows defining the notion of valid state not only for the final state of the process, but also for any intermediate state, see Fig. 7 and 8.

Figure 8. Left - plan that complements the order’s state on Fig. 7 and makes it valid. Right - list of events up to the state shown on Fig. 7.
The process that is not in the final state, but has no activities planned for moving it to the next stipulated state is considered to be in an invalid state. Formal rules (a law) can be defined that specify what planned activities could be added to the process’ state to make it valid.
Business processes possess the following essential features:
The above listed features make it impossible to effectively control business processes without a supporting system. This is especially true in the business environment where a relatively small staff handles a large amount of processes (see 4 above). The supporting system should help in coordinating the work of many participants of a process (see 3 above), and controlling processes when it’s not feasible to have a project manager assigned to each process. The control should be flexible to achieve the highest degree of automatism when a process follows the standard pattern (autopilot), while allowing manual control when the process deviates from the standard.
To formalize the conceptual understanding presented above, we need to define a number of high-level notions, such as:
The task of formalizing these and other notions, and expressing them in the terms of the object-connectors model lies beyond the frame of this paper; this activity is planned for the near future. Our practical model that introduces and implements the notions needed for business-process modeling is described in (Bider and Khomyakov 1997, 1998a, 1998b ) and (Bider, 1997a, 1997b).
8. Related works
In the practical frame, our work is related to the research being done in the field of business process modeling, see, for example, (Deiters and Gruhn, 1998). In the theoretical domain there are a lot of fields that are related to our research, including AI, object-oriented programming, object-oriented databases, temporal databases, logical programming, etc. Some works from these fields have been referred to in the previous sections. To list all relevant literature would extend the reference list too much.
Many features of our model can be found in other research works, or are in the air. To compare our approach to those of others is beyond the frame of this paper, the exception is made for two areas discussed below. Generally speaking, the essence of our approach is not the features itself, rather the way we are trying to obtain them from a small amount of simple and clear-cut notions.
As far as the concept of law-based programming is concerned, there is an interesting research on the law-governed architecture done by N. H. Minsky (Minsky, 1996). Though the basic idea of using the concept of law for system definition and implementation is the same, the direction of its application is different. We apply the concept of law to describe local behavior, while in (Minsky, 1996) laws are used to describe global behavior.
As far as the system architecture is concerned, our approach is close to the agent-based systems (see, for example, review in Müller, 1996). The similarity is based on the fact that we describe the same kind of dynamic systems, i.e., systems that have both the reactive and proactive behavior. However, the approach to structural presentation of these systems in our formalism, i.e., active relations, differs from the one normally used in the agent-based systems.
9. Concluding Remarks
9.1 History
The object-oriented model presented in this paper is the main result of our CHAOS research project started back in 1984, where CHAOS stands for Concurrent Human-Assisted Object Systems. The main goal was to develop a general approach to building so called human-assisted systems, as opposed to the traditional, human-assisting systems. The former works on its own appealing to the human help only when necessary. The latter represents the traditional view on the business system development; it is a human being who does the work, the system only helps him to perform certain functions.
Our theoretical model was first tested in practice in 1989-90 when we were developing an application for supporting sales and marketing activities of a trading company. The system was called DealDriver to highlight that it helps the workers to "drive" their deals from the beginning to the end that is receiving payment. Our objective was to develop a system able to assist the office workers in all aspects of their everyday work, including registering all activities performed, and helping to plan the new ones, see illustration on Fig. 7-8. For this project, we devised a practical model for representing business processes that may be regarded as a specialization of our formal model (Bider, 1997a). During the project we created home-made development tools that included Hi-base - an object-oriented historical database, and Navi - an object oriented user-interface system (Bider, 1997b). Hi-base is able to store all previous states of the objects and show them on demand. Navi allows the end-user to easily navigate along the links connecting various objects to each other at present and in the past.
9.2 Advantages
The advantages of our approach when applied to business application development are outlined in (Bider 1997a), (Bider and Khomyakov, 1997, 1998a). In addition, using active relations has a number of strong points even when considered in general.
First, the model represents a method of distributed programming that as long as possible separates the programming from implementation issues. The whole system is expressed in terms of local laws, communication and execution control being automatically provided by the environment. Programming is concentrated on objects’ behavior, freeing the developer from message passing, synchronization, assigning the processing units to action execution, etc.
Second, it incorporates
the end-user into the system (as non-deterministic laws), instead of leaving him outside. The system description becomes more uniform making it unnecessary to use two different perspective: the internal view (state transition diagrams), and the external one (use-cases, etc.) as recommended by the traditional object-oriented analysis.Third, it is based on a formal semantics that allows formal reasoning about the properties of the system, e.g., whether it reaches the stable state if left alone.
The general nature of the CHAOS model makes it useful in business application design as well as in designing more technical systems. Currently, the authors are engaged in a practical activity of developing software for managing user-interactions with a computer system based on the CHAOS model.
Acknowledgement
The work of the first author was partly supported by Stockholm foundation "TeknikBroStiftelsen". The authors would also like to thank PSMT and ASE reviewers for their comments on initial drafts of this work.
References
Barr M. and Wells C. 1995. Category Theory for Computing Science. Second Edition. Prentice Hall.
Bider I. 1997a.
Developing Tool Support for Process Oriented Management. Data Base Management 26-01-30, Auerbach, RIA Group.Bider I. 1997b.
Object Driver: A Method for Analysis, Design, and Implementation of Interactive Applications. Data Base Management. 32-10-25, Auerbach, RIA Group.Bider I, and Khomyakov M. 1997.
One Practical Object-Oriented Model of Business Processes. Proc. OOPSLA’97 Workshop on Object-Oriented Behavioral Semantic. Technische Universität München. TUM-I9737: 25-31.Bider I. and Khomyakov M. 1998a.
Object-Oriented Model for Representing Software Production Processes. ECOOP'97 Workshop Reader, Springer, LNCS 1357: 319-322.Bider I. and Khomyakov M, 1998b
. Business Process Modeling – Motivation, Requirements, Implementation. ECOOP'98 Workshop Reader, Springer, LNCS 1543: 217-218.Borshchev V. and Khomiakov M. 1976. Club systems. Automatic Documentation and Mathematical Linguistics.10 (3): 263-278.
Chen P.P. 1976. The entity-relationships model: towards a unified view of data. ACM Trans. on Database Syst.1(1): 9-36.
Coad P. and Yourdon E. 1990. Object-Oriented Analysis. Yourdon Press, Englewood Cliffs, NJ.
Deiters W. And Gruhn V. 1998. Process Management in Practice. Applying the FUNSOFT Net Approach to Large-Scale Processes. Automated Software Engineering. 5(1): 7-25.
Hintikka, J. 1962. Knowledge and Belief. Cornell University Press, Ithaca, NY.
Graham I. 1995. Migrating to Object Technology. Addison-Wesley, Wokingham, England.
Kilov H. 1993. Precise specification of behavior in object-oriented standardization activities. Computer Standards and Interfaces. 15:275-378.
Kilov H. and Ross J. 1994. Information Modeling: An Object-Oriented Approach, Prentice-Hall.
Kripke, S. 1963. Semantical analysis of modal logic. Zeitschrift für Mathematische Logik und Grundlagen der Mathematik, 9:67-96.
Kurki-Suonio R. and Mikkonen T. 1997. Liberating Object-Oriented Modeling From Programming-Level Abstractions. ECOOP'97 Workshop Reader, Springer, LNCS 1357: 195-199.
Kurki-Suonio R. and Mikkonen T. 1999. Harnessing the power of interaction. Information Modelling and Knowledge Bases. H.Jaakkola, H. Kangassalo, E. Kawaguchi eds., IOS Press: 1-11.
Lloyd J.W. 1993. Foundation of Logic Programming. Springer-Verlag.
Minsky N.H. 1996. Law-Governed Regularities in Object Systems. Part 1: An abstract model. Theory and Practice of Object Systems, II (4):283-301
Müller J.P. 1996. The design of Intelligent Agents. Springer. Lecture Notes in Artificial Intelligence 1177.
Reference Model for Object Data Management 1993. Computer Standards and Interfaces. 15:124-142
Rumbaugh J., et al. 1991. Object-Oriented Modeling and Design. Prentice Hall, Inc., Englewood Cliffs, NJ.
Saaltink M. and Selic B. 1997. A semantic Framework for Behavioural Specifications. Proc. OOPSLA’97 Workshop on Object-Oriented Behavioral Semantic. Technische Universität München. TUM-I9737:155-162
Turchin V.F. 1989. Refal-5: Programming Guide and Reference Manual. New England Publishing Co. Holyoke, MA.