Processes
Multiple processes may refer to a single object.
Apart from the constructor process,
a process is created for each method call in order to keep track of
the backtracking over the results of that call.
We have pictured an object and some processes referring to it below.
\setlength{\unitlength}{1cm}
\hspace{0.5cm}
\b{tabular}[t]{|p{3.6cm}|p{3.6cm}|p{3.6cm}|} \hline
\b{picture}(3.5,3.6)(0.9,1)
\put(2.5,3.5){
\b{tabular}[b]{|p{1.2cm}|} \hline
{\small\it object} c \\
\e{tabular}
}
\put(1.2,3.2){ \circle*{0.5} }
\put(0.8,3.7){ \makebox{ \footnotesize } }
\put(1.5,3.3){\line(5,2){1.1} }
\e{picture}
&
\b{picture}(3.5,3.6)(0.9,1)
\put(2.5,3.5){
\b{tabular}[b]{|p{1.2cm}|} \hline
{\small\it object} c \\
\e{tabular}
}
\put(1.2,3.2){ \circle*{0.5} }
\put(0.8,3.7){ \makebox{ \footnotesize } }
\put(1.5,3.3){\line(5,2){1.1} }
\put(1.8,2){ \circle{0.5} }
\put(0.9,2.4){ \makebox{ \footnotesize } }
\put(2.1,2.3){\line(2,3){0.7} }
\e{picture}
&
\b{picture}(3.5,3.6)(0.9,1)
\put(2.5,3.5){
\b{tabular}[b]{|p{1.2cm}|} \hline
{\small\it object} c \\
\e{tabular}
}
\put(1.2,3.2){ \circle*{0.5} }
\put(0.8,3.7){ \makebox{ \footnotesize } }
\put(1.5,3.3){\line(5,2){1.1} }
\put(1.8,2){ \circle{0.5} }
\put(0.9,2.4){ \makebox{ \footnotesize } }
\put(2.1,2.3){\line(2,3){0.7} }
\put(3.6,1.5){ \circle{0.5} }
\put(3.4,2.1){ \makebox{ \footnotesize } }
\put(3.6,1.8){\line(-1,6){0.26} }
\e{picture}
\\ \hline
\nop{
\leftcomment{goal}
& & \\
\leftcomment{effect}
\small \sloppy A new object is created,
and its non-logical variables are initialized.
& \small \sloppy A process is created to
evaluate the goal .
& \small \sloppy Similarly a process is created to evaluate
.
\\ \hline
}
\nop{
\leftcomment{method}
ctr() :- accept(any), ctr().
& inc() :- n = n + 1.
& value(N) :- N = n.
\\ \hline
}
\e{tabular}
The call results in a new instance of the object c
together with a constructor process evaluating .
Both the calls and , which may come from
different processes,
result in a separate process for evaluating these calls.