\documentclass[12pt]{jreport}
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{22.5cm}
\setlength{\oddsidemargin}{0.75cm}
% \setlength{\topmargin}{-2cm}

\usepackage{moreverb}
\def\listinglabel#1{\llap{\small\rmfamily\the#1}\hskip1em}

\def\thebibliography#1{\chapter*{$B;29MJ88%(B}\list				%
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy
 \sfcode`\.=1000\relax}

\newcommand{\crush}{\renewcommand{\baselinestretch}{0.8}}
\newcommand{\comp}[1]{{\crush \small \listinginput{1}{#1}}}
\newcommand{\prog}[1]{\section{#1} \label{#1} \comp{source/#1.kl1} \clearpage}

%---------------------------------------------------------------
\newcommand{\dklic}{$BJ,;6(BKL1$B8@8l=hM}7O(B}
\newcommand{\cliser}{$B%/%i%$%"%s%H(B-$B%5!<%P(B}

\title{ {\small 1999$BG/EY(B $BB46HO@J8(B} \\
  KL1$B$K$h$k(B\dklic $B$N<BAu(B }
\author{ $BAa0pEDBg3XM}9)3XIt>pJs3X2J(B \\
  G96P073-6 $B9bLZM42p(B \and
  $B;XF3!'(B $B>eEDOB5*(B $B65<x(B }
\date{ $BDs=PF|!'(B 2000$BG/(B2$B7n(B4$BF|(B }

\begin{document}
\maketitle
\tableofcontents

%---------------------------------------------------------------
\begin{abstract}
$B%M%C%H%o!<%/4D6-$NIa5Z$K$D$l!"(B
$BJ,;6%W%m%0%i%_%s%0$KBP$9$k<{MW$,9b$^$C$F$$$k!#(B
$B$7$+$7!"C`<!<jB3$-7?8@8l$K$h$kJ,;6=hM}$N5-=R$OHs>o$KHQ;($G$"$k!#(B

$BJB9TO@M}7?8@8l$O!"<B9T$N3FC10L$,JB9T$K<B9T$5$l!"(B
$B%W%m%;%94VDL?.$r@k8@E*$K5-=R$G$-$k!#(B
$B$^$?!"J,;6=hM}$OJB9T=hM}$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KL1$B8@8l$r(BdKL1$B$HL>IU$1$k!#(B
d$B$O(Bdistributed$B$NF,J8;z$G$"$k!#(B

%---------------------------------------------------------------
\section{ KL1$B$N35N,(B }

KL1$B%W%m%0%i%`$O=R8l$N=89g!J$*$h$S!"%b%8%e!<%k$H=i4|%4!<%k!K(B
$B$K$h$C$FDj5A$5$l!"=R8l$O@a$N=89g$K$h$C$FDj5A$5$l$k!#(B
$B@a$O0J2<$N$h$&$J$b$N$G$"$k!#(B
\begin{verbatim}
  Head :- Guard | Body.
\end{verbatim}
$B$3$3$G!"(BHead$B$O86;RO@M}<0$G$"$j!"(B
Guard$B$H(BBody$B$O86;RO@M}<0$N%^%k%A=89g$G$"$k!#(B
Guard$B$H(BBody$BCf$N86;RO@M}<0$O%4!<%k!"$9$J$o$A=R8l8F$S=P$7$G$"$j!"(B
Head$B$ODj5A$5$l$k=R8l!J@a!K$r8F$S=P$9%4!<%k$K%^%C%A$9$k%W%m%H%?%$%W$G$"$k!#(B

$B%4!<%k$H=R8l8F$S=P$7$H$N0c$$$O!"(B
$B%*%V%8%'%/%H;X8~$N!V%a%C%;!<%8!W$H!V%a%=%C%I8F$S=P$7!W$H$N0c$$$K;w$F$$$k!#(B
$B$9$J$o$A!"%4!<%k$O=R8l8F$S=P$7$H$7$F<BAu$5$l$k35G0$G$"$k$,!"(B
$B:.F1$7$F$b<BMQ>e$NLdBj$O$J$/!"$7$P$7$PF10l;k$5$l$F$$$k$?$a!"(B
$BK\O@J8$G$bFC$K6hJL$7$J$$!#(B

%---------------------------------------------------------------
\section{ $B4{B8$N(B\dklic }

\dklic $B$H$7$F$O4{$K!"JBNs?dO@%^%7%s(B (PIM) $B>e$N=hM}7O!"(B
Unix/C$B>e$N=hM}7O(B (KLIC)$B!"(BJava$B>e$N=hM}7O(B (KLIJava$B!"(BKL1j) $B$J$I$,$"$k!#(B
$B$7$+$7!"K\8&5f$NL\E*$G$"$kHFMQJ,;6O@M}7?8@8l$H$7$F$N(BKL1$B$r(B
$BDs>'$7$F$$$k$N$O(BKL1j \cite{Igarashi} $B$N$_$G$"$k!#(B

KL1j$B$O<B9T;~%i%$%V%i%j$,<BAu:Q$_$@$,!"(B
KL1$B$+$i1s$$(BJava$B$r<BAu8@8l$KA*$s$@$?$a!"(B
$B9M$($J$1$l$P$J$i$J$$$3$H$,B?$/!"(B
$B5!3#K]Lu$NJ}K!O@$,3NN)$7$F$$$J$$!#(B

$BK\8&5f$G$O!"(BKL1j$B$N%3%s%Q%$%i<BAu$N4pAC5;=Q$r8G$a$k$?$a!"(B
KL1j$B$NDs>'$9$kJ,;6(BKL1$B$N6K>.ItJ,=89g$rDj$a!"(B
$B<BF0$G$-$k=hM}7O$r9=C[$9$k$3$H$rL\;X$9!#(B

%---------------------------------------------------------------
\section{ $BK\O@J8$N9=@.(B }

$BBh(B\ref{abstract}$B>O$G$O8&5f$NGX7J$HL\E*$r=R$Y$?!#(B
\\$BBh(B\ref{base}$B>O$G$O8&5f$K4X$9$k4pACCN<1$r=R$Y$k!#(B
\\$BBh(B\ref{design}$B>O$G$O(BdKLIC$B<BAu$NJ}?K$r=R$Y$k!#(B
\\$BBh(B\ref{experiment}$B>O$G$O<BAuJ}K!$K4X$9$kM=Hw<B83$r<($9!#(B
\\$BBh(B\ref{implement}$B>O$G$O<BAu$N>\:Y$r=R$Y$k!#(B
\\$BBh(B\ref{analysis}$B>O$G$O<BAu$K4X$9$k9M;!$r$9$k!#(B
\\$BBh(B\ref{forward}$B>O$G$OK\O@J8$K$D$$$F$^$H$a!":#8e$NM=Dj$r=R$Y$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{ KL1$B$N35N,(B } \label{base}

$BK\>O$G$O!"(BdKLIC$B<BAu$N$?$a$K3X$s$@!"(BKL1$B8@8l$H<~JUCN<1$K$D$$$F=R$Y$k!#(B

$BBh(B\ref{base:class}$B@a$G6aK58@8l$H$N4X78$r=R$Y!"(B
$BBh(B\ref{base:lex}$B@a$G;z6g9=B$!"(B
$BBh(B\ref{base:syntax}$B@a$GJ8K!!"(B
$BBh(B\ref{base:semantics}$B@a$G(BKL1$B%W%m%0%i%`$N0UL#!"(B
$BBh(B\ref{base:parallel}$B@a$HBh(B\ref{base:distributed}$B@a$G(B
$B0UL#$rJQ$($J$$%W%i%0%^$r<($9!#(B

%---------------------------------------------------------------
\section{ $B8@8l$N%/%i%93,AX(B }  \label{base:class}

Guarded Horn Clauses (GHC) \cite{GHC:LPC85} $B$OJB9TO@M}7?8@8l$N0l$D$G$"$k!#(B

GHC$B$O!"%W%m%0%i%`$KBP$9$k@)Ls$,>/$J$$$H$$$&0UL#$G(B
$BC1=c$+$D6/NO$JJB9TO@M}7?8@8l$G$"$C$?!#(B
$B$3$N$3$H$O!"(BGHC$B%U%k%;%C%H$N<B8=$,MF0W$G$J$$$3$H$r<($7!"(B
$B<B8=2DG=$J%5%V%;%C%H$,I,MW$H$5$l$?!#(B
$B%,!<%I%4!<%k$KBP$9$k@)Ls$r6/$a$?(B Flat GHC \cite{GHCKL1:CompJ}
$B$H$$$&(BGHC$B$N%5%V%;%C%H$O!"Hf3SE*4JC1$K8zN($NNI$$<BAu$,$G$-$k!#(B

KL1$B$O!"(BFlat GHC$B$KMM!9$J%G!<%?7?!"%b%8%e!<%k!"(B
$B<B9T@)8f5!G=$rIU$12C$($?<BMQ8@8l$G$"$k!#(B

$B4{B8$N(BKL1$B8@8l=hM}7O$H$7$F$O!"JBNs?dO@%^%7%s(B (PIM) $B>e$N=hM}7O!"(B
Unix/C$B>e$N(BKLIC$B!"(BJava$B>e$N(BKLIJava \cite{Satoshi}$B!"(BKL1j \cite{Igarashi} $B$J$I$,$"$k!#(B

$B8=:_!"(BKLIC$B$GDj5A$5$l$?(BKL1$B$,;v<B>e$NI8=`$H$J$C$F$$$k!#(B
$B0J2<$K=R$Y$k(BKL1$B$N35N,$O!"(BKLIC/KL1$B$K4p$E$$$F$$$k!#(B

%---------------------------------------------------------------
\section{ $B;z6g9=B$(B } \label{base:lex}

KL1$B$N;z6g9=B$$O!"$*$*$h$=EAE}E*$J(BProlog \cite{Prolog} $B$N;z6g9=B$$r<u$17Q$$$G$$$k!#(B

KL1$B$N;z6g9=B$$r!"@5B'J8K!$K$h$C$F<($9!#(B
$B3Q3g8L!J(B\verb!< >!$B!K$G0O$^$l$?$b$N$O%a%?JQ?t!J;z6g$N=89g!K$G$"$k!#(B
\verb!?! $B$O(B $0$ $B2s$^$?$O(B $1$ $B2s$N=P8=!J>JN,$G$-$k$3$H!K$rI=$9!#(B
\verb!*! $B$H(B \verb!+! $B$O!"$=$l$>$l(B $0$ $B2s0J>e!"(B $1$ $B2s0J>e$N=P8=!J7+$jJV$7!K$rI=$9!#(B
\verb!-! $B$O=89g$N0z$-;;!J:9=89g!K$rI=$9!#(B
$B3g8L!J(B\verb!( )!$B!K$OM%@h$rI=$9!#(B
$B0zMQId!J(B\verb!` '!$B!K$G0O$^$l$?J8;zNs$O!"(BKL1$B%=!<%9%W%m%0%i%`Cf$K8=$l$kJ8;zNs$G$"$k!#(B
$B!J0J2<$O%^%K%e%"%k(B \cite{info} $B$r;29M$K$7$?$b$N$@$,!"(B
$B==?J0J30$N@0?t5-K!!"(BPIM$B8_49$N@0?t5-K!!"J8;zNsFb$NJ8;z%3!<%I5-K!$r>JN,$7$?!#(B
$B$^$?!"4X?t5-9f$rCfCV!&>JN,$7$?$j!"3g8L$r>JN,$7$?$j$9$k%U%!%s%/%?$N5-K!$O!"(B
$B%^%K%e%"%k(B \cite{info} $B$KL@5-$5$l$F$*$i$:!"$3$3$G$b>JN,$7$?!#!K(B

\begin{boxedverbatim}
<Variable> ::= <Upper> <DigitOrLetter>*.
<DigitOrLetter> ::= <Digit> | <Upper> | <Lower>.

<Digit> ::= `0' | `1' | `2' | `3' | `4' | `5' | `6' | `7' | `8' | `9'.
<Upper> ::= `A' | `B' | `C' | `D' | `E' | `F' | `G' | `H' | `I' |
            `J' | `K' | `L' | `M' | `N' | `O' | `P' | `Q' | `R' |
            `S' | `T' | `U' | `V' | `W' | `X' | `Y' | `Z' | `_'.
<Lower> ::= `a' | `b' | `c' | `d' | `e' | `f' | `g' | `h' | `i' |
            `j' | `k' | `l' | `m' | `n' | `o' | 'p' | `q' | `r' |
            `s' | `t' | `u' | `v' | `w' | `x' | `y' | `z'.
\end{boxedverbatim}

KL1$B$G$O!"JQ?t$rB+G{$9$kCM$O7?$r;}$D$,!"JQ?t<+BN$O7?$r;}$?$J$$!#(B
$BC10lBeF~$G$"$j!"B+G{:Q$_$NJQ?t$,JL$NCM$KB+G{$5$l$k$3$H$O$J$$!#(B
$B$^$?!"O@M}JQ?t$H8F$P$l!"B+G{A0$OL$Dj5A$H$$$&>uBV$r;}$D!#(B
$BJQ?t$rCM$KB+G{$9$k$3$H$r6qBN2=$H8@$&!#(B

\verb!_! $B!J2<@~(B$ 1 $$BJ8;z!K$H$$$&JQ?t$OL5L>JQ?t$G$"$j!"(B
$BF1$8@a$NCf$KJ#?t=P8=$7$F$b!"8_$$$K0c$&JQ?t$r0UL#$9$k!#(B

\begin{boxedverbatim}
<Atom> ::= <Symbol> | <Quoted> | <Special> | <OneCharacter> | <Nil>.
<Symbol> ::= <Lower> <DigitOrLetter>*.
<Quoted> ::= `'' <QuotedCharacter>+ `''.
<Special> ::= <SpecialCharacter>+.
<QuotedCharacter> ::= <Character>-`'' | <QuotedQuote>.

<Nil> ::= `[' `]'.
<QuotedQuote> ::= `''' | `\''.
<OneCharacter> ::= `!' | `|' | `;'.
<SpecialCharacter> ::= `~' | `+' | `-' | `*' | `/' | `\' |
                       `^' | `<' | `>' | `=' | ``' | `:' |
                       `.' | `?' | `@' | `#' | `$' | `&'.

<Integer> ::= <Decimal> | <CharacterCode>.
<Decimal> ::= `-'? <Digit>+.
<CharacterCode> ::= `-'? `0'' <Character>.

<Float> ::= <Sign>? <Digit>+ `.' <Digit>+ (`e' <Sign>? <Digit>+)?.
<Sign> ::= `+' | `-'.
\end{boxedverbatim}

\begin{boxedverbatim}
<Functor> ::= <Atom> `(' <Term> (`,' <Term>)* `)'.
<Term> ::= <Variable> | <Atom> | <Integer> | <Float> |
           <Functor> | <List> | <Vector> | <String>.
\end{boxedverbatim}

$B%U%!%s%/%?$O!"L>A0$H!"0z?t$N8D?t(B (Arity) $B$K$h$C$F6hJL$5$l$k!#(B
$B$3$l$r<g%U%!%s%/%?$H>N$7!"<!$NI=5-K!$K=>$&!#(B

\begin{verbatim}
  <PrincipalFunctor> ::= <Atom> `/' <Digit>+
\end{verbatim}

$BNc$($P!"<!$K<($9%j%9%H$H$O!"(B
./2$B$H$$$&FCJL$J%U%!%s%/%?!J%3%s%9!&%;%k$G$"$k!K(B
$B$rAH$_9g$o$;$?%G!<%?9=B$$NN,5-K!$G$"$k!#(B

\begin{boxedverbatim}
<List> ::= `[' <Term> (`,' <Term>)* (`|' <Term>)? `]'.

<Vector> ::= `{' (<Term> (`,' <Term>)*)? `}'.

<String> ::= `"' <Element>* `"'.
<Element> ::= <Character>-`"' | <Escaped>.
<Escaped> ::= `\a' | `\b' | `\f' | `\n' | `\r' | `\t' | `\v'
            | `\'' | `\"' | `\?' | `\\' | `\' <NewLineCharacter>.
\end{boxedverbatim}

\section{ $BJ8K!(B }  \label{base:syntax}

KL1$B$NJ8K!$O!"(BProlog$B$K;w$F$$$k!#(B
$BBg$-$J0c$$$O!"@a$N%,!<%I$H%\%G%#$,(B
$B%3%_%C%H1i;;;R!J(B\verb!|!$B!K$K$h$C$FJ,$1$i$l$F$$$k$3$H$G$"$k!#(B

KL1$B$NJ8K!$r!"(BBNF$B$K$h$C$F<($9!#(B

\begin{boxedverbatim}
<Program> ::= <Module>+

<Module> ::= <ModuleDeclaration> <Predicate>+.
<ModuleDeclaration> ::= `:-' `module' <Atom> `.'.
\end{boxedverbatim}

KL1$B$N%b%8%e!<%k$O!"=R8l$NL>A06u4V$G$"$k!#(B
$BA4$F$N=R8l$O!"$$$:$l$+$N%b%8%e!<%k$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A*Br$O!"(B
$BA0$+$i=g$K$J$5$l$k$H$O8B$i$J$$!#(B
$B$"$k=R8l$N@a$N%,!<%I$,8_$$$KAG$G$J$$!J@Q=89g$,6u$GL5$$!K$H$-!"(B
$B$=$l$i$N@a$NA*Br$OHs7hDjE*$G$"$j!"$=$N=R8l$N0UL#$OHs7hDjE*$G$"$k!#(B

\verb!otherwise.! $B$NBe$o$j$K(B \verb!alternatively.! $B$rCV$/$3$H$b$G$-$k!#(B
$BD>46E*$K$O!"(B \verb!alternatively.! $B$O!"@a$NA*BrM%@hEY$rJQ$($k%W%i%0%^$G$"$k!#(B
$B!J(B\verb!otherwise.! $B$O%W%i%0%^$G$O$J$$!#!K(B
\verb!otherwise.! $B$H0c$$!"(B \verb!alternatively.! $B8e$N@a$O!"(B
\verb!alternatively.! $BA0$N@a$N%,!<%I$,<:GT$7$J$/$F$bA*Br$5$l$k2DG=@-$,$"$k!#(B
$BJQ?t$N6qBN2=$rBT$C$FCfCG$7$F$$$k%4!<%k$O!"@.8y$b<:GT$b$7$F$$$J$$!#(B
$B$3$N%W%i%0%^$K$h$C$F!"%W%m%0%i%`$NDd;_@-$,JQ$o$k>l9g$,$"$k!#(B

$B=R8l$O!"%U%!%s%/%?$HF1MM$KL>A0$H0z?t8D?t$G6hJL$5$l!"(B
$B<g%U%!%s%/%?$HF1MM$KI=5-$5$l$k!#(B
$B$^$?!"=R8l$NB0$9$k%b%8%e!<%k$r2C$($F!"<!$NI=5-K!$K=>$&!#(B

\begin{verbatim}
  <PredicateID> ::= <Atom> `:' <PrincipalFunctor>
\end{verbatim}

%---------------------------------------------------------------
\section{ KL1$B%W%m%0%i%`$NF0:n(B }  \label{base:semantics}

KL1$B%W%m%0%i%`$O!"M?$($i$l$?=i4|%4!<%k!J(BKLIC/KL1$B$G$O(B \verb!main:main/0!$B!K$r!"(B
$B$=$N%4!<%k$HF17A$N%X%C%@$r;}$D@a$K=>$C$F%j%@%/%7%g%s$r7+$jJV$9!#(B
$B$9$J$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$$$F5-=R$9$k$3$H$,$G$-$k!#(B

%---------------------------------------------------------------
\section{ $B1s3V<B9T$N;EAH$_(B }

\begin{figure}[b]
\crush
\begin{center}
\begin{boxedverbatim}
  Local                           Remote

  remote call - - - - - - - -> predicate
       ||                          ||   meta-call
      stub ==================== skeleton
           socket communication
\end{boxedverbatim}
\end{center}
\caption{Stub-Skeleton Framework for Remote Predicate Call}  \label{fig:frame}
\end{figure}

$B1s3V8F$S=P$7$N$?$a$N%b%G%k$H$7$F!"J,;64D6-$KBP$9$kF)2a@-$rDs6!$9$k!"(B
$B%9%?%V(B-$B%9%1%k%H%s%b%G%k$,$"$k!#1s3V8F$S=P$7$r9T$&%4!<%k$H!"(B
$B1s3V<B9T$5$l$k=R8l$OJ,;64D6-$rG'<1$;$:!"J,;6$N$?$a$NDL?.$O(B
$B%9%?%V$H%9%1%k%H%s$NCf$K%+%W%;%k2=$5$l$k$N$G$"$k!#(B
$B?^(B\ref{fig:frame}$B$r8+$h!#(B

KLIC/KL1$B$O!"%4!<%k$NJ,;6@)8f$r<B8=$7$F$$$J$$$,!"(B
$B%4!<%k$N%a%?<B9T$H!"(BUnix$B%l%Y%k$N%=%1%C%HDL?.$rDs6!$7$F$$$k$N$G!"(B
$B$3$l$rMxMQ$7$F(B\dklic $B$r5-=R$9$k!#(B

Java$B$G5-=R$5$l$?(BKL1j$B$KHf3S$7$F!"(B
KLIC$B$G(B\dklic $B$r5-=R$9$k$3$H$NMxE@$O!"<j4V$,$+$+$i$J$$$3$H$G$"$k!#(B
KL1$B$N%*%V%8%'%/%H$r(BJava$B$N%*%V%8%'%/%H$K%^%C%T%s%0$9$kI,MW$,$J$/!"(B
$B<BAu$7$J$1$l$P$J$i$J$$$N$O!"%4!<%k$NAw<u?.$H!"(B
$B<u?.$7$?%4!<%k$N<B9T$N$_$G$"$k!#(B

%---------------------------------------------------------------
\section{ $B1s3V8F$S=P$7$NMxE@(B }

KLIC$B$N%=%1%C%HDL?.$rD>@\MxMQ$7$?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/!"%W%m%0%i%^$,(B
$BL@<(;XDj$rMQ$$$F<B83$9$k$3$H$,K>$^$l$F$$$k!#(B

$BC1=c2=$N$?$a!"DL?.$O(Beager$B$K9T$&!#!J(Blazy$B$K$O9T$o$J$$!#!K(B
$B1s3V<B9T%4!<%k$N0z?t$O!"6qBN2=$5$l$F$$$k8B$j0lEY$KDL?.$7$F$7$^$&!#(B
$BDL?.$KMQ$$$i$l$?JQ?t$,6qBN2=$5$l$?$i!"JQ?t$HCM$H$NC10l2=%4!<%k$r(B
$BDL?.$9$k!#$7$?$,$C$F!"DL?.$5$l$k$b$N$O!"1s3V;XDj$5$l$?%4!<%k$H(B
$BL$Dj5AJQ?t$N6qBN2=%4!<%k$N$_$G$"$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{ $BM=Hw<B83(B } \label{experiment}

dKLIC$B$r<BAu$9$k$N$K;HMQ$9$k(BKLIC$B$N5!G=$rD4$Y$k$?$a!"(B
$BA0=`Hw$H$7$F!"$"$k$$$O(BdKLIC$B$N<BAuCf$K!"$$$/$D$+$NM=Hw<B83$r9T$C$?!#(B
$BK\>O$G$O!"$=$l$i$NM=Hw<B83$K$D$$$F=R$Y$k!#(B

$BBh(B\ref{experiment:environment}$B@a$G<B83$r9T$C$?4D6-$r<($7!"(B
$BBh(B\ref{experiment:marshall}$B@a$GD>Ns2==hM}$NI,MW@-$rL@$i$+$K$7$?<B83!"(B
$BBh(B\ref{experiment:rcall}$B@a$G%4!<%kDL?.$*$h$S%a%?<B9T!"(B
$BBh(B\ref{experiment:guvars}$B@a$HBh(B\ref{experiment:wterm}$B@a$G(B
$BJQ?t$r4IM}<1JL$9$kI,MW@-$rL@$i$+$K$7$?<B83$K$D$$$F=R$Y$k!#(B

%---------------------------------------------------------------
\section{ $B<B83$N4D6-(B }  \label{experiment:environment}

$B<B83$O!"0J2<$N4D6-$G9T$C$?!#(B

\begin{description}
\item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%H!<%k$r9T$C$?$,!"(B
PC$B4D6-$G$O!"(Blibm$B$H(Blibnsl$B$@$1$,%7%9%F%`$K$"$j!"(Blibsocket$B$OB8:_$7$J$+$C$?!#(B

%---------------------------------------------------------------
\section{ $BD>Ns2==hM}$NI,MW@-(B }  \label{experiment:marshall}

$BIUO?(B\ref{cliser}$B$O!"%/%i%$%"%s%H$,%5!<%P$K@\B3$7!"(B
\verb!"Hello."! $B$H$$$&J8;zNs$rAw$C$F@\B3$r@Z$k%W%m%0%i%`$G$"$k!#(B

$BJ8;zNs$d!"J8;z%3!<%I$K$h$kF~=PNO$O!"Dc%l%Y%kF~=PNO$H8F$P$l$k!#(B
$B$3$NB>$K(BKLIC$B$G$O!"(BKL1$B9`$K$h$k9b%l%Y%kF~=PNO5!G=$,MQ0U$5$l$F$$$k$,!"(B
$BIUO?(B\ref{cliser}$B$N%W%m%0%i%`$rJQ7A$7$F<B83$7$?$H$3$m!"(B
$B$3$N5!G=$r%=%1%C%HDL?.$G$OMxMQ$G$-$J$$$3$H$,L@$i$+$K$J$C$?!#(B
$B=>$C$F!"%4!<%k$rAw<u?.$9$k(BdKLIC$B$O!"(B
KL1$B9`$ND>Ns2=!&I|85$r9T$&I,MW$,$"$k!#(B

%---------------------------------------------------------------
\section{ $B1s3V8F$S=P$7(B } \label{experiment:rcall}

$BIUO?(B\ref{test:rcall}$B$O!"%/%i%$%"%s%H$,%4!<%k$rJ8;zNs2=$7$?$HA[Dj$7$FAw?.$7!"(B
$B%5!<%P$,<u?.$7$?J8;zNs$+$i%4!<%k$rI|85$7$F<B9T$9$k%W%m%0%i%`$G$"$k!#(B
$BAw<u?.$5$l$?%4!<%k$O%U%!%s%/%?$N7A$r<h$C$F$$$k$,!"Bh(B\ref{base}$B>O(B
$B$G=R$Y$?$h$&$K%4!<%k$O9=J8>e%U%!%s%/%?$K$h$C$FI=$5$l$k$N$G!"(B
$B$3$l$OBEEv$G$"$k!#(B

$B%U%!%s%/%?$K$h$C$FI=$5$l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BKLIC$B$N2<$GMxMQ$5$l$F$$$k(BGCC
$B$,:GE,2=$r9T$$!"@EE*$K$I$3$+$i$b8F$P$l$J$$(BC$B4X?t!J(BKL1$B$N%b%8%e!<%k!K(B
$B$r<B9T%W%m%0%i%`$+$i<h$j=|$$$F$7$^$&$?$a$@$H;W$o$l$k!#(B
$B$=$N>Z5r$K!"$=$N%b%8%e!<%k$N@EE*8F$S=P$7$rIU$12C$($?7k2L!"(B
$B=R8l$NF0E*@8@.$b@.8y$7$?!#(B
GCC$B$N:GE,2=%*%W%7%g%s$O!"(BKLIC$B$N%G%U%)%k%H%$%s%9%H!<%k$N$^$^$G$"$j!"(B
$B0J2<$NDL$j$G$"$k!#(B

\begin{verbatim}
 -O2 -g -fomit-frame-pointer
\end{verbatim}

$B0J>e$N<B83$K$h$C$F!"%U%!%s%/%?$rAw<u?.$G$-$l$P(B
$B1s3V%4!<%k<B9T$,2DG=$G$"$k$3$H$,J,$+$C$?!#(B
$B4{$K=R$Y$?$h$&$K!"(BKLIC$B$N%=%1%C%H$K$O%P%$%HNs$7$+N.$;$J$$$N$G!"(B
$B%U%!%s%/%?$rAw<u?.$9$k$K$O(BKL1$B9`$rD>Ns2=$7$J$1$l$P$J$i$J$$!#(B

KL1$B9`$rD>Ns2=$9$k%b%8%e!<%k$r<BAu$7!"(B
$B<B83$r9T$C$?$H$3$m!"4pDl9`!JJQ?t$r4^$^$J$$9`!K$K4X$7$F$O(B
$BLdBj$J$/D>Ns2=!&I|85$,2DG=$G$"$k$3$H$,J,$+$C$?!#(B
$BIUO?(B\ref{type}$B$r;2>H$;$h!#(B

%---------------------------------------------------------------
\section{ $BL$Dj5AJQ?t$N<1JL(B } \label{experiment:guvars}

$BL$Dj5AJQ?tF1;N$r<1JL$G$-$k$+$I$&$+$N<B83$G$"$k!#(B

$BL$Dj5AJQ?tJQ?t(B \verb!X! $B$H!"(B \verb!X, Y, Z! $B$K$D$$$F!"(B
$B$^$:!"$=$l$>$lF1Dj$G$-$k$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G$"$k!#(B
$B$J$<$J$i!"!V0[$J$k!WJQ?t$O>-Mh!"C10l2=$5$l$kF10l$NJQ?t$+$b$7$l$J$$$+$i$G$"$k!#(B

$B$7$+$7!"F10l$NJQ?t$rF1Dj$G$-$J$$$3$H$O!"ITE,@Z$G$"$k$H;W$o$l$k!#(B
$B<B:]!"AH9~$_=R8l(B \verb!builtin:print/1! $B$G!"(B
\verb!X,Y! $B$N$$$:$l$bF1L>(B \verb!_B! $B$GI=<($5$l!"F1Dj$5$l$F$$$k!#(B
\verb!alternatively.! $B$r(B \verb!otherwise.! $B$KJQ$($F<B83$7$F$b!"(B
$B1J5WCfCG$,H/@8$9$k$@$1$G!"F10lJQ?t$NF1Dj$O$G$-$J$+$C$?!#(B

$B$3$N$3$H$O!"(BKLIC$B$K$+$J$j=EBg$J5!G=7gMn$r$b$?$i$7$F$*$j!"(B
$BL\I8$H$9$k=hM}7O$K$b$=$N1F6A$,5Z$V$3$H$K$J$k!#(B
$B>\:Y$K$D$$$F$O!"Bh(B\ref{experiment:wterm}$B@a$r;2>H$;$h!#(B

%---------------------------------------------------------------
\section{ $BL$Dj5AJQ?t$N(Bwrap/unwrap } \label{experiment:wterm}

$BBh(B\ref{experiment:rcall}$B@a$N<B83$K$h$C$F!"(B
$B4pDl9`$GI=$;$k%4!<%k$O1s3V<B9T2DG=$G$"$k$3$H$,J,$+$C$?!#(B
$B$7$+$7!"JQ?t$r4^$`%4!<%k$r1s3V<B9T$G$-$J$1$l$P!"<BMQ$KBQ$($k$H$O8@$($J$$!#(B

\cliser $B%W%m%;%9$r(BKL1$B$G=q$/$K$O!"(B
$BJQ?t@8@.$HB+G{$K;~4V:9$,$"$k%9%H%j!<%`$N;HMQ$,I,?\$G$"$k!#(B
$BL$Dj5AJQ?t$O<B9TESCf$N>uBV$rI=$7!"6qBN2=$5$l$?JQ?t$O=hM}$N=*N;$rI=$9!#(B
dKLIC$B$G$OJQ?t$N6qBN2=$rDL?.$9$k$?$a!"L$Dj5AJQ?t$r<1JL$9$kI,MW$,$"$k!#(B

$B0J2<$N<B83$K$h$C$F!"(BKLIC$B$G$OF0E*JQ?t$r<1JL$G$-$J$$$3$H$,L@$i$+$K$J$C$?!#(B
dKLIC$B$G$OF0E*JQ?t$N<1JL$N$?$a!"JQ?tI=$r<BAu$7$J$1$l$P$J$i$J$+$C$?!#(B

KLIC$B$K$O!"(BKL1$B9`$rF0E*$K%a%?A`:n$9$k(B
\verb!variable:wrap/2, variable:unwrap/2! $B$H$$$&=R8l$,$"$j!"(B
$B$3$N5!G=$r;H$C$FJQ?t$r4pDl9`$GI=$9$3$H$,$G$-$l$P!"(B
$BJQ?t$r4V@\E*$KD>Ns2=$7$F!"JQ?t$r4^$`%4!<%k$r1s3V<B9T$9$k$3$H$,$G$-$k$3$H$K$J$k!#(B

$BIUO?(B\ref{test:wterm}$B$N%W%m%0%i%`$O!"(B
$BI8=`F~NO$+$iF@$?(BKL1$B9`$r(B \verb!wrap! $B$7$FI=<($9$k!#(B
$B<B9TNc$r0J2<$K<($9!#(B

\comp{test/wterm.log}

$ 1 $$B9TL\$KI=<($5$l$F$$$k$N$O!"@EE*JQ?t(B \verb!X! $B$r(B \verb!wrap! $B$7$?7k2L$G$"$k!#(B
$B@EE*L>(B \verb!X! $B$,>C$($FL5L>JQ?t(B \verb!variable("_")! $B$K$J$C$F$7$^$C$?!#(B
$B%^%K%e%"%k(B \cite{info} $B$K$h$k$H!"(B \verb!wrap! $B$7$?JQ?tL>$,>C$($k$N$O%P%0$G$"$k!#(B
$B0lJ}!"(B$ 3 $$B9TL\$GF~NO$7$?JQ?t(B \verb!Var! $B$r(B \verb!wrap! $B$7$?7k2L$O!"(B
$ 4 $$B9TL\$N(B \verb!variable("Var")! $B$G$"$k!#(B

$B$b$C$H>\$7$/@bL@$9$k$H!"(B
$B9b%l%Y%kF~NO%9%H%j!<%`(B \verb!klicio:klicio(Stream)! $B$KBP$9$k%a%C%;!<%8(B
\verb!getwt/1! $B$OF~NO$5$l$?(BKL1$B9`$r(B \verb!wrap! $B$7$FJV$9!#(B
\verb!variable:wrap/2! $B$OA4$F$NJQ?tL>$r>C$7$F$7$^$&$,!"(B
\verb!getwt/1! $B$OJQ?tL>$rJ8;zNs$H$7$FFI$_9~$`$N$GJQ?tL>$O<:$o$l$J$$!#(B
\verb!variable:wrap/2! $B$GJQ?tL>$,<:$o$l$F$7$^$&$N$O!"K]Lu;~$K@EE*L>$,<:$o$l$k$+$i$G$"$k!#(B
$B$b$7@EE*L>$rJ]$C$F$$$?$H$7$F$b!"J#?t2s8F$S=P$5$l$k=R8l$NCf$G(B \verb!variable:wrap/2! $B$,(B
$B9T$o$l$F$$$?>l9g!"F1$8@EE*L>$r;}$DJ#?t$NF0E*JQ?t$r<1JL$9$k$3$H$O$G$-$J$$!#(B
$BNc$($P!"%j%9%H$NMWAG$r(B \verb!wrap! $B$7$FJV$90J2<$N=R8l$r9M$($h$&!#(B

{\crush
\begin{boxedverbatim}
  wrap_list(L, WL) :- L = [] |
    WL = [].

  wrap_list(L, WL) :- L = [X|L1] |
    variable:wrap(X, WX),
    wrap_list(L1, WL1),
    WL = [WX | WL1].
\end{boxedverbatim}
}

$B$3$N=R8l$K%j%9%H(B \verb![X,Y]! $B$rM?$($k$H!"0J2<$N:F5"%4!<%kNs$,@8@.$5$l$k!#(B
\begin{verbatim}
  wrap_list([X,Y],WL), wrap_list([Y],WL1), wrap_list([],[])
\end{verbatim}
\verb!variable:wrap(X,WX)! $B$,@EE*L>(B \verb!X! $B$rJ]$C$F$b!"@8@.$5$l$k(B
\begin{verbatim}
  WL = [variable(X),variable(X)]
\end{verbatim}
$B$O4V0c$C$F$$$k!#(B \verb!X\=Y! $B$G$"$k$+$b$7$l$J$$$+$i$G$"$k!#(B
$BK>$_$N=hM}$O!"F0E*<1JLL>$rM?$($k$3$H$G$"$k!#(B

$B$5$i$K:Y$+$J<B83$r$$$/$D$+9T$J$C$?!#(B
$BL$Dj5AJQ?t$r(B \verb!wrap! $B$9$k$HL5L>JQ?t$K$J$k!#(B
\verb!variable(String)! $B$r(B \verb!unwrap! $B$9$k$HJQ?t$,$G$-$k$,!"$3$l$O(B
\begin{verbatim}
  variable:unwrap(variable(String), Variable)
\end{verbatim}
$B$H$$$&%4!<%k$NBh(B$ 2 $$B0z?t(B \verb!Variable! $B$=$N$^$^$G$"$k!#(B

\verb!getwt/1! $B%a%C%;!<%8$G(B \verb!Variable! $B$HF~NO$9$k$H!"(B
$B4pDl9`(B \verb!variable("Variable")! $B$rF@$k!#(B
$B$3$N4pDl9`$r(B \verb!putwtq/1! $B%a%C%;!<%8$G=PNO$9$k$H!"(B
\verb!Variable! $B$HI=<($5$l$k!#(B
$BF~=PNO$GA`:n$5$l$k!VJQ?t!W$O!"(B
$BF~=PNO%W%m%0%i%`$K$H$C$F$OJQ?t$G$O$J$/C1$J$kJ8;zNs$G$"$k!#(B

KL1$B9`$rF~NO$9$k%a%C%;!<%8(B \verb!gett/1! $B$GJQ?t(B \verb!Variable! $B$rF~NO$9$k$HJQ?t$rF@$k$,!"(B
$B$3$l$O(B \verb!gett(X)! $B$H$$$&%a%C%;!<%8$N0z?t(B \verb!X! $B$=$N$^$^$G$"$k!#(B
\verb!puttq/1! $B%a%C%;!<%8$GJQ?t$r=PNO$7$h$&$H$9$k$H!"CfCG$7$FJQ?t$N6qBN2=$rBT$D!#(B

$B$3$l$i$N7k2L$+$i!"F0E*$JL$Dj5AJQ?t$O<1JL$G$-$J$$$3$H$,L@$i$+$K$J$C$?!#(B
$BBh(B\ref{experiment:guvars}$B@a$G=R$Y$?$h$&$K!"(BKLIC$B$G$OF10lJQ?t$NF1Dj$,$G$-$J$$!#(B
\verb!unbound/2! $BAH9~$_=R8l$O!"L$Dj5AJQ?t$KBP$7$F$=$N%"%I%l%9$rJV$9$,!"(B
$B$4$_=8$a8@8l5!G=$K$h$C$FJQ?t$N%"%I%l%9$OJQ2=$9$k$?$a!"40A4$H$O8@$($J$$!#(B
\verb!unbound/2! $B$N%"%I%l%9$K$h$kH=CG$,(BKLIC$B$K$*$1$kJQ?t<1JL$NM#0l$N<j$,$+$j$@$,!"(B
$BL\I8=hM}7O$NHFMQ@-$rNt2=$5$;$k$HH=CG$7!":#2s$O;HMQ$r8+Aw$C$?!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{ $B<BAu$N>\:Y(B } \label{implement}

$BK\>O$G$O!"(BdKLIC$B<BAu$N>\:Y$K$D$$$F=R$Y$k!#(B

$B%4!<%k$rDL?.$9$k(BdKLIC$B$,D>Ns2==hM}$r9T$&I,MW$,$"$k$3$H$O!"(B
$BBh(B\ref{experiment:marshall}$B@a$N<B83$GJ,$+$C$?!#(B
$B$^$?!"L$Dj5AJQ?t$H$=$N6qBN2=$rDL?.$9$k$?$a$K!"(BdKLIC$B$,(B
$BDL?.$5$l$?L$Dj5AJQ?t$r4IM}$7!"<1JLL>$rM?$($kI,MW$,$"$k$3$H$O!"(B
$BBh(B\ref{experiment:guvars}$B@a$HBh(B\ref{experiment:wterm}$B@a$N<B83$GJ,$+$C$?!#(B

\begin{figure}
\crush
\begin{center}
\begin{boxedverbatim}
  Layer 3:  Remote Predicate Call
  Layer 2:  High Level Socket Communication
  Layer 1:  Variable Table
  Layer 0:  Marshalling
\end{boxedverbatim}
\end{center}
\caption{Layers in dKLIC Implementation}  \label{fig:layers}
\end{figure}

$B<BAu$N3,AX$r?^(B\ref{fig:layers}$B$K<($9!#(B

$BBh(B\ref{implement:type}$B@a$G!":G2<AX$ND>Ns2=$r<BAu$7!"(B
$BBh(B\ref{implement:vartab}$B@a$G!"$=$N>e$NJQ?tI=!"(B
$BBh(B\ref{implement:vsock}$B@a$G9b%l%Y%k%=%1%C%HDL?.$r<BAu$9$k!#(B

$B2<(B$ 3 $$BAX$N<B9T;~%i%$%V%i%j$O<B8=$G$-$?$,!"(B
$B:G>eAX$N1s3V<B9T$O;n:n$H!"5!3#K]Lu$N%"%k%4%j%:%`$r<($9$K$H$I$^$C$?!#(B
$B;n:n$K$D$$$F$O!"Bh(B\ref{analysis:append}$B@a!"(B
$B5!3#K]Lu$N%"%k%4%j%:%`$O!"Bh(B\ref{analysis:compile}$B@a$G<($9!#(B

%---------------------------------------------------------------
\section{ $BD>Ns2=(B } \label{implement:type}

$BBh(B\ref{experiment:marshall}$B@a$G=R$Y$?$h$&$K!"(BKLIC$B$N%=%1%C%H$K$O(B
$BJ8;zNs$+J8;z%3!<%I$7$+N.$9$3$H$,$G$-$J$$!#(B
KL1$B9`$rN.$9$K$O!"(BKL1$B9`$r%P%$%HNs$KJQ49$9$kD>Ns2=$N=hM}$,I,MW$G$"$k!#(B
$B%b%8%e!<%k(B \verb!type! $B$O!"G$0U$N(BKL1$B$N7?$rD>Ns2=$9$k=hM}$r9T$&!#(B
$BIUO?(B\ref{type}$B$r;2>H$;$h!#(B

$BD>Ns2=$H8@$C$F$b!"7k2L$O0E9f$N$h$&$J%P%$%HNs$G$O$J$/!"J8;z$NNs$G$"$k!#(B
$B%F%9%H$H%G%P%C%0$NMF0W$5$N$?$a!"(BKL1$B9`$r(B
$B%W%m%0%i%`%F%-%9%H>e$N8+$?L\$HF1$8J8;z$NNs$KJQ49$7$?$+$C$?!#(B

$B:G=i$N;EMM$G$O!"$3$N%b%8%e!<%k$OG$0U$N7?$HJ8;zNs7?$H$NJQ495!G=$r(B
$BDs6!$9$k$b$N$G$"$C$?!#%b%8%e!<%kL>(B \verb!type! $B$O!"Ev%b%8%e!<%k$,(B
$B0lHL$N7?JQ495!G=$rDs6!$9$k$3$H$r<($9L>;D$G$"$k!#(B

$BJ8;zNs7?$NCM$O!"%W%m%0%i%`%F%-%9%H>e$GFs=E0zMQId$G0O$^$l$FI=5-$5$l$k!#(B
$B0lJ}!"%=%1%C%H$KN.$5$l$?%P%$%HNs$rA4$FFs=E0zMQId$G0O$_$?$/$O$J$+$C$?!#(B
$B%W%m%0%i%`$,%P%$%HNs$rJ8;zNs$H$7$F<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B
$B$=$NJ8;z$,=PNO$5$l$k$H$$$&F~=PNO%9%H%j!<%`$N9=J8E|$,MxMQ$G$-$k$+$i$G$"$k!#(B
$B!J(B\verb!putc/1! $B$NBe$o$j$K!"0z?t$NJ8;z$rD>@\N.$;$k!#!K(B
$BIaDL$N%j%9%H$@$H!"D>Ns2=$7$?(BKL1$B9`$r(B$1$$B$DN.$7$?$H$-!"(B
$B%j%9%H$N=*$o$j$KE~C#$7$FF~=PNO%9%H%j!<%`A4BN$,=*N;$7$F$7$^$&!#(B
$B0lJ}!":9J,%j%9%H$rMQ$$$k$H!"A0$N9`$NHx$K<!$N9`$NF,$r7R$2$F(B
$BG$0U8D?t$N(BKL1$B9`$rN.$9$3$H$,$G$-$k!#(B

%---------------------------------------------------------------
\section{ $BJQ?tI=(B } \label{implement:vartab}

$BJQ?tI=$H$O!"(BKLIC$B$NJQ?t$r<1JL$9$k$?$a$K!"(B
$B<1JLL>$H(BKLIC$BJQ?t$H$rBP1~$E$1$k<-=q$G$"$k!#(B

\begin{figure}[b]
\crush
\begin{center}
\begin{boxedverbatim}
  Local                     Remote

  Stub                    Skeleton
  [Value=Name]--------[Name=Value]
               socket
\end{boxedverbatim}
\end{center}
\caption{Variable Tables}  \label{fig:vartab}
\end{figure}

$BBh(B\ref{experiment:guvars}$B@a!"$*$h$SBh(B\ref{experiment:wterm}$B@a$N<B83$+$i!"(B
KLIC$B$G$OJQ?t$N<1JL$,$G$-$J$$$3$H$,J,$+$C$?!#(B
$B$7$+$7!"L\I8=hM}7O$G$OJB9TO@M}7?8@8l:GBg$NFCD'$G$"$kO@M}JQ?t$r07$&I,MW$,$"$k!#(B
$BCM$r$H$j$"$($:L$Dj5AJQ?t$H$7$F$*$-!"8e$G6qBN2=$9$k$3$H$,$G$-$J$1$l$P!"(B
\cliser $B7?DL?.$N0MMj!JJQ?t!K(B--$BJV;v!J6qBNCM!K$H$$$&%Q%?!<%s$rF'$`$3$H$,$G$-$J$$!#(B

$B$3$N$?$a!"1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$H$7$F!K(B
$B4IM}$7$h$&$H9M$($?$?$a$G$"$k!#$3$NJ}<0$O!"(Bcdr$BO":?$r0z?t$K;}$D:F5"%4!<%kNs$K(B
$BE,9g$7!"JQ?tL>$NF0E*@8@.$,ITMW$G$"$k$H$$$&MxE@$,$"$k!#(B

\begin{figure}
\crush
\begin{center}
\begin{boxedverbatim}
  append(X,Y,Z) :- X = [] |
    Z = Y.
  append(X,Y,Z) :- X = [E|X1] |
    append(X1, Y, Z1),
    Z = [E | Z1].
\end{boxedverbatim}
\end{center}
\caption{Predicate append/3}  \label{fig:appp}
\end{figure}

$BNc$H$7$F!"(B\verb!append/3! $B%5!<%P$r5s$2$k!#(B
$B?^(B\ref{fig:appp}$B$r8+$h!#(B

$B$3$N%5!<%P$K!"(B \verb!X=[a,b]! $B$rM?$($k$H!"0J2<$N$h$&$J:F5"%4!<%kNs$,@8@.$5$l$k!#(B
{\crush
\begin{verbatim}
  append([a,b],Y,Z), append([b],Y,Z1), append([],Y,_Z1)
\end{verbatim}
}
$BBh(B $3$ $B0z?t(B \verb!Z, Z1, _Z1! $B$O$=$l$>$l0[$J$kJQ?t$G$"$k$,!"(B
$1$ $B$D$NDL?.O)$G$"$k$H8+$J$7$F@EE*L>(B \verb!Z, Z1! $B$GE}0l$9$k$3$H$,$G$-$k!#(B

$B%/%i%$%"%s%H$,(B \verb!X=[a,b]! $B$r=y!9$K6qBN2=$9$k$b$N$H$7$h$&!#(B
$BDL?.$5$l$k$Y$-%4!<%k$O0J2<$N$h$&$G$"$k!#(B

{\crush
\begin{boxedverbatim}
  Local                  Remote

  append(X,Y,Z) ->
  X = [a|"X1"]  ->
                <- Z = [a|"Z1"]
  X = [b|"X1"]  ->
                <- Z = [b|"Z1"]
  X = []        ->
                <- Z = Y
\end{boxedverbatim}
}

\verb!"X1", "Z1"! $B$O!V<!$N!W(B \verb!X, Z! $B$rI=$7$F$$$k!#(B
$B$^$:!"(B \verb!append(X,Y,Z)! $B$,Aw?.$5$l!"(B
$B0J9_!"(B \verb!X! $B$NMWAG$,6qBN2=!"Aw?.$5$l$k$?$S$K(B
\verb!Z! $B$NMWAG$,6qBN2=$5$l$FJV$C$F$/$k!#(B

$B4{$K=R$Y$?$h$&$K!"<BMQE*$JJ,;6=hM}$NB?$/$,%9%H%j!<%`DL?.$N7A$G=q$1$k!#(B
$B$7$+$7!"$3$NJ}<0$r40A4$KMxMQ$G$-$k$?$a$K$O%W%m%0%i%`$N2r@O$,I,MW$G$"$k!#(B
$BA07G$NNc$G$b!":F5"$H(Bcdr$BO":?$rH/8+$G$-$J$1$l$P$J$i$J$$$7!"(B
$B$5$i$KJ#;($J>l9g$O!"Aj8_:F5"=R8l$N6K>.=89g$dJQ?t$NJLL>IU$1$rH/8+$7!"(B
$B8_$$$K0[$J$kJQ?tL>$rM?$($J$1$l$P$J$i$J$$!#(B
$B@EE*$K$G$O$"$k$,!"$$$:$l$K$;$hJQ?tL>$N@8@.$OI,MW$J$N$G$"$k!#(B

$B<B8=$NMF0W$5$rM%@h$7$F!":#2s$N<BAu$G$O@EE*L>$r40A4$KL5;k$7!"(B
$BF0E*$KJQ?tL>$r@8@.$9$k$3$H$K$7$?!#(BKLIC$B$N(B \verb!variable:wrap/2! $B=R8l$O(B
$BA4$F$NJQ?t$KBP$7$FF0E*L5L>(B \verb!_! $B$r@8@.$9$k$,!"$3$l$G$O(B
$BF10lJQ?t$NF1Dj$,$G$-$J$$!#Ev%b%8%e!<%k$G$O!"(B \verb!builtin:print/1!
$B=R8l$KJo$C$F!"2<@~$K@0?t$,B3$/L>A0$r@8@.$9$k$3$H$K$7$?!#(B
$B$9$J$o$A!"(B \verb!append! $B$KBP$7$F?^(B\ref{fig:appgoals}$B$N$h$&$G$"$k!#(B

\begin{figure}[b]
\crush
\begin{center}
\begin{boxedverbatim}
  append(_0,_1,_2) ->
  _0 = [a|_3]      ->
                   <- _2 = [a|_4]
  _3 = [b|_5]      ->
                   <- _4 = [b|_6]
  _5 = []          ->
                   <- _6 = _1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$i$:Ev%b%8%e!<%k$r;H$&$3$H$,$G$-$k!#(B

$BJQ?tI=$,;~4VJQ2=$9$kC`<!%W%m%;%9$G$"$k$?$a!"(B
$BJQ?tI=$r;2>H$9$kEv%b%8%e!<%k$NDs6!$9$k%=%1%C%HDL?.$bHsF14|$K9T$($J$$!#(B
$B$3$N$?$a!"(BKLIC$B$N%=%1%C%HF~=PNO$,HsF14|$K9T$($J$$$H$$$&LdBj$O!"(B
$B2r7h$9$kI,MW$,$J$/$J$C$?!#JQ?tI=$NJBNs2=$O:#8e$N2]Bj$G$"$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{ dKLIC$B$NI>2A(B } \label{analysis}

$BK\>O$G$O!"<BAu$7$?(BdKLIC$B$NI>2A!"J,@O$H9M;!$r9T$&!#(B

\begin{figure}
\crush
\begin{center}
\begin{boxedverbatim}
  +-----------------+
  |  User Program   |
  |     in dKL1     |
  +-----------------+
          | dKLIC Compiler
          V               +-----------------------+
  +-----------------+     | dKLIC Runtime Library |
  |   in KLIC/KL1   |     |      in KLIC/KL1      |
  +-----------------+     +-----------------------+
          |  KLIC Compiler           | KLIC Compiler
          V                          V
  +-----------------+     +-----------------------+
  | in Machine Code |     |    in Machine Code    |
  +-----------------+-----+-----------------------+
  |                 Machine                       |
  +-----------------------------------------------+
\end{boxedverbatim}
\end{center}
\caption{dKLIC Configuration}  \label{fig:config}
\end{figure}

dKLIC$B$N9=@.$K$D$$$F!"?^(B\ref{fig:config}$B$r8+$h!#(B

$BBh(B\ref{analysis:append}$B@a$G<B9T;~%i%$%V%i%j$rMQ$$$?1s3V<B9T$NNc!"(B
$BBh(B\ref{analysis:compile}$B@a$G5!3#K]Lu$N%"%k%4%j%:%`$r<($9!#(B

$BBh(B\ref{analysis:design}$B@a$G<BAuJ}?K$NI>2A!"(B
$BBh(B\ref{analysis:vartab}$B@a$HBh(B\ref{analysis:vartype}$B@a$G(B
$B<BAu$7$?JQ?tI=$NI>2A$r9T$&!#(B

%---------------------------------------------------------------
\section{ $B1s3V<B9T$NNc(B }  \label{analysis:append}

\begin{figure}
\crush
\begin{boxedverbatim}
    append/3 Remote Caller
  +------------------------+
  | :- module main.        |
  | main :-                |
  |   remote:append(X,Y,Z) |
  |       @node(Remote),   |
  |   X = [5,4,3,2,1],     |
  |   Y = [5,4,3,2,1],     |
  |   builtin:print(Z).    |
  +------------------------+
              | dKLIC Compiler
              V
      Appendix "appcli"
\end{boxedverbatim}
\begin{boxedverbatim}
           append/3 Server
    +-----------------------------+
    | :- module remote.           |
    | append(X,Y,Z) :- X=[] |     |
    |   Z = Y.                    |
    | append(X,Y,Z) :- X=[E|X1] | |
    |   Z = [E|Z1],               |
    |   append(X1,Y,Z1).          |
    +-----------------------------+
                   | dKLIC Compiler
                   V
           Appendix "appsrv"
\end{boxedverbatim}
\caption{Remote append/3 Call in dKL1}  \label{fig:app}
\end{figure}

$B<BAu$r?J$a$F$-$?<B9T;~%i%$%V%i%j$rMQ$$$F!"(B
\verb!append/3! $B$N1s3V<B9T$r9T$&%W%m%0%i%`Nc$r5s$2$k!#(B

$B$3$3$K5s$2$kNc$O!"(BdKLIC$B$N%3%s%Q%$%i$,=PNO$9$Y$-K]Lu7k2L$G$"$k!#(B
$B%3%s%Q%$%i<+BN$O;~4V$N@)Ls$+$i!"$^$@<BAu$5$l$F$$$J$$!#(B
$BK\@a$G$O!"(BdKLIC$B%3%s%Q%$%i$,?^(B\ref{fig:app}$B$N(BdKL1$B%W%m%0%i%`$rFI$s$G!"(B
$BIUO?(B\ref{sample}$B$N(BKLIC/KL1$B%W%m%0%i%`$r=PNO$7$?$b$N$HA[Dj$7$F$$$k$,!"(B
$BIUO?(B\ref{sample}$B$N(BKLIC/KL1$B%W%m%0%i%`$O(B
$B$+$J$jWs0UE*$K%O%s%I%3%s%Q%$%k$5$l$F$*$j!"5!3#K]Lu$N7k2L$H$O8@$$Fq$$!#(B
$B5!3#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"%s%H$,(B \verb!_0,_1! $B$NMWAG$r=y!9$K6qBN2=$9$k$?$S$K!"(B
$B%5!<%P$H$N4V$G6qBN2=I=$r$d$j<h$j$9$k$3$H$r7+$jJV$9!#(B
$B?^(B\ref{fig:appx}$B$r8+$h!#(B

\begin{figure}
\crush
\begin{center}
\begin{boxedverbatim}
  Client        Stub                Skeleton        Server
                    append(_0,_1,_2)
  append(X,Y,Z)     ---------------> meta-call
    @node(Remote).                           append(X,Y,Z).
                    _0 = [5 | _3]                 ||
  X=[5|X1]          --------------->         append([5|X1],Y,Z) :-
                    <---------------           Z = [5|Z1],
                       _2 = [5 | _4]           append(X1,Y,Z1).
                    _3 = [4 | _5]                 ||
  X1=[4|_X1]        --------------->         append([4|_X1],Y,_Z) :-
                    <---------------           _Z = [4|_Z1],
                       _4 = [4 | _6]           append(_X1,Y,_Z1).
\end{boxedverbatim}
\end{center}
\caption{Communication and Reduction for append/3}  \label{fig:appx}
\end{figure}

$B$3$NNc$G$O?M<j$K$h$kK]Lu$G!"(B
\verb!_0,_1! $B$NMWAG$N6qBN2=$H6qBN2=I=$NAw?.$rF14|$5$;$F$$$k$N$@$,!"(B
$B0lHL$N1s3V=R8l8F$S=P$7$GF14|$r9T$&$K$O@EE*2r@O$,I,MW$K$J$k!#(B
$B<B8=$NMF0W$5$rJ]$D$?$a$K@EE*2r@O$rF3F~$7$J$$$H$$$&<BAuJ}?K$r:N$C$?$N$G$"$k$+$i!"(B
$B5!3#K]Lu$K$O$b$C$HC1=c$JDL?.%W%m%H%3%k$,I,MW$G$"$k!#(B
$BBh(B\ref{analysis:compile}$B@a$G5!3#K]Lu$N%"%k%4%j%:%`$HDL?.%W%m%H%3%k$r<($9!#(B

%---------------------------------------------------------------
\section{ $B5!3#K]Lu%"%k%4%j%:%`(B }  \label{analysis:compile}

$BK\@a$G!"0lHL$N1s3V=R8l8F$S=P$7$KBP$9$k5!3#K]Lu%"%k%4%j%:%`$r<($9!#(B
$BK]Lu%"%k%4%j%:%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$"$kJQ?t$O!"$$$:$l6qBN2=$5$l$k$Y$-$G$"$k!#(B
$BF1MM$K!"7h$7$F6qBN2=$5$l$J$$JQ?t$rDL?.$9$Y$-$G$O$J$$$7!"(B
$BDL?.$5$l$?JQ?t$,6qBN2=$5$l$J$$$N$O!"$*$=$i$/%P%0$G$"$k!#(B
$B=>$C$F!"DL?.$,=*$o$l$PL$Dj5AJQ?t$OL5$/$J$k$Y$-$G$"$k!#(B

$BDL?.%W%m%H%3%k$,7h$^$C$?$N$G!"(B
$B$3$N%W%m%H%3%k$K=>$&K]Lu%"%k%4%j%:%`$r<($9!#(B

\begin{figure}[b]
\crush
\begin{center}
\begin{boxedverbatim}
  modu:pred(X,..) @node(Remote).
\end{boxedverbatim}
\end{center}
\caption{General Remote Call}  \label{fig:general}
\end{figure}

$B?^(B\ref{fig:general}$B$N$h$&$J1s3V8F$S=P$7$r9T$&(BdKL1$B%/%i%$%"%s%H$r9M$($k!#(B

\begin{figure}
\crush
\begin{center}
\begin{boxedverbatim}
stub(X,..) :-
  get_host_and_port(Remote, Host, Port),
  unix:unix([connect(inet(Host, Port), normal(S))]),
  socket:socket(Socket, S),
  Socket = [puttq(modu:pred(X,..)), 0'., nl | Socket1]
  receive(Socket1).

receive(Socket) :-
  Socket = [fflush(0), gett(AtRemote) | Socket1],
  receive(AtRemote, Socket1).

receive(AtRemote, Socket) :- AtRemote = END_COMM |
  Socket = [].
receive(AtRemote, Socket) :- AtRemote = Bindings |
  Socket = [bind(AtRemote), bound(AtLocal) | Socket1],
  send(AtLocal, Socket1).

send(AtLocal, Socket) :- AtLocal = END_COMM |
  Socket = [puttq(AtLocal), 0'., nl, fflush(0)].
send(AtLocal, Socket) :- AtLocal = Bindings |
  Socket = [puttq(AtLocal), 0'., nl | Socket1],
  receive(Socket1).
\end{boxedverbatim}
\end{center}
\caption{General Stub}  \label{fig:stub}
\end{figure}

$B$3$N$h$&$J1s3V8F$S=P$7$O!"(B
$B?^(B\ref{fig:stub}$B$N%9%?%V$r8F$S=P$9%4!<%k$KCV$-49$($l$PNI$$!#(B

$B$3$N%9%?%V$O!":G=i$K1s3V%4!<%k$rAw?.$7!"(B
$B$=$l0J9_$ODL?.=*N;$^$G6qBN2=I=$NAw<u?.$r7+$jJV$9$b$N$G$"$k!#(B
\verb!END_COMM! $B$OA4$F$NJQ?t$,6qBN2=:Q$_$G!"DL?.$,=*N;$9$k$3$H$r0UL#$9$k!#(B
\verb!Bindings! $B$O6qBN2=I=$G!"DL?.$,B3$/$3$H$r0UL#$9$k!#(B

\begin{figure}
\crush
\begin{center}
\begin{boxedverbatim}
:- module main.

main :-
  Port = 10000,
  unix:unix([bind(inet(Port), normal(SS)),
  SS = [accept(normal(S))],
  socket:socket(Socket, S),
  Socket = [gett(Call) | Socket1],
  skeleton(Call, Socket1).

skeleton(Call, Socket) :- Call = (modu:pred(X,..)) |
  generic:call(predicate#(modu:pred/N), X,..),
  Socket = [bound(Here) | Socket1],
  send(Here, Socket1).

send(Here, Socket) :- Here = END_COMM |
  Socket = [puttq(Here), 0'., nl, fflush(0)].
send(Here, Socket) :- Here = Bindings |
  Socket = [puttq(Here), 0'., nl, fflush(0),
            gett(There) | Socket1],
  receive(There, Socket1).

receive(There, Socket) :- There = END_COMM |
  Socket = [].
receive(There, Socket) :- There = Bindings |
  Socket = [bind(There), bound(Here) | Socket1],
  send(Here, Socket1).
\end{boxedverbatim}
\end{center}
\caption{General Skeleton}  \label{fig:skeleton}
\end{figure}

$BBP1~$9$k%5!<%PB&$N%9%1%k%H%s$O!"?^(B\ref{fig:skeleton}$B$N$h$&$K$J$k!#(B
$B$3$N%9%1%k%H%s$O!":G=i$K1s3V%4!<%k$r<u?.$7$F%a%?<B9T$7!"(B
$B$=$l0J9_$ODL?.=*N;$^$G6qBN2=I=$NAw<u?.$r7+$jJV$9!#(B
$B8F$S=P$5$l$k=R8l$rJQ7A$9$kI,MW$O$J$/!"$=$N$^$^$GNI$$!#(B

$B5!3#K]Lu$N%"%k%4%j%:%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%9%l!<%?$H8@$&$Y$-=hM}7O$G==J,$G$"$m$&!#(B

%---------------------------------------------------------------
\section{ $B5!3#K]Lu(B }

$B1s3V8F$S=P$7$N9=J8$OBh(B\ref{base:distributed}$B@a$G<($7$?!#(B
$B$^$?!"5!3#K]Lu$N%"%k%4%j%:%`$K$D$$$F$OBh(B\ref{analysis:compile}$B@a$G=R$Y$?!#(B

$B$7$+$7!"8F$S=P$5$l$k=R8l$O!"$I$N$h$&$K=q$1$PNI$$$N$@$m$&$+!)(B
$B<B8=$NMF0W$5$rDI5a$7$?7k2L!"8F$S=P$5$l$k=R8l$K<j$r2C$($kI,MW$O$J$/$J$C$?!#(B
$B$7$+$7!"1s3V8F$S=P$7$5$l$k=R8l$,!"1s3V8F$S=P$7$5$l$J$$=R8l$H(B
$BA4$/F1$87A$r$7$F$$$k$J$i$P!"$I$3$G$=$N6hJL$r$9$l$PNI$$$N$+!)(B
$B%9%1%k%H%s$r@8@.$9$Y$-=R8l$O$I$l$+!)(B

$B8=:_$NM=Dj$G$O!"%b%8%e!<%k@k8@$K;w$?9=J8$rMQ$$$F!"(B
$B1s3V8F$S=P$7$5$l$k=R8l$r%W%m%0%i%^$K@k8@$5$;$k$N$,NI$$$H9M$($F$$$k!#(B
$BNc$($P!"(B \verb!append! $B%5!<%P$O0J2<$N$h$&$K$J$m$&!#(B

\begin{boxedverbatim}
  :- module server.
  :- remote( (append/3, append/4) ).

  append(X,Y,Z) :- ...

  append(A,B,C,D) :- ...
\end{boxedverbatim}

$B$b$C$HC1=c$J<BAu$H$7$F$O!"A4$F$N=R8l$KBP$7$F%9%1%k%H%s$r(B
$B@8@.$9$k$H$$$&0F$,$"$k!#$7$+$7!"%;%-%e%j%F%#$N4QE@$+$i!"(B
$BG$0U$N1s3V=R8l$r8F$S=P$;$k$3$H$OK>$^$7$/$J$$$H9M$($k!#(B
$B$^$?!"$3$N$3$H$O<B9T%W%m%0%i%`$rITI,MW$K5pBg2=$5$;$F$7$^$&!#(B

$B1s3V8F$S=P$7$5$l$k=R8l$rFCDj$G$-$k>l9g!"(B
\verb!generic:call/N! $B$K$h$k%a%?%4!<%k<B9T$OITMW$G$"$k!#(B
$B%a%?%4!<%k$r<u?.$7$?$H$-$K=R8l$r8F=P$9%4!<%k$r!"(B
$B@EE*$KaA$1$P$h$$!#(B
$B%9%1%k%H%s$O0J2<$N$h$&$K$J$k!#(B

{\crush
\begin{boxedverbatim}
skeleton(Call, Socket) :- Call = (modu:pred(X,..)) |
  modu:pred(X,..),  %%% <-- static call
  Socket = [bound(Here) | Socket1],
  send(Here, Socket1).
\end{boxedverbatim}
}

%---------------------------------------------------------------
\section{ $BL$Dj5AJQ?tI=$N@0Ns(B }

$BL$Dj5AJQ?tI=$N<BAu$G$O<j$rH4$$$F@0Ns$r9T$o$J$$$3$H$K$7$?$,!"(B
$B$d$O$j@0Ns$K$h$C$FBg$-$/@-G=$,>e$,$k2DG=@-$,$"$k!#(B
$B<BAuJ}<0$N0c$$$K$h$kHf3SDjNL<B83$O:#8e$N2]Bj$G$"$k!#(B

%---------------------------------------------------------------
\section{ $BJQ?tI=$NJBNs2=(B }

$BJQ?tI=$NJBNsA`:n$O:#8e$N2]Bj$G$"$k!#(B
$BJQ?tI=$rJBNsA`:n$G$-$J$1$l$P%=%1%C%HDL?.$NHsF14|2=$OFq$7$$!#(B
$B8=9T$N=hM}7O$G$OJBNs2=$NI,MW$O$J$$$N$@$,!"(B
$BJBNsA`:n$G$-$J$$8@8l5!G=$O!"JBNs8@8l$H$7$F$N(BKL1$B$NMxE@$r;&$7$F$7$^$&!#(B

$BK\=hM}7O$,:N$C$?F0E*JQ?tL>@8@.$K$h$C$F!"(B
$BJQ?tI=$OJQ?t$NB+G{$,7hDjE*(B (deterministic) $B$G$"$k$H$$$&(B
$BK>$^$7$$C10lBeF~@-$r;}$A!"JBNs2=$N$?$a$N2r@O$K8~$$$F$$$k$H;W$o$l$k!#(B
$B$7$+$7!"@EE*2r@O$rF3F~$9$k$3$H$K$h$C$F!"JQ?tI=$,ITMW$K$J$k$+$b$7$l$J$$$7!"(B
$B5U$KC10lBeF~@-$r<:$C$F$7$^$&$+$b$7$l$J$$!#(B

$BJQ?tI=$N%G!<%?7?$r%j%9%H$+$i%Y%/%?$KJQ$($k$@$1$G!"(B
$BJBNsA`:n$N2DG=@-$,8+$($k$+$b$7$l$J$$!#(B

%---------------------------------------------------------------
\section{ $B$=$NB>$N1s$$L\I8(B }

$BMW5a$K1~$8$?6qBN2=%4!<%k$NDL?.$,$G$-$k$HNI$$!#(B
dKLIC$B$G$OJQ?t$N6qBN2=$r(Beager$B$KDL?.$7$F$$$k$,!"(B
$B$3$l$G$O%N!<%I$NF)L@@-$H$$$&!"JB9T8@8l$H$7$F$N(BKL1$B$NMxE@$r;&$7$F$7$^$&!#(B
lazy$B$K%*%s%G%^%s%I$GJQ?t$N6qBN2=$rDL?.$G$-$l$P!"(B
$BDL?.NL$,8:$j!"=hM}$,B.$/$J$k2DG=@-$,$"$k!#(B

$B1s3V%W%m%;%9$N<1JL$,$G$-$k$HNI$$!#(B
$B8=:_$N(BdKL1$B$G$O!"87L)$K$O%5!<%P$r=q$/$3$H$,$G$-$:!"(B
$B%5!<%P$H$7$FF/$/=R8l$r=q$/$3$H$,$G$-$k$@$1$G$"$k!#(B
ftpd$B$d(Btelnetd$B$N$h$&$J>o;~BT5!$9$k%5!<%P$r=q$/$?$a$K$O!"(B
$B%/%i%$%"%s%H$,%5!<%P%W%m%;%9$r<1JL$7DL?.$G$-$J$1$l$P$J$i$J$$!#(B
KL1j \cite{Igarashi} $B$G$O!"%9%H%j!<%`$NL>A0IU$15!G=$rDs>'$7$F$$$k!#(B
$B$3$l$K$h$C$F!"B?BPB?$NJ,;6=hM}$r5-=R$9$k$3$H$,$G$-$k$h$&$K$J$k!#(B

$B0J>e$GK\O@$r=*$($k!#(B

%---------------------------------------------------------------
\chapter*{ $B<U<-(B }
\addcontentsline{toc}{chapter}{$B<U<-(B}

$BO@J8$N=q$-J}$rCzG+$K;XF3$7$F2<$5$$$^$7$?>eEDOB5*@h@8!"(B
$BLLGr$$8&5f$N<o$r2<$5$$$^$7$?8^==Mr9(;a$K46<UCW$7$^$9!#(B

$BJ,$C$F$$$k$D$b$j$@$,0U<1$7$F$$$J$+$C$?JQ?t$N@8@.$K$D$$$F!"(B
$BE*3N$J=u8@$rD:$-$^$7$?2CF#5*IW;a$K46<UCW$7$^$9!#(B

$B:G8e$K!"(BKLIC$B:n@.%0%k!<%W$NJ}!9$K46<UCW$7$^$9!#(B
KLIC$B$GJQ?t$N<1JL$,2DG=$G$"$l$P!"(B
dKLIC$B$N<B8=$O4VC1$9$.$FO@J8$K$J$i$J$+$C$?$G$7$g$&!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{thebibliography}{99} \label{bib}
\addcontentsline{toc}{chapter}{$B;29MJ88%(B}

\bibitem{GHC:LPC85}
Ueda, K., Guarded Horn Clauses.  ICOT Tech.\ Report TR-103, ICOT,
Tokyo, 1985.  Also in {\sl Logic Programming '85}, 
Wada, E.\ (ed.), LNCS 221, Springer-Verlag, Berlin, 1986, pp.~168--179.

\bibitem{GHCKL1:CompJ}
Ueda, K. and Chikayama, T. Design of the Kernel
Language for the Parallel Inference Machine.  {\sl The Computer
Journal}, Vol.~33, No.~6 (1990), pp.~494--500.

\bibitem{KLIC:PLILP94}
Chikayama, T., Fujise, T. and Sekita, D., A Portable and
Efficient Implementation of KL1.  In {\sl Proc.\ 6th Int.\ Symp.\ on
Programming Language Implementation and Logic Programming (PLILP'94)},
LNCS 844, Springer-Verlag, Berlin, 1994, pp.~25--39.

\bibitem{CCPL}
Kazunori Ueda, Concurrent Logic/Constraint Programming: The Next 
10 Years. In The Logic Programming Paradigm: A 25-Year
Perspective, K. R. Apt, V. W. Marek, M. Truszczynski, and
D. S. Warren (eds.), Springer-Verlag, 1999, pp.53-71.

\bibitem{GHC}
$BJ%0lGn(B $B4F=$(B, $B8E@n9/0l(B $B9B8}J8M:(B $B6&JT(B, $B8E@n9/0l(B $BC]Fb>40l(B $B>eEDOB5*(B $BB>(B $B6&Cx(B:
``$BJBNsO@M}7?8@8l(BGHC$B$H$=$N1~MQ(B'', $B6&N)=PHG(B, 1987,
ISBN4-320-02266-1.

\bibitem{text}
KLIC$B9V=,2q%F%-%9%H(B ``KLIC$B%7%9%F%`JT(B'', ``KL1$B8@8lJT(B'',
$B?7@$Be%3%s%T%e!<%?5;=Q3+H/5!9=!JJ?@.(B5$BG/!K(B,
$BF|K\>pJs=hM}3+H/6(2q3+H/8&5f<<!JJ?@.(B7$BG/!K(B.

\bibitem{icot}
ICOT: URL~\verb!"http://www.icot.or.jp/"!.

\bibitem{klic}
KLIC$B:n@.%0%k!<%W(B:
KLIC-3.003, 1999,
URL~\verb!"http://www.klic.org/"!.

\bibitem{info}
KLIC$B:n@.%0%k!<%W(B:
KLIC$BE:IU$N%^%K%e%"%k(B ``KLIC.info''.

\bibitem{inside}
$B4XEDBg8c(B:
``Inside KLIC Version 1.0'', 1998.

\bibitem{Satoshi}
$BAR;}Ao(B: $BAa0pEDBg3XM}9)3X8&5f2J>pJs3X=$;NO@J8(B
``KLIJava: KL1$B$+$i(BJava$B$X$N%3%s%Q%$%i$*$h$S<B9T4D6-(B'', 1999,
\\URL~\verb!"http://www.ueda.info.waseda.ac.jp/~satoshi/klijava/"!.

\bibitem{Igarashi}
$B8^==Mr9((B: $BAa0pEDBg3XM}9)3XIt>pJs3X2JB46HO@J8(B
``$BJ,;6(BKL1$B8@8l=hM}7O$N@_7W$H<BAu(B'', 1999,
\\URL~\verb!"http://www.ueda.info.waseda.ac.jp/~igarashi/"!.

\bibitem{Prolog}
P.~Deransart, A.~Ed-Dbali, L.~Cervoni:
``Prolog: The Standard'' Reference Manual, Springer-Verlag, 1996,
ISBN~3-540-59304-7.

\bibitem{Appel}
Andrew W. Appel with Maia Ginsburg:
``Modern Compiler Implementation in C'',
Cambridge University Press, 1998.

\end{thebibliography}

%---------------------------------------------------------------
\listoffigures
\addcontentsline{toc}{chapter}{$B?^L\<!(B}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\appendix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{ $B<B9T;~%i%$%V%i%j(B } \label{runtime}

$BK\>O$G$O!"(BdKLIC$B=hM}7O$N$&$A<BAu$,?J$s$@<B9T;~%i%$%V%i%j$r<($9!#(B
$B>\:Y$K$D$$$F$O!"Bh(B\ref{implement}$B>O$r;2>H$;$h!#(B

\prog{type}
% \prog{typetest}

\prog{vartab}
% \prog{vartest}

\prog{vsock}
% \prog{vsockcli}
% \prog{vsocksrv}

%---------------------------------------------------------------
\chapter{ $B%W%m%0%i%`Nc(B } \label{sample}

$BK\>O$G$O!"(BdKLIC$B$N=PNO$9$k(BKLIC/KL1$B%W%m%0%i%`$NNc$r<($9!#(B
$B>\:Y$K$D$$$F$O!"Bh(B\ref{analysis:append}$B@a$r;2>H$;$h!#(B

\prog{appcli}
\prog{appsrv}

%---------------------------------------------------------------
\chapter{ $B<B83(B } \label{test}

$BK\>O$G$O!"(BdKLIC$B<BAu$N$?$a$K9T$o$l$?(B
$BM=Hw<B83$N%W%m%0%i%`$H!"$=$N<B9T7k2L$r<($9!#(B
$B<B83$N>\:Y$K$D$$$F$O!"Bh(B\ref{experiment}$B>O$r;2>H$;$h!#(B

\section{ $BJQ?t$N<1JL(B  } \label{test:guvars}
\comp{test/guvars.kl1}

\subsection{ $B<B9T7k2L(B }
\comp{test/guvars.log}
\clearpage

\section{ $B%a%?(BKL1$B9`(B } \label{test:wterm}
\comp{test/wterm.kl1}

\subsection{ $B<B9TNc(B }
\comp{test/wterm.log}
\clearpage

%---------------------------------------------------------------
\section{ \cliser }  \label{cliser}
\subsection{ $B%/%i%$%"%s%H(B }  \comp{test/client.kl1}
\subsection{ $B%5!<%P(B       }  \comp{test/server.kl1}
\clearpage

\section{ $B1s3V%4!<%k<B9T(B } \label{test:rcall}
\comp{test/rcall.kl1}

\subsection{ $B<B9T7k2L(B }
\comp{test/rcall.log}
\clearpage

\end{document}
