page 2  (8 pages)
to previous section1
3to next section

of this kind of variable. Generally, in the context of CLLs, arguments to describe state variables are omitted and procedures within an object are executed in parallel, so multiple writing to these variables must be avoided. On the other hand, a special primitive is usually supplied by the language to update state variables; generally, it is similar to an assignment. In fact, the new primitive is used in Vulcan, and the becomes primitive in Polka, whereas an annotation on variables together with some special predicates to receive and send messages, are used in A'UM.

Similarly, the communication among objects in these languages is made along shared logical variables which are instantiated incrementally, so exploiting the AND-stream parallelism. A number of primitives have also been defined to simplify the manipulation of channels, but generally the communication is one-to-one, and the way of obtaining many-to-one or one-to-many communication is explicitly made by using merge or broadcast processes.

In order to avoid this kind of problem derived from state variables and communication channels handling, we propose to extend the unification theory, in order to provide a formal framework to manipulate them, so avoiding the definition of extra-logical primitives. This justifies some technique elements which have been used to define the operational semantics of L2 k O2, a concurrent object-oriented logic language, on which this work has been developed. L2 k O2 incorporates the most relevant object-oriented mechanisms into Parlog. This means that two unification operators are available: bidirectional and unidirectional unification. The extension of the first one will imply a natural extension of the second one, such that each version will be used to set and access the state, respectively.

On the other hand, as is well known, the object-oriented paradigm is adequate to distributed programming; however, when the logic paradigm is involved, the unification implementation on distributed systems becomes too inefficient when communication costs are very high. Taking into account that the communication mechanism in CLLs is based on shared logical variables, the distributed unification problem can be partially solved if the system includes state variables and they can be locally manipulated. That is, when a message is sent from one object to another one, and they are distributed on different processors, the unification between the message and the head of the selected clause to process it is made in the receiver processor. So, if some logical variable occurred on an argument of the message, then the unification would include remote references to the sender processor. We think this inefficiency can be reduced by using state variables and an extension of unification as proposed.

In Section 2, we present the main aspects of the L2 k O2language, enhancing those related with state modification and communication. Then, in Section 3, the most general unifier of two terms containing logical and state variables is defined. In Section 4, we discuss how the unification of two channels can be interpreted in such way that different kinds of communication can be established. Finally, some conclusions and future work are also described.

2 Logic, concurrency and objects

The incorporation of parallelism into logic has been achieved by applying different approaches. One of the more relevant proposals in this sense has been the family of concurrent logic languages, which were developed to exploit AND-stream parallelism. On the other hand, logic also has been used as a point of reference for object-orientation [10]. We are interested in the combination of the three paradigms: logic, concurrency and objects; and we have chosen CLLs to give the logical and concurrent support.

Concurrent logic languages support the object-oriented paradigm by considering objects as perpetual processes, and the messages among them as information transfer by means of shared variables. Based on this idea, Pimentel and Troya (1991) proposed L2 k O2, a language integrating object-oriented and concurrent logic paradigms. So, logic, concurrency, and objects are combined to obtain a new language with the expressive power of declarative languages and the capability to manipulate objects concurrently. In this section we present a subset of L2 k O2. It does not represent a substantial restriction on the full definition of the language, and it allows the abstraction of some irrelevant details in relation to the