%% latex 
%% \documentstyle{article}

%% search for START to find the beginning of this document

\def\keywordfont{\it}\def\operatorfont{\small\rm}\def\smalloperatorfont{\tiny\rm}\newcommand{\commentindex}[1]{\index{#1}}\newcommand{\paragraphindex}[1]{\index{#1}}\newcommand{\subparagraphindex}[1]{\index{#1}}\newcommand{\markpart}[1]{\markboth{}{}}\newcommand{\markchapter}[1]{\markboth{\markfont{#1}}{}}\newcommand{\marksection}[1]{\markright{\markfont{\thesection. #1}}}\newcommand{\marksubsection}[1]{}\newcommand{\markitright}[1]{\markright{\markfont{#1}}}\newfont{\headfnt}{cmssi8} \def\markfont{\headfnt}

\documentstyle{article}



%  LAY-OUT
      \pagestyle{myheadings}
      \markboth{}{}
      \textwidth 15.5cm
      \textheight 21.5cm
      \parindent 10pt
      \oddsidemargin 0.25cm   % 6 mm afgetrokken
      \evensidemargin -0.10cm   % .47 cm afgetrokken
      \def\refhead{\section*{References}}

%% SPECIAL

\def\blokfont{}

\def\n{\newline}
\def\ln{\par\nnstrut\par\noindent}
\def\nl{\n\mbox{}\n}
\def\nln{\n\mbox{}\n\mbox{}\n}
\def\nnstrut{\rule{0cm}{.7ex}}
\def\nn{\par}
\def\onn{\par\nnstrut\par\noindent}

% STELLINGEN e.d.

\newtheorem{Df}{Definition}[section]
\newtheorem{Lm}[Df]{Lemma}
\newtheorem{Tm}[Df]{Theorem}
\newtheorem{Th}[Df]{Theorem}
\newtheorem{Prop}[Df]{Proposition}
\newtheorem{Co}[Df]{Corollary}

\newcommand{\Dfc}[2]{\begin{Df}#1\xline{\mbox{$ \Box $}}\end{Df}}

\newcommand{\id}[1]{#1}


%% AUX COMM

\newcommand{\xline}[1]{\hspace*{\fill}\nolinebreak {#1} }
\newcommand{\zline}[1]{\xline{{\footnotesize #1}}}
\newcommand{\xeline}[1]{\hspace*{\fill}\hspace{-1cm}\nolinebreak #1 }
%%\newcommand{\qed}{\xline{\mbox{$ \quad\Box $}}}
\newcommand{\qed}{\hspace*{\fill}\mbox{$  \:  $}\nolinebreak\hspace{-0.5cm}\mbox{$ \quad\Box $}}

\newcommand{\rem}{\hspace*{\fill}\nolinebreak \par \bigskip \noindent}

\newcommand{\Pf}{{\bf Proof:  } }
\newcommand{\Ex}{\ln{\bf Example } }
\newcommand{\Exs}{{\bf Examples: } }

%% GENERAL ENVS

%% LISTS 1 indent

\def\ni{\noindent}

\newcounter{ctrA}
\newenvironment{listA}{
\begin{minipage}[t]{\mwidth}
\begin{list}{\alph{ctrA}.}{
	     \usecounter{ctrA}
	     \setlength{\leftmargin}{1cm}}
}{ 
\end{list}
\end{minipage}
}

\newcounter{ctrE}
\newenvironment{listE}{
\begin{list}{}{\usecounter{ctrE}}}{ \end{list} }

\newcounter{ctrN}
\newenvironment{listN}{
\begin{list}{\arabic{ctrN}.}{\usecounter{ctrN}}}{ \end{list} }

\newcounter{ctrR}
\newenvironment{listR}{
\begin{list}{\roman{ctrR}.}{\usecounter{ctrR}}}{ \end{list} }

%% FORMAT

\newenvironment{EN}{}{}            
\newenvironment{EP}{\tt\small}{}
\newenvironment{EI}{\it}{}
\newenvironment{EK}{\it}{}
\newenvironment{EM}{\it}{}
\newenvironment{ET}{\tt}{}
\newenvironment{EB}{\bf}{}
%%\newenvironment{EB}{ \begin{minipage}[t]{12cm} }{\end{minipage}}
%%\newenvironment{ET}{\begin{tabbing}\it}{\end{tabbing}\endD}
\newenvironment{ES}{\blokfont}{}
\newenvironment{EC}{\footnotesize\it}{}

\def\xendD{\par\noindent\hspace{-.5ex}}
\def\endD{\noindent\hspace{-0.4ex}}
\newenvironment{DB}{ \begin{minipage}[t]{\DBwidth}\begin{verse}}
		   {\end{verse}\end{minipage}}
\newenvironment{DD}{\begin{verse}\ddfont}{\end{verse}\endD} 
\newenvironment{DI}{\begin{verse}}{\end{verse}\endD} 
\newenvironment{DE}{\begin{verse}}{\end{verse}\endD} 
\newenvironment{DL}{\begin{verse}}{\end{verse}\endD} 
\newenvironment{DN}{\begin{verse}}{\end{verse}}
\newenvironment{DP}{\begin{verse}\dpfont}{\end{verse}\endD}
\newenvironment{DM}{\hspace{0.0cm}\begin{verse}\it}{\end{verse}\endD}
\def\ddfont{}
\def\dpfont{\tt\small}
\def\dtfont{\tt\small}
\newenvironment{DT}{\dtfont\begin{tabbing}\hspace{0.0cm} \= }{\end{tabbing}\endD}

%% LIST

\def\enub{\renewcommand{\theenumi}{\alph{enumi}}}
\def\enue{\renewcommand{\theenumi}{\arabic{enumi}}}

\def\labeli#1{\def\labelenumi{#1}}
\def\labelii#1{\def\labelenumii{#1}}
\def\labeliii#1{\def\labelenumiii{#1}}
\def\labeliv#1{\def\labelenumi{#1}}
%%\def\lA{\liA}
%%\def\lB{\li}
%%\def\liA{\eniA}
%%\def\liB{\labeli{$ \bullet $}}
\def\eniA{\def\labelenumi{\alph{enumi}.}\def\theenumi{\alph{enumi}}}
\def\eniB{\def\labelenumi{$ \bullet $}\def\theenumi{\alph{enumi}}}
\def\eniE{\def\labelenumi{\skipx}\def\theenumi{\skipx}}
\def\eniN{\def\labelenumi{\arabic{enumi}.}\def\theenumi{\arabic{enumi}}}
\def\eniR{\def\labelenumi{(\roman{enumi})}\def\theenumi{\roman{enumi}}}

\def\eniiA{\def\labelenumii{\alph{enumii}.}\def\theenumii{\alph{enumii}}}
%%\def\eniiB{\labelii{$ \bullet $}}
\def\eniiE{\def\labelenumii{\skipx}\def\theenumii{\skipx}}
\def\eniiN{\def\labelenumii{\arabic{enumii}.}\def\theenumii{\arabic{enumii}}}
\def\eniiR{\def\labelenumii{(\roman{enumii})}\def\theenumii{\roman{enumii}}}

\def\eniiiA{\def\labelenumiii{\alph{enumiii}.}\def\theenumiii{\alph{enumiii}}}
%%\def\eniiiB{\labeliii{$ \bullet $}}
\def\eniiiE{\def\labelenumiii{\skipx}\def\theenumiii{\skipx}}
\def\eniiiN{\def\labelenumiii{\arabic{enumiii}.}\def\theenumiii{\arabic{enumiii}}}
\def\eniiiR{\def\labelenumiii{\roman{enumiii}.}\def\theenumiii{\roman{enumiii}}}

\newcounter{ctrK}
\def\ucK{\usecounter{ctrK} \renewcommand{\thectrK}{\alph{ctrK}}}

\newenvironment{LA}{\eniA\begin{enumerate}}{\end{enumerate}\eniN}
\newenvironment{LE}{\eniE\begin{enumerate}}{\end{enumerate}\eniN}
\newenvironment{LN}{\eniN\begin{enumerate}}{\end{enumerate}\eniN}
\newenvironment{LR}{\eniR\begin{enumerate}}{\end{enumerate}\eniN}

\newenvironment{LI}{ \begin{itemize} }{\end{itemize}}
\newenvironment{LL}{ \begin{description} }{\end{description}}
\newenvironment{LB}{ \begin{minipage}[t]{12cm} }{\end{minipage}}
\newenvironment{LD}{ \begin{minipage}[t]{\LDwidth}\begin{itemize} }{ 
		     \end{itemize}\end{minipage}}
\newenvironment{LM}{ \begin{minipage}[t]{12cm} }{\end{minipage}}

%% SPECIAL

\newcommand{\nax}[2]{ #2 \xline{#1} }

\newcommand{\naxa}[4]{
	\begin{math}
		\begin{array}{ll}
		\mbox{#2 \xline{#1}} \\
		& \mbox{#3} \\
		& \mbox{#4} 
		\end{array}
	\end{math}
	}

\newcommand{\naxb}[4]{ #2
	\begin{minipage}[t]{5cm}
	\ \ \ 
	\vspace{0.5ex} #3
	\vspace{0.5ex} #4
	\end{minipage}
	}

%%\newenvironment{T}{\bf Transition system:  }{\bf end. }
%% 10 pts

\def\skipx{}

\def\backquote{`}
\def\doublebackquote{``}
\def\crosscross{\#\#}
\def\crosscrosscross{\#\#\#}
\def\procentsign{\%}
\def\cross{\#}
\def\hatcolon{\^:}
\def\colon{:}
\def\backsl{\mbox{$ \backslash $}}
\def\bs{\backsl}
\def\scirc{\mbox{\raisebox{.3ex}{\skipx{\tiny $  \, \circ \,  $}}}}
\def\xcirc{\mbox{\normalsize $  \, \circ \,  $}}
\def\scup{\mbox{$  \: \cup \:  $}}
\def\ahat{^}
\def\dollar{\$}
\def\tttbar{$  \: | \:  $}
\def\undersc{\_}
\def\uscmm{\mbox{$ \!\_\: $}}
\def\usc{\mbox{\skipx{\rm \_}}}
\def\poolcomment{\skipx{\footnotesize \%\%}}
\def\eiffelcomment{\skipx{\footnotesize -{}-}}
\def\assignsym{:=}
\def\exclamsym{!}

%% MISC

% VOOR EEN 10-PTS VERSIE: Verwijder eerstvolgende twee %-tekens
       
       \newcommand{\nat} { \mbox{\hspace{.1cm}} {\rm N} \mbox{\hspace{-.328cm}} {\rm I} \mbox{\hspace{.2cm}}}
       
       \newcommand{\sys}[1]{[\!  [#1]\!]} 

       \newcommand{\gpijl}{\raisebox{.1ex}{ {\bf - \hspace{-.22cm}-                      \hspace{-.22cm}- \hspace{-.22cm}- \hspace{-.22cm}-                              \hspace{-.22cm}- \hspace{-.22cm}- \hspace{-.22cm}-                             \hspace{-.22cm}- \hspace{-.22cm}- }}\hspace{-.53cm}\rightarrow}
       \newcommand{\tpijl}{\longrightarrow \mbox{\hspace{-.48cm}}                               \rightarrow \mbox{\hspace{.0cm}}}

 
%\newcommand{\sys}[1]{[\!  [#1]\!]}

%% BRACKETS

\def\lcurb{\{}
\def\rcurb{\}}
\def\loblbr{\it\hbox{\bf [}}
\def\roblbr{\it\hbox{\bf ]}}
\def\lsemb{[\![}
\def\rsemb{]\!]}


%% ABBREVS

\newcommand{\desda}{\hspace{.1in} \Longleftrightarrow \hspace{.1in}}
\newcommand{\desdak}{\Longleftrightarrow}
\newcommand{\imp}{\hspace{.1in} \Longrightarrow \hspace{.1in}}
\newcommand{\impk}{\Longrightarrow}

%% ARROWS

\newcommand{\pijl}{\longrightarrow}
\newcommand{\dpijl}{\leadsto}
\newcommand{\apijl}[1]{\stackrel{#1}{\pijl}}
\newcommand{\adpijl}[1]{\stackrel{#1}{\leadsto}}
\newcommand{\atpijl}[1]{\stackrel{#1}{\tpijl}}

%% MISC

\newcommand{\lllparll}{\,
           \setlength{\unitlength}{1ex}
           \begin{picture}(1,1.75)
           \put(0,0){\line(0,1){1.75}}
           \put(0.45,0){\line(0,1){1.75}}
           \end{picture}
           \,}

\newcommand{\lmerge}{\,
           \setlength{\unitlength}{1ex}
           \begin{picture}(1,1.75)
           \put(0,0){\line(1,0){1}}
           \put(0,0){\line(0,1){1.75}}
           \put(0.45,0){\line(0,1){1.75}}
           \end{picture}
           \, \:}

\newcommand{\parll}{\parallel}

\newcommand{\absurd}[1]{\stackrel{\raisebox{-.5ex}{\mbox{$  #1  $}}} {\surd}}
\newcommand{\asurd}[1]{\stackrel{#1}{\surd}}
\newcommand{\bsurd}[1]{\stackrel{#1}{\surd}}
\newcommand{\rhda}[1]{ \skipx{ \: \rhd_{#1} \: }}
\def\myappendix{%\par
 \setcounter{section}{0}
 \setcounter{subsection}{0}
 \setcounter{subsubsection}{0}
 %%\def\thesection{\Alph{section}}
}
\def\bookappendix{
   \setcounter{chapter}{0}
   \def\thechapter{\Alph{chapter}}
   }
\def\bkappendix{%\par
 \setcounter{section}{0}
 \setcounter{subsection}{0}
 \setcounter{subsubsection}{0}
}
\def\theparagraph{}
\def\thesubparagraph{}
\def \CWI{
{\footnotesize \sl Centre for Mathematics and Computer Science} \\ 
{\footnotesize \sl P.O. Box 4079, 1009 AB Amsterdam, The Netherlands}\\
{\footnotesize \sl email: eliens@cwi.nl}
}

\def \VU{
{\footnotesize \sl Vrije Universiteit} \\ 
{\footnotesize \sl Department of Mathematics and Computer Science} \\ 
{\footnotesize \sl De Boelelaan 1081, 1081 HV Amsterdam}\\
{\footnotesize \sl The Netherlands}\\
{\footnotesize \sl email: eliens@cs.vu.nl}
}





\newcommand{\xyline}[1]{\xline{\raisebox{\raism}{\spacm\footnotesize\it #1} } }
\newcommand{\xzline}[1]{\xline{\raisebox{\raismz}{\spacm\footnotesize\it #1} } }


\def\refhead{\section*{References}}

\newenvironment{references}{
%%\begin{bibliography}{xxxxxxx}
\refhead
\begin{description}
}{
\end{description}
%%\end{bibliography}
}
\newcommand{\bibit}[2]{\item[{\rm [#1]}] \sloppy }


\def\hin{\hspace{1cm}}

\newcommand{\ind}[1]{#1\index{#1}}
\newcommand{\subind}[2]{#2\index{#1}}


\newcommand{\nop}[1]{}
\newcommand{\idt}[1]{#1}
\newcommand{\beq}[1]{
\begin{DD}\ \mbox{#1}\end{DD}\endD{}
}

\newcommand{\fns}[1]{\raisebox{1ex}{\footnotesize #1}}


\newenvironment{tab}{\begin{tabbing}\vspace{-.7ex}}
	   {\end{tabbing}\vspace{-.7ex}}

\newcommand{\eqt}[1]{
\begin{tabbing}#1\end{tabbing}
}

\newcommand{\curleqf}[2]{\curlspace\mbox{\cestrut
\(\mbox{#1} = \left\{ \begin{array}{ll} #2 \end{array} \right. \)
} }

\newcommand{\curl}[3]{\curlspace\mbox{\cestrut
\(\mbox{#1} \left\{ \begin{array}{ll} \mbox{#2} \\ \mbox{#3} \end{array} \right. \)
} }

\newcommand{\curleqg}[3]{\curlspace\mbox{\cestrut
\(\mbox{#1} = \mbox{#2} \left\{ \begin{array}{ll} #3 \end{array} \right. \)
} }

\newcommand{\phrase}[2]{
\begin{minipage}[t]{\phrasewidth}{\phrasefont #1}\n
{\authorfont #2}\end{minipage} \ln
\vspace{2cm}
}

\newcommand{\curleq}[2]{\eq{\curleqf{#1}{#2}}}


\newcommand{\ecurl}[3]{ \curleq{#1}{\mbox{#2}\\\mbox{#3}} }


\newcommand{\eqcurl}[5]{\curlspace\mbox{\cestrut
\(\mbox{#1} = \left\{ \begin{array}{ll}
\mbox{#2} & \mbox{#3} \\
\mbox{#4} & \mbox{#5}
\end{array} \right. \)
} } %%}

%%\newcommand{\deq}[1]{ [D] \mbox{#1} }

\newcommand{\eqd}[1]{
\begin{minipage}[t]{\eqlwidth}
\begin{tabbing}\xstrut #1\end{tabbing}
\end{minipage}
}

\newcommand{\beql}[2]{\LBlok{}{\eql{#1}{#2}}} %% LBlok
\newcommand{\lbeql}[3]{\LBlok{}{\eql{#2}{#3}}\xyline{#1}}
\newcommand{\lblok}[2]{\Blok{#2}\xyline{#1}}
\newcommand{\blok}[1]{\lblok{}{#1}}


\newcommand{\eql}[2]{
\begin{ES}
\par
\parbox[t]{\mwidth}{
\begin{minipage}[t]{\eqlwidth}
\begin{tabbing}\xstrut #2\end{tabbing} 
\end{minipage}
\hfill\raisebox{-.4ex}{\skipx{\it #1}} }\end{ES}
}

\def\deqstrut{}

\newcommand{\deql}[2]{
\begin{ES}
%%\par
\parbox[t]{\mwidth}{
\begin{minipage}[t]{\eqlwidth}
\begin{tabbing}\deqstrut #2\end{tabbing} 
\end{minipage}
\hfill\raisebox{-.4ex}{\skipx{\it #1}} }\end{ES}
}

\newcommand{\deq}[1]{\eql{\mbox{}}{#1}}


\newcommand{\smeq}[1]{\begin{tabbing}#1\end{tabbing}}


\newcommand{\eq}[1]{\eql{\mbox{}}{#1}}


\newcommand{\mmmaxb}[4]{ 
\begin{DD}\ \mbox{#2}\ \xline{(#1)}\end{DD}\endD{}
\begin{DD}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{#3}\end{DD}\endD{}
\begin{DD}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{#4}\end{DD}\endD{}
}

\newcommand{\axn}[2]{
\begin{DD}\ \mbox{#2}\ \xline{(#1)}\end{DD}\endD{}
}

\newcommand{\axb}[4]{ 
\begin{DD}\ \mbox{#2}\ \xline{(#1)}\end{DD}\endD{}
\begin{DD}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{#3}\end{DD}\endD{}
\begin{DD}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{#4}\end{DD}\endD{}
}

\newcommand{\Blok}[1]{
\begin{ES}
\id{\LBlok{}{#1}}\end{ES}
}  %% + Look

\newcommand{\deno}[2]{
\begin{ES}
\id{\SBlok{#1}{#2}}\end{ES}
}  %% + Look

\newcommand{\ldeno}[2]{
\begin{ES}
\id{\SBlok{#1}{ \lnF #2 \lnB \lnB }}\end{ES}
}  %% + Look

\newcommand{\gindex}[1]{\index{BNF grammar! #1}}


\newcommand{\xdeno}[2]{\ldeno{#1}{#2}}
\newcommand{\prog}[1]{ \lprog{}{#1} }
\newcommand{\gprog}[2]{ \gindex{#1}\lprog{#1}{#2} }
\newcommand{\pprog}[2]{ \lprog{#1}{#2} }
\newcommand{\oprog}[2]{ \lprog{#1}{#2} }
\newcommand{\yprog}[2]{ \xprog{#1}{#2} }


%%\newcommand{\lprog}[2]{\xprog{#1}{#2}}
\newcommand{\lprog}[2]{
\progpream\progspace
\fbox{
\begin{ES}
\begin{minipage}[t]{\progwidth}\progpre #2\progpost\end{minipage}\end{ES}
} \xline{ {\footnotesize\it #1} }
\progpostam
}

\newcommand{\xprog}[2]{
\progpream\xprogspace
\fbox{
\begin{ES}
\begin{minipage}[t]{\xprogwidth}\progpre #2\progpost\end{minipage}\end{ES}
} \xline{ {\footnotesize\it #1} }
\progpostam
}

\newcommand{\Display}[1]{
\begin{DD}\ \ \end{DD}\endD{}
\begin{minipage}[t]{\mwidth}#1\end{minipage}
\begin{DD}\ \ \end{DD}\endD{}
}

\newcommand{\Look}[1]{
\par
{\begin{minipage}[t]{\mwidth}#1\end{minipage}}
\par
}

\def\lnF{\vspace{1ex}}
\def\lnB{\vspace{-1ex}}
\def\lnBlok{\ln}

\newcommand{\LBlok}[2]{
\lnBlok
\hspace{1.0cm}
\fbox{\parbox[t]{\mwidth}{#2\hfill}}
%%\normalsize
}

\newcommand{\SBlok}[2]{
\lnBlok
\hspace{1.0cm}
\fbox{\begin{minipage}[t]{\Smwidth} #2\hfill\end{minipage}}
\xzline{ {\footnotesize #1 } }
%%\normalsize
}

\newcommand{\Tbl}[2]{
\begin{table}[htbp]
\caption{#1}
\fbox{\begin{minipage}[t]{\mwidth}#2\end{minipage}}
\end{table}
}

\newcommand{\ftn}[1]{\footnote{#1} }
\newcommand{\noftn}[1]{ }


\newcommand{\leftcomment}[1]{ \begin{picture}(0,0)\put(-40,7){\makebox(0,0)[r]{\it #1}}\end{picture} }
\newcommand{\upcomment}[1]{ \begin{picture}(0,0)\put(0,80){\makebox(0,0)[r]{\it #1}}\end{picture} }
\newcommand{\downcomment}[1]{ \begin{picture}(0,0)\put(0,-40){\makebox(0,0)[r]{\it #1}}\end{picture} }


\def\commentft{\it\footnotesize}
\def\plcnameft{\it\small}
\newcommand{\plcmt}[1]{\hfill{\commentft #1}}
\newcommand{\plcname}[1]{\hfill{\plcnameft #1}}
\newcommand{\plcomment}[1]{\poolcomment{\commentft #1}}


\newcommand{\keyword}[1]{\skipx{\it #1}\skipx}
\newcommand{\wi}[1]{\mbox{\skipx{\it #1} }\!\! }
\newcommand{\wo}[1]{\mbox{\skipx{\it #1} }\!\! } %% sf
\newcommand{\woP}[1]{\wo{#1} _{\subcrossP} }
\def\paths{\wo{paths}}
\def\fix{\wo{fix}}
\def\StepP{\woP{Step}}
\def\CompP{\woP{Comp}}
\def\CommP{\woP{Comm}}
\def\Obj{\wo{Obj}}
\def\Proc{\wo{Proc}}
\def\Comm{\wo{Comm}}
\def\Var{\wo{Var}}
\def\Term{\wo{Term}}
\def\Nlvar{\wo{Nlvar}}
\def\effect{\wo{effect}}
\def\action{\wo{action}}
\def\local{\wo{local}}
\def\answer{\wi{answer}}
\def\accept{\wi{accept}}
\def\nil{\wo{nil}}
\def\mgu{\wo{mgu}}
\def\tick{\wo{tick}}
\def\tr{\wo{tr}}
\def\Actions{\wo{Actions}}
\def\Action{\wo{Action}}
\def\Goal{\wo{Goal}}
\def\Subst{\wo{Subst}}
\def\Store{\wo{Store}}
\def\Steps{\wo{Steps}}
\def\Conf{\wo{Conf}}
\def\Objname{\wo{Objname}}
\def\Method{\wo{Method}}
\def\Obj{\wo{Obj}}
\def\obj{\wo{obj}}
\def\Count{\wo{Count}}
\def\SuccCo{\wo{SuccCo}}
\def\FailCo{\wo{FailCo}}
\def\ProcCo{\wo{ProcCo}}
\def\varsof{\wi{varsof}}
\def\Channel{\wo{Channel}}
\def\channel{\wi{$   \mbox{\it  new}   (   \mbox{\it  channel}   ) $}}
\def\Procname{\wo{Procname}}
\def\Succ{\wo{Succ}}
\def\Fail{\wo{Fail}}
\def\Pool{\wo{Pool}}
\def\Prim{\wo{Prim}}
\def\SynCo{\wo{SynCo}}
\def\SemCo{\wo{SemCo}}
\def\Pvar{\wo{Pvar}}
\def\Mvar{\wo{Mvar}}

 \newcommand{\crossN} { \mbox{\hspace{.1cm}} {\rm N}
     \mbox{\hspace{-.328cm}} {\rm I} \mbox{\hspace{.2cm}}}
 \newcommand{\subcrossN} { \mbox{\hspace{.1cm}} {\rm N}
     \mbox{\hspace{-.228cm}} {\rm I} \mbox{\hspace{.2cm}}}
 \newcommand{\crossP} { \mbox{\hspace{.1cm}} {\rm P}
     \mbox{\hspace{-.328cm}} {\rm I} \mbox{\hspace{.2cm}}}
 \newcommand{\subcrossP} { \mbox{\hspace{.1cm}} {\rm P}
     \mbox{\hspace{-.228cm}} {\rm I} \mbox{\hspace{.2cm}}}
 \newcommand{\crossR} { \mbox{\hspace{.1cm}} {\rm R}
     \mbox{\hspace{-.328cm}} {\rm I} \mbox{\hspace{.2cm}}}
 \newcommand{\subcrossR} { \mbox{\hspace{.1cm}} {\rm R}
     \mbox{\hspace{-.228cm}} {\rm I} \mbox{\hspace{.2cm}}}

\def\A{\forall}
\def\C{\mbox{\sf C}}
\def\E{\exists}
\def\margin{\hspace{1.0cm}}
\def\width{12.5cm}
\def\lwidth{9.5cm}

\def\lmargin{\margin}
\def\mwidth{\width} %% 11.5 (*)
\def\progwidth{\lwidth} %% 9 / 8.5 (*)
\def\DBwidth{10.0cm}
\def\LDwidth{9.0cm}
\def\lefti{0.2cm}
\def\leftii{0.7cm}
\def\leftiii{1.2cm}
\def\widthi{9.0cm}
\def\widthii{10.0cm}
\def\widthiii{11.0cm}
%%\def\blokfont{\small}
\def\SL{\par\noindent}
\def\NL{\newline}
\def\BL{\par\lstrut\par\noindent}
\def\LP{\par\lstrut\par\noindent}
\def\PP{\par\lstrut\par}
\def\hds{\hspace{0.7cm}}
%%\def\curlspace{\lmargin}
\def\curlspace{\hspace{0.0cm}}
\def\raism{0.5cm}
\def\raismz{0.0cm}
\def\spacm{\mbox{\vspace{0.3cm}}}
%%\def\Smwidth{11.0cm}
\def\Smwidth{\mwidth}
\def\xprogwidth{\progwidth} %% 9 (*)
\def\xprogspace{\lmargin}
\def\progspace{\lmargin}
\def\progpre{\vspace{0.02cm}}
\def\progpost{\vspace{-0.5cm}}
\def\progpream{\ln\vspace{-0.2cm}}
%%\def\progpostam{\vspace{0.0cm}\ln\ln\par\noindent}
%%\def\progpostam{\vspace{0.0cm}\ln\ln\par\noindent\hspace{-1.8ex}}
\def\progpostam{\vspace{0.0cm}\ln\ln\par\noindent\hspace{-1.0ex}}
\def\ewidth{8.5cm}
%%\def\lwidth{11.0cm}
\def\eqlwidth{8.0cm} %% 10.5, 10.0
\def\strut{\rule[-.3cm]{0cm}{.6cm}}
\def\lstrut{\rule{0cm}{.7ex}}
\def\estrut{\rule[-.2cm]{0cm}{.4cm}}
\def\xstrut{\rule[-.5cm]{0cm}{1.0cm}}
\def\cestrut{\rule[-.9cm]{0cm}{1.8cm}}
\def\phrasewidth{9.1cm}
\def\phrasefont{\it}
\newfont{\authft}{cmss9}
\def\authorfont{\authft}



















































































































































































































































































































































































































































%% START


\begin{document}

\title{\sf Meta-programming in DLP}
\author{\sf A. Eli\"{e}ns \\
{\footnotesize \sl Vrije Universiteit,} 
{\footnotesize \sl Department of Mathematics and Computer Science} \\
{\footnotesize \sl De Boelelaan 1081, 1081 HV Amsterdam}
{\footnotesize \sl The Netherlands}\\
{\footnotesize \sl email: eliens@cs.vu.nl}
} \date{}\maketitle
\begin{abstract}\noindent
We will describe the use of meta-programming in the distributed logic
programming language DLP. Also we will discuss how
to extend the language with a class/meta-class concept, to allow for
reflective capabilities.
\end{abstract}
%%\tableofcontents 
%%\newpage





\section{Introduction}\marksection{ Introduction }\typeout{@* Introduction}
\nn
Prolog offers powerful features for meta-programming.
These features may be used for extending the language to incorporate
other programming paradigms,
such as for example the object oriented paradigm,
or to embed special purpose inference procedures in the language.
However, the penalty of using meta-programming to extend
the language in this way is an obvious loss of efficiency.
\nn
We have developed the distributed logic programming language DLP,
combining logic programming with object oriented features
and parallelism.
Our approach allows for an efficient implementation
since the computation model of DLP directly supports
the features derived from its underlying paradigms.
\nn
Nevertheless, the language DLP supports meta-programming
in the style of Prolog.
For example, meta-programming may be used to implement
a restricted form of {\em and}-parallelism.
\nn
Concluding our paper, we will discuss the possible wyas
to include reflective capibilites by extending our
(prototype-based) object model to one based on a class/meta-class concept.
\nn
Our interest is motivated by our current efforts to re-implement
DLP in Active C++, an extension of C++ that supports
active classes and communication by rendez-vous.
\nn
\nop{
We will discuss to what extend this feature is desirable.
Also, we will explore whether reflective capabilities,
such as allowed by a class/meta-class concept, may form a useful
extension to our language.
}
\nn
 
\section{DLP -- a language for distributed logic programming}\marksection{ DLP -- a language for distributed logic programming }\typeout{@* DLP -- a language for distributed logic programming}
\nn
The language DLP is an extension of Prolog with 
constructions for parallel object oriented programming.
Special expressions are introduced for 
dealing with non-logical variables, object creation,
and engaging in a rendez-vous. 
\nn
\paragraphindex{object declarations}\paragraph{Object declarations}\typeout{@ Object declarations}
An object declaration in DLP contains
the names of the non-logical variables of 
the object and a definition of the two types of clauses, viz.
constructor clauses and method clauses.
\nn
An object declaration in DLP has the form
\lprog{object}{
\begin{DP}
$   \mbox{\it  object}    $\ name\ \{\\
$   \mbox{\it  var}    $\ variables.\\
clauses\\
\}\end{DP}\endD{}
}
Both $   \mbox{\it  object}    $ and $   \mbox{\it  var}    $ are keywords.
The variables declared by $   \mbox{\it  var}    $ are non-logical variables that
may be assigned values by a special statement.
\nn
Objects act as prototypes in that new copies may be made by so-called
$   \mbox{\it  new}    $ statements.
Such copies are called $   \mbox{\it  instances}    $.
Each instance has its private copy of the non-logical variables of the declared object.
In other words, non-logical variables act as instance variables.
\nn
A clause is considered a constructor clause when the
predicate name of the head of the clause is identical to the
name of the declared object.
A method for an object is defined by all clauses having that
method name as the predicate name of their head.
The clauses are written in standard Prolog format,
but may also contain as goals the special forms listed below.
\nn
\paragraphindex{statements}\paragraph{Statements}\typeout{@ Statements}
The special forms include:
\begin{LI}
\item  $ v \: \mbox{\small\rm :=} \:t $ - to assign (the value of) the term $ t $
to the non-logical (instance) variable $ v $
\item  $ O=new(c(t)) $ - to create a new instance of the object $ c $ and
to start the constructor process evaluating the goal $ c(t) $,
$ O $ thereafter refers to the newly created object
\item  $ O!m(t) $ - to engage in a rendez-vous with the object to which $ O $
refers, for evaluating the method call $ m(t) $
\item  $   \mbox{\it  accept}   (m_{1},...,m_{n} ) $ - to state the willingness to engage in a rendez-vous
by accepting one of the  methods
$ m_{1},...,m_{n}  $
\end{LI}
When assigning a term $ t $ to a non-logical variable,
all non-logical variables in the term are first replaced
by their values.
The same applies when unifying two terms.
\nn
\nop{
Instances of objects are created 
by using the special form $ O=new(c(t)) $
that results in binding $ O $ to the newly created
instance of object $ c $.
When creating the object the constructor process evaluating
the goal $ c(t) $ is started for it.
A rendez-vous is initiated by a method call of the form $ O!m(t) $,
with $ O $ bound to an object.
For a rendez-vous to take place the referred object must
state its willingness to answer the method call by
an accept statement of the form $   \mbox{\it  accept}   (m_{1},...,m_{n} ) $.
An important restriction of is that $   \mbox{\it  accept}    $ goals may occur only in the constructor process.
}
\nn
\paragraphindex{inheritance}\paragraph{Inheritance}\typeout{@ Inheritance}
The language DLP supports (multiple) inheritance.
The declaration for an object $   \mbox{\it  name}    $ inheriting from an object $   \mbox{\it  base}    $
looks as follows: 
\lprog{inheritance}{
\begin{DP}
\ \ $   \mbox{\it  object}    $\ name\ :\ base\ \{\\
\ \ $   \mbox{\it  var}    $\ variables.\\
\ \ clauses\\
\ \ \}\end{DP}\endD{}
}
This declaration will result in adding the non-logical variables and clauses declared
for the object $   \mbox{\it  base}    $ to those of the declared object.
For an example of the use of inheritance to model distributed problem solving see [Eli\"{e}ns, 1991].
\nn
\nop{
Any non-logical variables of the $   \mbox{\it  base}    $ object that occur also in the declared object
will be overwritten by the non-logical variable of the declared object.
This will be of significance only when at least one of the non-logical variables
has an initializing declaration.
\nn
By default, such overwriting does not take place for clauses.
When the declared object contains clauses similar to
clauses in the base object, concerning the same predicate,
then these will be treated as alternative choices for evaluating an atom.
}
\nn
\ln
DLP is a distributed language in the sense that it supports processes,
communication between processes and is able to handle failure arising in
a communication.
The distinguishing feature of DLP,
compared with other approaches at combining logic programming
with object oriented features and parallelism, 
is its support for multi-threaded objects and the possible occurrence
of distributed backtracking over the results of a rendez-vous. See [Eli\"{e}ns, 1992].
\nn
\nop{
In the absence of distributed backtracking
an object could have been identified with a process,
since an object would then be either executing its own activity
or evaluating a method call.
Backtracking however requires to keep administration of what part
of the search space has been explored.
A notion of processes, separate from objects, is thus motivated
by the need to keep record of this information;
processes are created for each method call to enable
backtracking over the answers.
The language DLP also supports inheritance.
However, since inheritance is statically implemented by copying the code of the inherited objects,
we need not consider this issue
when characterizing the dynamic behavior of objects.
}
\nn
\nop{
The intent of this chapter is to provide with
a more precise definition of objects and processes,
and a description of their behavior during a rendez-vous.
Before going into any details, however,
we will briefly repeat the informal account given of
objects, processes and how backtracking may interact with
the use of non-logical variables.
}
\nn
\subsection*{The execution model: objects, processes and backtracking}\marksubsection{ The execution model: objects, processes and backtracking }\typeout{:@+ The execution model: objects, processes and backtracking}
\nn
An execution model for DLP must give an account of the behavior of
objects and processes and must explain how process creation and communication
interact with backtracking.
\nop{
Before giving a formal account in section 3 and 4 of process creation and communication 
in the presence of backtracking we will briefly discuss each of these
notions.
}
\nn
\paragraphindex{objects}\paragraph{Objects}\typeout{@ Objects}
serve as a means
for modularization and provide protection of (local)
data.
Non-logical variables may be used to store the data encapsulated
by an object.
The clauses defined for an object act as methods, in that they
have exclusive access to these data.
\nn
\nop{
An object declaration in DLP contains
the names of the non-logical variables of (instances of)
the object and a definition of both the
constructor clauses and method clauses.
The clauses are written in standard Prolog format,
but may contain as goals the special forms listed previously.
A clause is considered a constructor clause when the
predicate name of the head of the clause is identical to the
name of the declared object.
A method for an object is defined by all clauses having that
method name as the predicate name of their head.
}
\nn
\nop{
When a new object is created, by a goal of the form $ O=new(c(t)) $,
then this newly created object contains a copy of the
non-logical variables of the declared object and also
(conceptually) a copy of all its clauses.
Only active objects will be considered, that is objects with own activity
arising from evaluating the constructor for that object.
}
\nop{Since inheritance is effected by copying the non-logical variables
and clauses from the inherited objects, for giving a
semantic characterization of the interpretation of DLP programs
it suffices to look at DLP without inheritance.}
\nn
\paragraphindex{processes}\paragraph{Processes}\typeout{@ Processes}
are created on the occasion of creating a new object, and
when requesting a rendez-vous.
When a new object is created, the constructor process, defined
by clauses for the predicate with the name of the object,
is started.
When a rendez-vous is requested by a method call, a process is started
for evaluating the method call.
Creating a new process for evaluating such a goal is necessitated
by our approach to distributed backtracking. 
Both the constructor process and the processes started for 
evaluating a goal by an object are said to refer to that object.
\nn
\paragraphindex{distributed backtracking}\paragraph{Distributed backtracking}\typeout{@ Distributed backtracking}
may occur when multiple answer substitutions result
from evaluating a method call.
As an example, a method call to the object declared below
may generate an indefinite number of solutions.
\lprog{nat}{
\nn
\begin{DP}


obj\ nat\ \{

number{\rm (}0{\rm )}.\\
number{\rm (}s{\rm (}X{\rm )}{\rm )}\ {\small $  \: \mbox{\small \rm :--} \: $ }\ number{\rm (}X{\rm )}.

\}\end{DP}\endD{}
}
The constructor clause for the object states that any call 
to \begin{EP}num\end{EP} will be accepted.
\nn
Evaluating the goal
\begin{DP}
{\small $  \: \mbox{\small \rm :--} \: $ }\ O{\operatorfont =}new{\rm (}nat{\rm (}{\rm )}{\rm )},\ O{\rm !}num{\rm (}X{\rm )},\ write{\rm (}X{\rm )},\ fail.\end{DP}\endD{}
results in printing all natural numbers, eventually.
The process created for evaluating \begin{EP}num{\rm (}X{\rm )}\end{EP} backtracks each time
that backtracking over \begin{EP}O{\rm !}num{\rm (}X{\rm )}\end{EP} is tried due to
the occurrence of \begin{EP}fail\end{EP} in the goal.
\nn
 
\section{Meta-programming in Prolog}\marksection{ Meta-programming in Prolog }\typeout{@* Meta-programming in Prolog}
\nn
In Prolog, programs may be treated as data.
To this end Prolog offers a number of so-called
{\em meta-predicates} that allow to inspect and manipulate terms and clauses.
As examples of such meta-predicate we mention the predicates {\em not},
the predicate {\em call} that usually is omitted as illustrated in the example
below, and the predicate {\em clause} that may be used to enumerate all the
clauses of a program.
\nn
\paragraphindex{control structures}\paragraph{Control structures}\typeout{@ Control structures}
Despite the declarative semantics of logic programming, Prolog programmers
often rely on control structures that are reminiscent of
control structures encountered in traditional imperative languages.
As an example, we show the implementation of a conditional branching operator.
\lprog{cond}{
\begin{DP}\ A\ {\small $ \rightarrow  $ }\ B\ {\small $  \: \mbox{\small \rm :--} \: $ }\ A,\ {\rm !},\ B.\end{DP}\endD{}
}
The clause defining the implication arrow enforces that
the condition $ A $ is only evaluated once.
\nn
\nop{
Likewise we may implement a disjunctive operator by the clauses
\lprog{or}{
\begin{DP}
\ A\ ;\ B\ {\small $  \: \mbox{\small \rm :--} \: $ }\ A.\\
\ A\ ;\ B\ {\small $  \: \mbox{\small \rm :--} \: $ }\ B.\end{DP}\endD{}
}
These clauses result in evaluating the first component of the disjunction
and, only if the need arises, on backtracking the second component,
as an alternative solution to the disjunctive goal.
\nn
Combined the conditional operator and the disjunctive operator
may be used as in $ A\rightarrow B;C $\ to express the conditional {\em if $ A $ then $ B $ else $ C $ }.
}
\nn
\paragraph{A naive meta-interpreter}\typeout{:@ A naive meta-interpreter}
A goal of the form $   \mbox{\it  clause}   (A,B) $ may be used to select
all clauses of which the head unifies with $ A $ and the body with $ B $.
When both $ A $ and $ B $ are variables the goal $   \mbox{\it  clause}   (A,B) $ results in enumerating
all clauses, binding $ A $ to the head and $ B $ to the body of the clause
currently pointed at.
For clauses that represent facts, $ B $ will be bound to true.
\nn
An example of using this facility is given by a simple (meta) interpreter
for Prolog written in only a few lines of Prolog. C.f. [Sterling, 1986].
\lprog{backward}{
\begin{DP}
\ backward{\rm (}true{\rm )}.\\
\ backward{\rm (}{\rm (}A,B{\rm )}{\rm )}\ {\small $  \: \mbox{\small \rm :--} \: $ }\\
\ \ \ \ \ \ \ \ backward{\rm (}A{\rm )},\\
\ \ \ \ \ \ \ \ backward{\rm (}B{\rm )}.\\
\ backward{\rm (}A{\rm )}\ {\small $  \: \mbox{\small \rm :--} \: $ }\\
\ \ \ \ \ \ \ \ clause{\rm (}A,B{\rm )},\\
\ \ \ \ \ \ \ \ backward{\rm (}B{\rm )}.\end{DP}\endD{}
}
The case analysis performed by the interpreter is straightforward.
The goal $   \mbox{\it  true}    $ succeeds immediately.
A conjunctive goal is split into parts which are successively evaluated.
An atomic goal is solved by looking for a clause of which the head
matches the goal, and solving the body of that clause.
\nn
\nop{
The interpreter described above implements a so-called {\em backward chaining}
inference procedure that is strongly analogous to the inference procedure of Prolog.
The procedure described here does not, however, take account of cuts.
A meta-interpreter of this kind is an excellent starting point for 
implementing an expert system since it is rather easy to adapt the inference procedure
to particular cases or to extend it with explanation facilities,
certainty-factors or a consultation component.\ftn{
A similar backward chaining interpreter will be used in the distributed medical
expert system described in chapter 4.
}
C.f. [Sterling, 1986].
}
\nn
\nop{
\paragraph{Dynamic program modification}\typeout{:@ Dynamic program modification}
\nn
Another powerful feature that Prolog offers is the facility to
assert or retract clauses dynamically.
Asserting a clause results in adding the clause to the program.
Retracting a clause effects the removal of that clause.
\nn
A example of the use of asserting clauses dynamically
is given by the simple {\em forward chaining} inference procedure
defined below. C.f. [Subrahmanyam, 1985].
\lprog{forward}{
\begin{DP}
\ forward{\rm (}G{\rm )}\ {\small $  \: \mbox{\small \rm :--} \: $ }\ G.\\
\ forward{\rm (}G{\rm )}\ {\small $  \: \mbox{\small \rm :--} \: $ }\\
\ \ \ \ \ \ \ \ clause{\rm (}A,B{\rm )},\\
\ \ \ \ \ \ \ \ B,\\
\ \ \ \ \ \ \ \ assert{\rm (}A{\rm )},\\
\ \ \ \ \ \ \ \ forward{\rm (}G{\rm )}.\end{DP}\endD{}
}
Forward chaining halts when the condition kept in the 
argument $ G $ of {\em forward} is satisfied.
As long as the condition to stop has not been asserted,
the forward chaining procedure asserts every fact that can be derived using one of the clauses.
Clauses are tried irrespective of the goal that must be proved,
which is reflected in the independence of the argument of {\em forward}
representing the condition to halt and the variables used to select a clause.
\nn
Forward chaining may be used to solve connectivity problems
such as the one below.
\lprog{connects}{
\begin{DP}
\ link{\rm (}a,b{\rm )}.\\
\ link{\rm (}b,c{\rm )}.\\
\ link{\rm (}c,d{\rm )}.\\
\ link{\rm (}d,e{\rm )}.

\ connects{\rm (}X,Y{\rm )}\ {\small $  \: \mbox{\small \rm :--} \: $ }\ link{\rm (}X,Y{\rm )}.\\
\ connects{\rm (}X,Y{\rm )}\ {\small $  \: \mbox{\small \rm :--} \: $ }\ link{\rm (}X,Z{\rm )},\ connects{\rm (}Z,Y{\rm )}.\end{DP}\endD{}
}
The goal
\begin{DP}\ ?-\ forward{\rm (}\ connects{\rm (}a,e{\rm )}\ {\rm )}.\end{DP}\endD{}
may now be used to check whether $ a $ is connected to $ e $.
A side-effect of evaluating this goal is the addition of
the facts $   \mbox{\it  connects}   (a,b) $, $   \mbox{\it  connects}   (a,c) $,...
Backward chaining, that may be used as well to solve this particular goal,
will have no such effect.
}
\nn
\section{Meta-programming in DLP}\marksection{ Meta-programming in DLP }\typeout{@* Meta-programming in DLP}
\nn
Actually, for DLP we have implemented the synchronous rendez-vous operator
in terms of the primitives of an asynchronous rendez-vous mechanism.
The synchronous rendez-vous is implemented by the clause:
\begin{DP}\ O{\rm !}G\ {\small $  \: \mbox{\small \rm :--} \: $ }\ Q\ {\operatorfont =}\ O{\rm !}G,\ Q?.\end{DP}\endD{}
As explained below,
a synchronous rendez-vous consists of two parts,
the creation of a process to evaluate a method call
and the request for an answer.
\nn
\paragraphindex{an asynchronous rendez-vous mechanism}\paragraph{An asynchronous rendez-vous mechanism}\typeout{@ An asynchronous rendez-vous mechanism}
\label{des/ext/proc}
\nn
For creation of the evaluating process, one may use the special statement
\begin{LI} \item  $ Q = O!G $ \end{LI}
to request the object to which $ O $ refers to create
a process to evaluate the goal $ G $. The variable $ Q $ thereafter
refers to that process.
For requesting the result we have introduced the goal
\begin{LI} \item  $ Q? $ \end{LI}
that asks the process, referred to by $ Q $, for an (other) answer.
\nn
\paragraphindex{and-parallelism}\paragraph{And-parallelism}\typeout{@ And-parallelism}
The decomposition of the rendez-vous
allows to
define and-parallelism in a rather straightforward way, as
\begin{DP}\ A\&B\ {\small $  \: \mbox{\small \rm :--} \: $ }\ Q\ {\operatorfont =}\ self\,{\rm !}\,B,\ A,\ Q?.\end{DP}\endD{}
where $   \mbox{\it  self}    $ refers to the object evaluating the goal $  A \& B  $.
Such goals may however occur only in passive objects, 
since only passive objects allow internal concurrency.
\nn
An advantage of this approach is 
that the programmer may restrict the cases where
parallel evaluation occurs by imposing extra conditions
(cf. [DeGroot, 1984]) as in
\begin{DP}
A\&B\ {\small $  \: \mbox{\small \rm :--} \: $ }\ ground{\rm (}B{\rm )},{\rm !},\ Q\ {\operatorfont =}\ self\,{\rm !}\,B,\ A,\ Q?.\ \\
A\&B\ {\small $  \: \mbox{\small \rm :--} \: $ }\ A,\ B.\end{DP}\endD{}
where splitting of a new process is allowed only when $ B $ is ground.
Note that the cut in the first clause is used
to avoid unwanted backtracking over the second solution of {\small A\&B}.
\nn
\paragraphindex{overriding}\paragraph{Overriding}\typeout{@ Overriding}
Each object defined in DLP inherits its basic functionality
from an object called {\em boot}.
However, system-predicates may be redefined as to allow for
specializations of these predicates.
As an example, the synchronous rendez-vous operator may be
redefined according to a users preferences.
Note however that, since  a redefinitions has effect only within the scope of the object,
the modification does not affect
the object that is asked to engage in a rendez-vous.
In contrast, when overloading the dereferencing operator in C++
the behavior of the object receiving a call to a member-function is 
affected. Cf. [Stroustrup, 1991].
\nn
\nop{
\paragraphindex{dynamic modification}\paragraph{Dynamic modification}\typeout{@ Dynamic modification}
In addition, each object may {\em assert} or {\em retract}
clauses just as in ordinary Prolog,
which allows for a dynamic modification of the
functionality of objects.
}
\nn
\section{Discussion}\marksection{ Discussion }\typeout{@* Discussion}
\nn
Our approach to embedding reflective capabilities
in DLP is not of a fully fledged
object oriented nature,
since until now only programs consisting of clauses may be created as first-class
data but not objects consisting of non-logical variables
and clauses.
\nn
In our prototype described in [Eli\"{e}ns, 1992] we have experimented with
the conversion between objects and terms.
Converting a term to an object-definition is
a trivial matter.
However, it seems rather difficult to convert an active object,
or an object busy with evaluating a method call, to a term.
For a truly passive object, that is an object that is not active in any way,
such a conversion is possible.
\nn
Taking these restrictions into account it seems, however, more
elegant to use a class-based approach since what we are interested in is after all
the description or declaration of an object, in other words
its class.
\nn
>From [Malenfant et al, 1989] we know that the class/meta-class
notion derived from [Cointe, 1987] is also relevant to distributed logic programming.
In the near future we will explore how to apply this approach to DLP.
\nn
\def\refhead{\section*{References}\markchapter{References}}
\begin{references}
\addcontentsline{toc}{section}{References}
\nn
\bibit{Cointe, 1987}{Cointe87}
\sc P. Cointe, 
\it Metaclasses are first class: the ObjVLisp Model, \rm  in: Proc. OOPSLA'87, N. Meyrowitz (ed.), ACM Sigplan Notices 22 (12) (1987) pp. 156-167
\bibit{Eli\"{e}ns, 1991}{Eliens91}
\sc A. Eli\"{e}ns, 
\it Distributed Logic Programming for Artificial Intelligence, \rm  AI Communications Vol. 4 No. 1, 1991, pp. 11-21
\bibit{Eli\"{e}ns, 1992}{Eliens92}
\sc A. Eli\"{e}ns, 
\it DLP - A language for Distributed Logic Programming, \rm  Wiley (1992) 
\bibit{Eli\"{e}ns and Visser, 1992}{EV92}
\sc A. Eli\"{e}ns and C. Visser, 
\it Active C++ --- active classes and communication by rendez-vous, \rm  Technical Report Vrije Universiteit (to appear)
\bibit{Malenfant et al, 1989}{Malenfant89}
\sc J. Malenfant, G. Lapalme and J. Vaucher, 
\it ObjVProlog: Metaclasses in Logic, \rm  in: Proc. ECOOP'89, Cambridge University Press (1989) pp. 257-269
\bibit{Sterling, 1986}{Sterling}
\sc L. Sterling, 
\it Expert System = Knowledge + Meta-Interpreter, \rm  Report, The Weizman Institute of Science, Israel
\bibit{Stroustrup, 1991}{St91}
\sc B. Stroustrup, 
\it The C++ Programming Language, \rm  Addison Wesley (1991) 2nd edn.\nn
\end{references}
\nn
\end{document}


