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 c(t) } } \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 c(t) } } \put(1.5,3.3){\line(5,2){1.1} } \put(1.8,2){ \circle{0.5} } \put(0.9,2.4){ \makebox{ \footnotesize m1(t1) } } \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 c(t) } } \put(1.5,3.3){\line(5,2){1.1} } \put(1.8,2){ \circle{0.5} } \put(0.9,2.4){ \makebox{ \footnotesize m1(t1) } } \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 m2(t2) } } \put(3.6,1.8){\line(-1,6){0.26} } \e{picture} \\ \hline \nop{ \leftcomment{goal} O = new(c(t)) & O!m1(t1) & O!m2(t2) \\ \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 m1(t1). & \small \sloppy Similarly a process is created to evaluate m2(t2). \\ \hline } \nop{ \leftcomment{method} ctr() :- accept(any), ctr(). & inc() :- n = n + 1. & value(N) :- N = n. \\ \hline } \e{tabular} The call O = new(c(t)) results in a new instance of the object c together with a constructor process evaluating c(t). Both the calls O!m1(t1) and O!m2(t2), which may come from different processes, result in a separate process for evaluating these calls.