\section*{Implementation units}
A description of the implementation has been given
in chapter \ref{impl/proto}.
Below we repeat the outline of the prototype
given in section \ref{impl/comp/proto},
now with the actual unit names.
-[N] In the (pseudo) unit N we have defined
a number of frequently occurring abbreviations
as macros.
Apart from type abbreviations
we define a conditional result statement
and the possible values of the state variable of an evaluation
process.
Except for these definitions this unit is empty.
-[T] The implementation of terms is contained
in the unit T, together with a number of definitions to facilitate
the use of terms.
In order to handle terms conveniently we define constructors, tests
and selectors for the major kinds of terms.
-[P] The unit P contains the code for
the sequential Prolog interpreter,
including the evaluation and unification functions and the function
for composing so-called database functions.
-[O] In the unit O the implementation of
objects in the sense of DLP, can be found.
Objects contain part of the functionality
necessary to handle a request for a rendez-vous.
Also the code for dealing with inheritance is provided there.
-[Q]
The unit Q defines the global knot that maintains all global information,
and the global supervisor, that manages the objects.
This unit also contains the definition of the evaluation processes
created for each inference to take
care of tracing and communication with the environment.
-[X] Non-logical variables and channels are defined
in the unit X.
For channels we define the read and write methods involved
in synchronous communication.
-[D] The unit D contains
the initial database.
Apart from a simplification function
that is used in the interpretation of special forms,
this unit contains also the definition of
the primitives needed for process creation,
communication over channels, and for engaging in a rendez-vous.
-[U] Finally, the unit U contains a variety of utilities
for manipulating terms.
We have also collected there a number of auxiliary definitions.
As additional units, not contained in this listing, we have the unit
-[IO] that defines some file handling primitives and the global
object io,
which handles all user input and output;
and the units
-[L] defining the lexical analyzer that reads
in the input file, and
-[Y] that converts DLP programs to
instructions for the global supervisor,
which functions as an object manager.
Note that the units Q and IO specify global objects,
respectively the objects knot, supervisor and io,
that interact when reading in user input.
Object declarations in DLP are actually read in as a sequence
consisting of goals and clauses.
For example the declaration
\hspace{1.0cm}
\b{tabular}{l @{\hspace{1.5cm}} c @{\hspace{1.5cm}} l }
object a { & & object(a). \\
var k, n=1. & corresponds to & var(k, n=1). \\
& the sequence & \\
} & & end_object.
\e{tabular}
The clauses and goals are read in one by one, by the global object io,
and sent to the global supervisor.
For unit clauses,
it is tested whether they must be interpreted
as a command. C.f. section \ref{code:parse}.
Each newly declared DLP object is then
added to the object list of the global knot.
As a remark,
the parser defined in Y
allows brackets to be omitted in a number of cases.
However, brackets may always be used.
When reading the code, keep in mind
that variables occurring in methods,
not declared as temporary variables,
are usually instance variables of the object/class
for which the method is defined.
However, our use of macros, defined in the units N, U and T,
somewhat overturns the scoping rules as used in POOL-X.
To aid in understanding the program text,
we have included a glossary of the names
defined as macros, aliases, globals, classes,
functions and methods.