The DLP support system provides, in addition to a Prolog-like evaluation mechanism, support for objects (having a state, and methods defined by clauses), processes (to realize the object's own activity as well as to evaluate method calls or goals for the object), and a communication mechanism (that allows for a backtrackable rendezvous).
As an example of an object in DLP, look at the travel agency defined in slide dlp-objects-3, which has a non-logical instance variable cities (containing a number of destinations), a constructor travel (which defines the object's own activity) and two methods, reachable and add.
object travel {var cities = [amsterdam, paris, london]. travel() :- accept( all ), travel(). reachable(X) :- member(X, cities). add(X) :- append( cities, [X], R), cities := R. }
travel
?- O = new travel(), O!reachable(X), write(X).
The travel constructor merely consists of a (tail-recursive) loop allowing to accept any request, one at a time. By specifying which requests may be accepted at a particular point in the lifetime of the object, the message interface of the object may be dynamically specified. In addition, an explicit accept statement is needed to guarantee mutual exclusion between method calls.