Objects, processes and communication
The computation model of DLP combines the computation model underlying
Prolog and the model underlying a parallel object oriented language.
Parallel object oriented processing must support objects,
processes and communication between objects.
Objects
contain non-logical (persistent) data
and clauses defining the functionality of an object.\ftn{
The clauses are identical to ordinary Prolog clauses,
except for the possible occurrence of special atoms for creating
new objects or for communicating with other objects.
}
Objects may be active or passive.
The activity of an object is defined by so-called
constructor clauses that describe the own activity of an object.
Apart from constructor clauses, active objects may also contain so-called
method clauses that are used when the object receives a method call.
A method call is simply the request to evaluate a goal.
Processes
are created when creating a new active object
and for the evaluation of a method call.
The process executing the own activity of an active object is called
the constructor process.
For each method call a process is created to enable backtracking
over the results of a method call.
Passive objects have no activity but answering to method calls.
Active objects must explicitly interrupt their own activity to indicate the willingness
to answer a method call.
Communication
with another object takes place by engaging in a (synchronous) rendez-vous.
In order to achieve compatibility with the ordinary Prolog goal
evaluation, DLP supports
global backtracking over the results of a rendez-vous.
With respect to backtracking,
it is transparent whether a goal is evaluated remotely,
by another object or locally,
provided the necessary clauses are defined.
This transparency holds for both passive and active objects.
Passive objects allow unlimited internal concurrency:
in other words, an indefinite number of method calls may be active
simultaneously.
For active objects, mutual exclusion is provided
to the extent that when a particular method call is accepted
no other method call will be accepted
until the first answer for that call is delivered.
This protocol of mutual exclusion seemed more
natural than either locking out the object until all
answers have been delivered or providing no mutual exclusion at all.