\documentclass[12pt]{jreport}

\usepackage[dvips]{graphics}
\usepackage{moreverb}

\setlength{\topmargin}{0cm}
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{22.5cm}
\setlength{\oddsidemargin}{0.75cm}

\newcommand{\Tab}{ \hspace{1em} }
\newcommand{\If}{ {\Tab \makebox{if} \;} }
\newcommand{\Where}{ {\Tab \makebox{where} \;} }

\newcommand{\Def}{ _{\makebox{\tiny def}} }

\newcommand{\term}[1]{\emph{#1}}
\newcommand{\crush}{\renewcommand{\baselinestretch}{0.8}}
\newcommand{\prog}[1]
  {{\crush \setlength{\oddsidemargin}{0cm} \listinginput{1}{#1}}}

\newcommand{\fig}[1]{\begin{center}\includegraphics{fig/#1.eps}\end{center}}
\newcommand{\figu}[2]
  {\vspace{1em}\scalebox{#1}{\includegraphics{ohp/#2.eps}}}

\begin{document}

\begin{titlepage}
\begin{center}
\vspace*{1cm}
\begin{large}
 2001$BG/EY(B $B=$;NO@J8(B \\
\end{large}
\vspace{2cm}
\begin{Huge}
 DKLIC $B=hM}7O$K$*$1$kJ,;6O@M}JQ?t$N;q8;4IM}(B \\
\end{Huge}
\begin{Large}
 Resource Management for Distributed Logic Variables of DKLIC \\
\end{Large}
\vspace{4cm}
\begin{Large}
 $BDs=PF|(B: 2002$BG/(B2$B7n(B5$BF|(B \\
 $B;XF3(B: $B>eED(B $BOB5*(B $B65<x(B \\
\vspace{3cm}
 $BAa0pEDBg3XBg3X1!(B $BM}9)3X8&5f2J(B $B>pJs2J3X@l96(B \\
 $B3X@RHV9f(B: 600P031-4 \\
\vspace{1cm}
 $B9bLZ(B $BM42p(B \\
\end{Large}
\end{center}
\end{titlepage}

\clearpage
\pagestyle{plain}
\pagenumbering{roman}
\tableofcontents
\listoffigures
% \listoftables

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newpage
\pagenumbering{arabic}

% $BLdBjNN0h$NFCDj(B
% $BJ,@O(B
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h(B\ref{eval}$B>O$G!"(BDKLIC $B$rI>2A$7!"9M;!$r2C$($k!#(B

$BBh(B\ref{conc}$B>O$G!"K\O@J8$r$^$H$a$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $BJ,;6%W%m%0%i%_%s%0(B
% $BLdBjNN0h$NFCDj(B

\chapter{ $BJ,;6%W%m%0%i%_%s%0$N8=>u$HLdBjE@(B \Comment{(Problem)} }
\label{dist}

$BK\>O$G$O!"J,;6%W%m%0%i%_%s%0$H(B
$B$=$N$?$a$N4D6-!"5!9=!"%D!<%k!"8@8l$K$D$$$F=R$Y$k!#(B

% \vspace{1em}

% $B%M%C%H%o!<%/F)2a@-$,IT==J,$JM}M3$r6qBNE*$K(B!

$BJ#?t$N%W%m%;%9$,6(D4=hM}$r9T$&J,;6%"%W%j%1!<%7%g%s$N3+H/$O!"(B
$BC`<!%"%W%j%1!<%7%g%s$N3+H/$KHf$Y$FHs>o$KFq$7$$!#(B
%
$B4{$KIa5Z$7$F$$$k<jB3$-7?8@8l$NJ,;63HD%$G$O(B
$B%M%C%H%o!<%/F)2a@-$,IT==J,$G$"$k$?$a!"%W%m%0%i%^$O(B
$BC`<!%"%W%j%1!<%7%g%s$rC1=c$KJ,;63HD%$9$k$3$H$,$G$-$J$$!#(B

$BBh(B\ref{processes}$B@a!"Bh(B\ref{sockets}$B@a!"Bh(B\ref{RPC}$B@a!"Bh(B\ref{ORB}$B@a!"(B
$BBh(B\ref{agents}$B@a$G!"4{B8$NJ,;6%W%m%0%i%_%s%05!9=$r5s$2$k!#(B

%---------------------------------------------------------------

\section{ $B%W%m%;%9(B (Processes) }
\label{processes}

% $B%^%k%A%?%9%/(B
$B%^%k%A%W%m%;%9$H$O!";~J,3d%7%9%F%`(B (Time Sharing System)
$B$H8F$P$l$k<oN`$N%*%Z%l!<%F%#%s%0%7%9%F%`$K$h$C$FF3F~$5$l$?5!9=$G$"$k(B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f$,(B goto $B$G%7%_%e%l!<%H$G$-$k$h$&$K!"(B
$B%W%m%;%9$NJ,;6$O(B fork $B$G%7%_%e%l!<%H$9$k$3$H$,$G$-$k!#(B}

%---------------------------------------------------------------

\section{ $B%=%1%C%H(B (Sockets) }
\label{sockets}

$BJ#?t$N%W%m%;%9$ODL?.$K$h$C$FF14|$7$J$,$i6(D4=hM}$r9T$&!#(B
%
$BNc$($P!"(BWeb $B$G=&$C$?J8=q$rO@J8Cf$G0zMQ$9$k;~!"(B
Web $B%V%i%&%6$HJ8=q:n@.%=%U%H4V$G%G!<%?$rDL?.$9$k$3$H$,$G$-$l$P!"(B
$BF1$8FbMF$r%f!<%6$,BG$A9~$_D>$9I,MW$O$J$$!#(B

% IPC (Inter Process Communication)
% $B%7%0%J%k(B

Unix $B%*%Z%l!<%F%#%s%0%7%9%F%`$G$O!"(B
$B%W%m%;%94VDL?.$O%U%!%$%k!"%Q%$%W$J$I(B
\term{$B%9%H%j!<%`(B (stream)}$B$H8F$P$l$k%$%s%?%U%'%$%9$r2p$7$F9T$o$l$k!#(B
%
\Comment
{$BF~=PNOAuCV$b$^$?!"%U%!%$%k%7%9%F%`Fb$GI=8=$5$l$F$*$j!"(B
 $B%9%H%j!<%`$H$7$F%"%/%;%9$5$l$k!#(B}
%
$B$9$J$o$A!"(B
% $B%f!<%6$bJB9T%W%m%;%9$N0l<o$G$"$k$H9M$($k$H!"$"$i$f$k(B
$B%W%m%;%9$NF~=PNO$O%9%H%j!<%`$N%$%s%?%U%'%$%9$rM?$($i$l$F$$$k!#(B

% $BJB9T%W%m%;%9!"%9%H%j!<%`!"F14|!&HsF14|%a%C%;!<%8DL?.!"8N>c8!=P(B
% TCP/IP, C/S, $B%=%1%C%H(B, $B%[%9%H!"%m!<%+%k!"1s3V(B

\term{$B%=%1%C%H(B}$B$O%W%m%;%94VDL?.$KMQ$$$i$l$k%9%H%j!<%`$N0l<o$G$"$k!#(B
%
$B%5!<%S%9$rMW5a$9$k%/%i%$%"%s%H$H%5!<%S%9$rDs6!$9$k%5!<%P$+$i@.$k!"(B
$B%/%i%$%"%s%H(B/$B%5!<%P%b%G%k$K4p$E$$$F$$$k!#(B

$B%Q%$%W$O6&DL$N?F%W%m%;%9$r;}$D%W%m%;%94V$NDL?.$K$N$_MQ$$$i$l$k$,!"(B
$B%=%1%C%H$O%/%i%$%"%s%H$,%[%9%H$H%]!<%HHV9f$K$h$C$F(B
$B%5!<%P$r;XL>$9$k$3$H$K$h$C$F@\B3$r3NN)$9$k!#(B
%
$B%[%9%H$r;XDj$9$k$3$H$+$iJ,$+$k$h$&$K!"(B
$B%5!<%P%W%m%;%9$O%m!<%+%k%[%9%HFb$K$"$kI,MW$O$J$/!"(B
$B1s3V%[%9%HFb$K$"$C$F$bNI$$!#(B

$B%=%1%C%H$O(B BSD Unix $B$KM3Mh$9$k$,!"(B
C $B8@8l$N%=%1%C%H%$%s%?%U%'%$%9$O(B
System V $B7O(B Unix $B$d(B Windows $B$X$b0\?"$5$l$?!#(B
%
Java $B$G$O%=%1%C%H%$%s%?%U%'%$%9$,8@8l%l%Y%k$GDj5A$5$l$F$$$k!#(B

$BNc$($P!"(BWnn $B$J$I$N4A;zJQ49%5!<%P$O%=%1%C%H$rDL$8$F@\B3$5$l$?(B
$BF|K\8lF~NO%U%m%s%H%(%s%I$KBP$7$F%5!<%S%9$rDs6!$9$k!#(B

$B$^$?Nc$($P!"(BX Window System $B$N%5!<%P$O(B GUI $B%(%s%8%s$G$"$j!"(B
X $B$r1~MQ$9$k%/%i%$%"%s%H72$N0MMj$K1~$8$F(B GUI $B$r@8@.$9$k!#(B

$BB>$K$b!"(B
FTP (File Transfer Protocol),
SMTP (Simple Mail Transfer Protocol),
HTTP (Hyper Text Transfer Protocol)
$B$J$IB?$/$N%W%m%H%3%k$,%=%1%C%H$r1~MQ$7$F$$$k!#(B

% LDAP (Lightweight Directory Access Protocol)

%---------------------------------------------------------------

\section{ RPC (Remote Procedure Call) }
\label{RPC}

RPC $B$d(B Java RMI $B$O!"(B
$B<jB3$-$d4X?t$r8F$S=P$97A<0$G1s3V$N%5!<%S%9$r<u$1$k5!9=$G$"$k!#(B
%
$B%=%1%C%H$X$NF~NO$,<jB3$-!&4X?t8F=P$7$N0z?t$H$7$F!"(B
$B%=%1%C%H$+$i$N=PNO$,4X?t$N7k2L$H$7$F!"F)L@2=$5$l$k!#(B

$B$3$l$i$N5!9=$O4pK\E*$KC`<!=hM}$r9T$&<jB3$-7?8@8l$K4p$E$$$F$$$k$?$a!"(B
$BHsF14|DL?.$HJB9T=hM}$r5-=R$9$k$N$OHs>o$KFq$7$$!#(B
%
\cite{Sun} $B$O!"(B
$BJ,;67O$K$O!"C`<!7O$K$J$$DL?.CY1d!"%a%b%j%b%G%k!"JB9T@-!"(B
$BItJ,E*$J8N>c$,$"$k$?$a!"J,;6%*%V%8%'%/%H$rC`<!%*%V%8%'%/%H$H(B
$BF1MM$K07$&$3$H$O$G$-$J$$$H<gD%$7$F$$$k!#(B

NIS (Network Information Service),
NFS (Network File System)
$B$O(B RPC $B$r1~MQ$7$F$$$k!#(B

%---------------------------------------------------------------

\section{ ORB (Object Request Broker) }
\label{ORB}

CORBA (Common ORB Architecture) $B$d(B Jini $B$OJ,;6%*%V%8%'%/%H$r4IM}$7!"(B
$B1s3V$N%5!<%S%9!J%*%V%8%'%/%H!K$KBP$9$kMW5a$rCg2p$9$k5!9=$G$"$k!#(B
%
$B%*%V%8%'%/%H;X8~$K$*$1$k%*%V%8%'%/%H$H$O>uBV$r;}$C$?(B
$B7W;;C10L$G$"$j!"%W%m%;%9$K;w$?35G0$G$"$k!#(B

RPC $B$H$NK\<AE*$J:9$O!"(B
$BJ,;6%*%V%8%'%/%H$NEPO?!&8!:w(B (Name Service) $B$K$h$k(B
capability $B$N<hF@$K$"$k!#(B
%
$B$9$J$o$A!"%/%i%$%"%s%H$O%5!<%P$,$I$N%[%9%H$K$"$k$+(B
$B$J$I$N0LCV>pJs$d%5!<%P$X$N%"%/%;%98"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$+$rCN$C$F$$$kI,MW$O$J$$!#(B
%
Gnutella $B%f!<%6$,K>$_$N%U%!%$%kL>$r;XDj$9$k$@$1$G!"(B
$B8!:w%5!<%P$,$=$N%U%!%$%k$r;}$D%[%9%H$r8!:w$7!"(B
$B<+F0E*$K%U%!%$%k$r%@%&%s%m!<%I$7$F$/$l$k!#(B

%---------------------------------------------------------------

\section{ Mobile Agents }
\label{agents}

$B%b%P%$%k%(!<%8%'%s%H(B (Mobile Agents) $B$"$k$$$OC1$K%(!<%8%'%s%H$O!"(B
$B<B9T>uBV$r4^$`%W%m%;%9$N0\F0$K$h$C$FDL?.$rF)L@2=$9$k5!9=$G$"$k!#(B
%
RPC $B$d(B ORB $B$H$N:9$O!"(B
$BDL?.$5$l$k%a%C%;!<%8$,C1$J$k%G!<%?$G$O$J$/(B
$B<+N'E*$K7W;;!&0\F0$r9T$&%W%m%;%9$G$"$kE@$K$"$k!#(B

Java Bytecode, Macromedia Flash, Dynamic HTML
$B$J$I$,Hs>o$K5!G=$N@)8B$5$l$?%(!<%8%'%s%H$G$"$k$H9M$($k$H!"(B
$B$=$l$i$rMxMQ$9$k%*%s%i%$%s%7%g%C%T%s%0$O%(!<%8%'%s%H$N1~MQ$G$"$k!#(B

$B$^$?!"(BWeb $B>e$GE}7W$d8!:w$N$?$a$N>pJs$r<+N'E*$K<}=8$9$k(B
Web Robots $B$O@5$K%(!<%8%'%s%H$G$"$k!#(B

\vspace{1em}

$B0J>e$G!"%W%m%;%9!"%W%m%;%94VDL?.!"(BRPC$B!"(BORB$B!"%(!<%8%'%s%H$K$D$$$F=R$Y$?!#(B
$B$3$l$i4{B8$NJ,;6%W%m%0%i%_%s%05!9=$O(B
C $B$d(B Java $B$J$I$N<jB3$-7?8@8l$K4p$E$$$F$*$j!"(B
$BJB9T=hM}$dHsF14|%a%C%;!<%8DL?.$N5-=R$OFq$7$$!#(B

$B<!$K!"J,;6%W%m%0%i%_%s%0$KFCD'E*$J$$$/$D$+$NLdBjNN0h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
$B%W%m%0%i%^$OCm0U$7$J$1$l$P$J$i$J$$!#(B

% $BJBNs!"9-0hJ,;6(B

%---------------------------------------------------------------

\section{ $BL5;k$G$-$J$$CY1d;~4V(B (Latency) }

$BJ,;64D6-$K$*$$$F$O!"7W;;5!FbIt$N5-21AuCV$K(B
$BHf3S$7$F?t@iG\!"?tK|G\$NDL?.CY1d$,5/$-$k!#(B

$B1R@1$rDL$8$FCO5e$NH?BPB&$HDL?.$9$k$3$H$b$"$k$G$"$m$&!#(B
%
$BDL?.<jCJ$,8wB.EY$r1[$($J$$8B$j!"(B
$BJ*M}E*$K5wN%$N1s$$J,;6DL?.$OHs>o$KBg$-$JCY1d;~4V$rH<$&!#(B

$B0lHL$K!"J,;6DL?.$NCY1d;~4V$O(B
$BL5;k$G$-$J$$DxEY$KBg$-$$$H9M$($k$Y$-$G$"$k!#(B

%---------------------------------------------------------------

\Comment{
\section{ Open Computing }

$B%$%s%?!<%M%C%H(B

$BMM!9$J5!3#$d%*%Z%l!<%F%#%s%0%7%9%F%`$+$i@.$k(B
$B%X%F%m$J%M%C%H%o!<%/4D6-(B

inter-operability

$B%*!<%W%s$J%W%m%H%3%k(B

$BIUO?(B\ref{XML}
}  % end Comment

%---------------------------------------------------------------

\section{ $BItJ,E*$J8N>c(B (Fault Tolerance) }

$BJ,;64D6-$K$*$$$F$O!"HsJ,;64D6-$KHf3S$7$F(B
$B%7%9%F%`$N0lIt$,8N>c$9$k$3$H$,B?$$!#(B
%
$BNc$($P!"%$!<%5%M%C%H%1!<%V%k$K$D$^$:$$$FCG@~$9$k$3$H$O(B
$B%^%6!<%\!<%I$N4pHW>e$NG[@~$,CG@~$9$k$3$H$h$j$bB?$$$G$"$m$&!#(B

$B$^$?Nc$($P!"%W%m%P%$%@$rDL$8$F%$%s%?!<%M%C%H$K@\B3$5$l$?(B
$B>.5,LO$N(B LAN $B$OFH<+$N(B DNS $B%5!<%P$r2TF/$7$F$$$J$$$3$H$,(B
$BB?$$$G$"$m$&$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1 $B8@8l$H4{B8$N(B KL1 $B8@8l=hM}7O$K$D$$$F=R$Y$k!#(B

%---------------------------------------------------------------

\section{ KL1 $B8@8l$H$O(B }

\Comment{
KL1 $B8@8l$H$O!"(B
CLP (Concurrent Logic Programming),
CCP (Concurrent Constraint Programming),
CBC (Constraint-based Concurrency)
$B$J$I$H8F$P$l$k%W%m%0%i%_%s%0%Q%i%@%$%`$K4p$E$/(B
$B8@8l!J7W;;%b%G%k!KB2$N$&$A$G!":G$bC1=c$J$b$N$G$"$k!#(B
} % Comment

KL1 $B8@8l$O:G$bC1=c$JJB9TO@M}7?8@8l$N0l$D$G$"$k!#(B
%
$B=R8l8F$S=P$7$K$h$C$FJB9T%W%m%;%9$rF0E*@8@.$7!"(B
$BO@M}JQ?t$rDL?.O)$H$7$FHsF14|%W%m%;%94VDL?.$r9T$&!#(B
%
$BO@M}JQ?t$r4^$`%a%C%;!<%8$rDL?.O)$KN.$9$3$H$K$h$C$F!"(B
$BO@M}%M%C%H%o!<%/$rF0E*9=@.$9$k$3$H$,$G$-$k!#(B

$B%f!<%6$d1s3V%W%m%;%9$b$^$?!"JB9T%W%m%;%9$N0l<o$G$"$k$H9M$($i$l$k!#(B
%
$B=>$C$F!"JB9T%W%m%;%9$HHsF14|%W%m%;%94VDL?.$rMQ$$$k(B
KL1 $B8@8l$N%W%m%0%i%_%s%0%9%?%$%k$O!"(B
$BJ,;6%W%m%;%9$K$h$k6(D4=hM}$N5-=R$KE,$7$F$$$k$H8@$($k!#(B

%---------------------------------------------------------------

\section{ KL1 $B8@8l$N35MW(B \Comment{Syntax, Semantics} }

\newcommand{\var}[1]{{\it #1}}
\newcommand{\Head}{\var{Head}}
\newcommand{\Guard}{\var{Guard}}
\newcommand{\Body}{\var{Body}}

KL1 $B%W%m%0%i%`$O=R8l$N=89g$+$i@.$j!"(B
\term{$B=R8l(B (predicate)} $B$O@a$N=89g$+$i@.$k!#(B
\term{$B@a(B (clause)} $B$O<!$N$h$&$J7A$r$7$F$$$k!#(B
\begin{quote}
{\Head} :- {\Guard} \(|\) {\Body} .
\end{quote}
$B$3$3$G!"(B\Head $B$O0l3,=R8lO@M}$N86;RO@M}<0$G$"$j!"(B
\Guard $B$H(B \Body $B$O86;RO@M}<0$N%^%k%A=89g$G$"$k!#(B
\Head $B$H(B \Guard $B$O$=$N@a$,<B9T$5$l$k$?$a$N>r7o$rI=$7!"(B
\Body $BFb$N86;RO@M}<0$O(B\term{$B=R8l8F=P$7(B}$B!"(B
$B$9$J$o$A(B\term{$B%4!<%k(B (goal)}$B$rI=$9!#(B

$BNc$($P!"6d9T8}:B$rI=$9=R8l$O<!$N$h$&$K=q$1$k!#(B
\begin{verbatim}
account(Request, State) :- Request = [balance(Balance)|Request1] |
  Balance := State,
  account(Request1, State).
account(Request, State) :- Request = [exchange(Amount)|Request1] |
  State1 := State + Amount,
  account(Request1, State1).
\end{verbatim}

$B$3$N=R8l$O(B account $B$H$$$&L>A0$r;}$A!"(B
$B0z?t$N8D?t(B (arity) $B$,Fs$D$G$"$k$?$a!"(B
account/2 $B=R8l$H8F$P$l$k!#(B

State $B$O8}:B$N;D9b$rI=$9!#(B
%
$B$3$N8}:B$KBP$9$k=hM}MW5a$O(B Request $B$X(B
$B%a%C%;!<%8$r=q$-9~$`$3$H$K$h$C$FI=8=$9$k!#(B
%
$BNc$($P!"(Bbalance/1 $B%a%C%;!<%8$O8=:_$N;D9b$r;2>H$9$k!#(B
$B0z?t(B Balance $B$K8=:_$N;D9b$,JV$5$l$k!#(B
%
$B$^$?!"(Bexchange/1 $B%a%C%;!<%8$O$3$N8}:B$KBP$7$F(B
Amount $B1_$N?6$j9~$_!JIi?t$J$i0z$-=P$7!K$r9T$&!#(B

exchange/1 $B%a%C%;!<%8$N=hM}$,Bh(B\ref{dist}$B>O$N(B
$BIT2DJ,$J?6$j9~$_!&0z$-=P$7=hM}$KAjEv$9$k$3$H$KCm0U$;$h!#(B
%
balance/1 $B%a%C%;!<%8$N=hM}$OIT2DJ,$J?6$j9~$_!&0z$-=P$7(B
$B=hM}$N0lIt$G$"$kFI$_9~$_A`:n$N$_$r9T$&$h$&$J=hM}$G$"$k!#(B

%---------------------------------------------------------------

\section{ $B8@8l3K$KAH$_9~$^$l$?F14|$H<+F0GSB>@)8f(B }

account/2 $B=R8l$N?6$j9~$_=hM}$O!"<jB3$-7?$N%W%m%0%i%`$N$h$&$K(B
$B;D9b$rI=$9JQ?t(B State $B$rD>@\=q$-49$($kBe$o$j$K!"(B
$B=q$-49$(8e$N;D9b$rI=$9JQ?t(B State1 $B$rF3F~$7$F$$$k!#(B
%
$B0lHL$K!"(B\term{$BC10lBeF~JQ?t(B}$B$r;}$D=c4X?t7?8@8l$d(B
$BO@M}7?8@8l$G>uBV$r=q$-49$($k;~$K$O!"(B
$B$3$N$h$&$K<!>uBVJQ?t$rF3F~$9$k!#(B

% continuation
State $B$N3F>uBV$O8}:B;D9b$NMzNr$G$"$j!"(B
Request $B$O8}:B$KBP$9$kA`:n$NMzNr(B (journal)
$B$G$"$k$H9M$($k$3$H$,$G$-$k!#(B

KL1 $B8@8l$G$O!"A4$F$N%4!<%k$OJB9T$K<B9T$5$l$k$,!"(B
\Head $B$d(B \Guard $B$GL$Dj5AJQ?t$N6qBNCM$rFI$_9~$`$H!"(B
$B$=$N@a$N<B9T$O6qBNCM$,7hDj$9$k$^$GCfCG$9$k$3$H$K$J$C$F$$$k!#(B

$BNc$($P!"(B
\begin{verbatim}
  State1 := State + Amount,
\end{verbatim}
$B$,<B9T$5$l$k$^$G(B State1 $B$N6qBNCM$O7hDj$5$l$J$$!#(B
%
$B=>$C$F!"(Bexchange/1 $B%a%C%;!<%8$ND>8e$KB>$N%a%C%;!<%8$,E~C#$7$F$b!"(B
exchange/1 $B%a%C%;!<%8$N=hM}$r=*$($J$1$l$P(B
$BD>8e$N%a%C%;!<%8$N=hM}$O;O$^$i$J$$!#(B
%
$B0lJ}!"(Bbalance/1 $B%a%C%;!<%8$O;D9b$r=q$-49$($J$$$N$G!"(B
balance/1 $B%a%C%;!<%8$H$=$ND>8e$N%a%C%;!<%8$OJB9T$K=hM}$5$l$k!#(B

Java $B8@8l$G$O!"6&M-%G!<%?$KBP$9$kIT2DJ,$J=hM}$r(B
synchronized $B%V%m%C%/$G0O$`$3$H$K$h$C$FGSB>@)8f$r9T$&!#(B
%
$B$3$N$h$&$J<jB3$-7?8@8l$K$h$kJ,;6%W%m%0%i%_%s%0$O!"(B
$BIT2DJ,$J=hM}$r8+8m$k$3$H$K$h$C$FIT@5$J=hM}$r9T$&4m81$,$"$k!#(B

$B0lJ}!"(B
KL1 $B8@8l$K$*$$$FIT@5$JJB9T=hM}$r9T$&%W%m%0%i%`$O(B
$B$[$H$s$I$N>l9g!"(BState $B$H(B State1 $B$r<h$j0c$($k$J$I$7$F(B
$BJQ?t$r=q$-8m$C$?$b$N$G$"$k!#(B
%
KL1 $B8@8l$G$O@EE*2r@O$N5;=Q$,Hs>o$KH/C#$7$F$*$j!"(B
Kima \cite{Kima} $B$H$$$&2r@O7O$O(B
$B$3$N$h$&$JJQ?t$N=q$-8m$j$r<+F0E*$K8!=P$7!"(B
$B=$@50F$rDs<($9$k$3$H$,$G$-$k!#(B

% merge

$B$^$?!"4{$K6qBNCM$N7hDj$7$?C10lBeF~JQ?t$KBP$7$F(B
$B0[$J$k6qBNCM$r=q$-9~$b$&$H$9$k$H<:GT(B (unification failure) $B$,5/$-$k!#(B
%
$B$3$N$h$&$JF0E*$J<:GT$O!"8m$C$?%W%m%0%i%`$,Dd;_$9$k(B
$B$H$$$&:G0-$N>l9g$NJ]>Z$G$"$C$F!"(B
$B%W%m%0%i%^$O$3$l$KMj$k$Y$-$G$O$J$$!#(B
%
\ref{type-mode}$B$G=R$Y$k%b!<%IIU$1$K$h$C$F(B
$B@EE*$JGSB>@)8f$r9T$&$Y$-$G$"$k!#(B

%---------------------------------------------------------------

\section{ $BDL?.O)(B (Channels) }

KL1 $B8@8l$NJQ?t$OC10lBeF~$G$"$k$@$1$G$J$/!"(B
first-class $B$N(B\term{$BO@M}JQ?t(B}$B$G$"$k!#(B
%
$B$9$J$o$A!"O@M}JQ?t$O6qBNCM$N7hDj$7$F$$$J$$L$Dj5A>uBV$N$^$^!"(B
\term{$B9`(B (term)}$B$H8F$P$l$k(B KL1 $B8@8l$N(B
$B%G!<%?I=8=LZ$N0lIt$H$7$FB>$N%W%m%;%9$KEO$9$3$H$,$G$-$k!#(B

$BNc$($P!"(Bbalance/1 $B%a%C%;!<%8$NH/?.<T$O;D9b$rCN$i$J$$$N$G!"(B
$B0z?t(B Balance $B$rL$Dj5A$N$^$^(B account/2 $B=R8l$KEO$9!#(B
%
account/2 $B=R8l$O0z?t(B Balance $B$K(B
$B;D9b$r=q$-9~$`$3$H$K$h$C$FJV;v$r$9$k!#(B
%
Balance $B$N$h$&$K7k2L$rJV$9$?$a$NJQ?t$rJV?.H"(B (Reply Boxes) $B$H8F$V!#(B

$B$^$?Nc$($P!"(Baccount/2 $B=R8l$X(B exchange/1 $B%a%C%;!<%8$rAw$k$3$H$O!"(B
$B0z?t(B Request $B$K6qBNCM(B {\tt[exchange(Amount)|Request1]}
$B$r=q$-9~$`$3$H$K$h$C$FI=8=$9$k$,!"(B
$B$3$N$H$-B3$/%a%C%;!<%8Ns(B Request1 $B$O$^$@L$Dj5A$G$"$m$&!#(B
%
Request $B$N$h$&$K=y!9$K=q$-9~$^$l$F$f$/%a%C%;!<%8Ns$r(B
\term{$B%9%H%j!<%`(B (stream)} $B$H8F$V!#(B

% single-assignment channel
% channel mobility (cf. $\pi$-calculus)
% channel $\in$ Message
% channel fusion

$BO@M}JQ?t$ODL?.O)$G$"$k!#(B
%
$BNc$($P!"<!$N(B append/3 $B=R8l$O(B
$B%j%9%H(B X $B$H(B Y $B$rO"7k$7$?%j%9%H(B Z $B$rJV$9!#(B
\begin{verbatim}
append(X, Y, Z) :- X = [] |
  Z = Y.
append(X, Y, Z) :- X = [A | X1] |
  Z = [A | Z1],
  append(X1, Y, Z1).
\end{verbatim}
$B%/%i%$%"%s%H$,$3$N=R8l$r8F$S=P$9$H(B append/3 $B%W%m%;%9$,@8@.$5$l$k!#(B
%
$B4X?t7?8@8l$G$O(B X $B$NCf?H$,40A4$K3NDj$7$?;~$K(B Z $B$rA4$F3NDj$9$k!#(B
%
$B$7$+$7!"$3$N(B append/3 $B%W%m%;%9$O(B X $B$NCf?H$,IT3NDj$J$i$PCfCG$7!"(B
X $B$NCf?H$,=y!9$K3NDj$9$k$K$D$l$F(B Z $B$NCf?H$rA0$+$i3NDj$7$F$$$/!#(B

$B$9$J$o$A!"(B
append/3 $B%W%m%;%9$OMW5a6nF07?$N%5!<%P$G$"$k!#(B
X $B$H(B Y $B$O%/%i%$%"%s%H$+$i%5!<%P$X$NDL?.O)$G$"$j!"(B
Z $B$O%5!<%P$+$i%/%i%$%"%s%H$X$NDL?.O)$G$"$k!#(B
%
$B$^$?!"(B
X, Y, Z $B$NMWAG$ODL?.O)$KN.$l$k%a%C%;!<%8$G$"$k!#(B

X, Y, Z $B$KN.$l$k%a%C%;!<%8$,@0?t$dJ8;zNs$J$I$NC1=c$J$b$N$G$"$l$P!"(B
Unix $BF~=PNO%9%H%j!<%`$d(B RPC $B$G4JC1$K<BAu$9$k$3$H$,2DG=$G$"$k!#(B

$B$7$+$7!"(B
KL1 $B8@8l$G$OL$Dj5A>uBV$NO@M}JQ?t$r4^$`J#;($J%a%C%;!<%8$rDL?.O)$K(B
$BN.$9$3$H$K$h$C$F!"?7$?$JDL?.O)$rF0E*@8@.$9$k$3$H$,2DG=$G$"$k!#(B
%
$BJ#;($JDL?.%W%m%H%3%k$N@k8@E*5-=R$r5v$9$?$a$K!"(B
$BJ,;6(B KL1 $B8@8l=hM}7O$OO@M}JQ?t$NM"=PF~$H(B
$BJ,;6C10l2=$r<B8=$7$J$1$l$P$J$i$J$$!#(B

%---------------------------------------------------------------

\section{
 Type / Mode
 % / Linearity
 System }
\label{type-mode}

$BK\@a$G$O!"(B
KL1 $B8@8l$K$*$1$k9bEY$J@EE*2r@O$NBN7O$K$D$$$F2r@b$9$k!#(B

$B7?BN7O$O!"=c4X?t7?8@8l$K$*$$$F8&5f$,@9$s$G$"$k!#(B
%
KL1 $B8@8l$G$O%W%m%0%i%^$,JQ?t$N7?$rL@<(E*$K@k8@$9$k$3$H$O$J$/!"(B
$B=>$C$F!"(BKL1 $B%W%m%0%i%`$NJQ?t$K$O7?$,$J$$(B (type-less) $B$,!"(B
$B%W%m%0%i%`$N@EE*2r@O$K$h$k7?:F9=@.$,2DG=$G$"$k!#(B

$BNc$($P!"(Baccount/2 $B=R8l$N(B State $B0z?t$O!"(B
\begin{verbatim}
  State1 := State + Amount,
\end{verbatim}
$B$+$iJ,$+$k$h$&$K?tCM7?$r;}$D!#(B
%
$B$^$?!"(BRequest $B0z?t$O(B
\begin{verbatim}
account(Request, State) :- Request = [exchange(Amount)|Request1] |
\end{verbatim}
$B$+$iJ,$+$k$h$&$K!"%3%s%9!J%j%9%H%;%k!K7?$r;}$D!#(B

$B$3$N$h$&$KJQ?t$,FCDj$N7?$N6qBNCM$N$_$r$H$k$3$H$O(B
$BNI$$%W%m%0%i%`$N@-<A$G$"$j!"7?IU$-(B (well-typed) $B$H8@$o$l$k!#(B
%
$BA0=R$N<+F08m$j=$@57O(B Kima $B$O(B
$B%W%m%0%i%`$N7?IU$-$G$J$$ItJ,$rJs9p$7!"=$@50F$rDs<($9$k!#(B

$B%b!<%IBN7O$O!"JQ?t$KBP$9$kFI$_=q$-$N(B
$B%b!<%I!JJ}8~!K$K4X$9$kBN7O$G$"$k!#(B

$BNc$($P!"(Bbalance/1 $B%a%C%;!<%8$N0z?t(B Balance $B$N=q$-<j$O(B
balance/1 $B%a%C%;!<%8$NH/?.<T$G$J$/!"(Baccount/2 $B=R8l$G$"$k!#(B
%
$B=>$C$F!"(Baccount/2 $B=R8l$K$H$C$F(B Balance $B$N%b!<%I$O=q$-9~$_(B
(out) $B$G$"$k!#(B
%
$B5U$K!"(Bbalance/1 $B%a%C%;!<%8$NH/?.<T$K$H$C$F(B
Balance $B$N%b!<%I$OFI$_9~$_(B (in) $B$G$"$k!#(B

$B$3$N$h$&$KF10l$NJQ?t$KBP$9$k%b!<%I$O=q$-<j$HFI$_<j$N4V$G5UE>$9$k!#(B
%
$BJQ?t$X$N=q$-<j$,$?$@0l?M$G$"$k$3$H$ONI$$%W%m%0%i%`$N@-<A$G$"$j!"(B
$B%b!<%IIU$-(B (well-moded) $B$H8@$o$l$k!#(B
%
$B<+F08m$j=$@57O(B Kima $B$O%W%m%0%i%`$N%b!<%IIU$-(B
$B$G$J$$ItJ,$rJs9p$7!"=$@50F$rDs<($9$k!#(B

$B@EE*$KGSB>@)8f$5$l$F$$$J$$%b!<%I$J$7$N%W%m%0%i%`$NB?$/$O!"(B
$B$=$l$HEy2A$J7W;;$r9T$J$&%b!<%IIU$-$N!J@EE*$KGSB>@)8f$5$l$?!K(B
$B%W%m%0%i%`$K=q$-49$($k$3$H$,$G$-$k!#(B
%
$B%b!<%I$J$7$N%W%m%0%i%`$rEy2A$J%b!<%IIU$-$N%W%m%0%i%`$K(B
$B=q$-49$($kJ}K!$K$D$$$F$O!"IUO?(B\ref{moding}$B$r;2>H$;$h!#(B

%---------------------------------------------------------------

\Comment{
\section{ $B@lMQJBNs5!(B PIM $B>e$N=hM}7O(B }
$B%*%Z%l!<%F%#%s%0%7%9%F%`(B PIMOS
$BAq1`(B
} % end Comment

%---------------------------------------------------------------

\section{ KLIC $B=hM}7O(B }

KLIC $B=hM}7O$O4{B8$N(B KL1 $B8@8l=hM}7O$N0l$D$G$"$k!#(B

KLIC $B=hM}7O$OF10l$N5!<o!"%*%Z%l!<%F%#%s%0%7%9%F%`$r;}$D(B
$BJ#?t$N%[%9%H$GF0:n$9$k(B PVM (Parallel Virtual Machine)
$B>e$GJBNs<B9T$r9T$&5!G=$r;}$C$F$$$k!#(B
%
$B$7$+$7!"J,;64D6-$K$*$$$F$O%M%C%H%o!<%/$r9=@.$9$k(B
$B8D!9$N5!3#$KF10l$N5!<o!"%*%Z%l!<%F%#%s%0%7%9%F%`$r(B
$B6/@)$9$k$3$H$OHs8=<BE*$G$"$k!#(B

KLIC $B=hM}7O$NJBNs<BAu$K$*$1$k%[%9%H4VDL?.$O!"(B
$BJQ?t$NFI$_<j$,=q$-<j$X6qBNCM$rMW5a$9$k%W%k7?$G9T$o$l$k!#(B
%
$B%W%k7?$N(B lazy $B$J%a%C%;!<%8DL?.$O!"(B
$BFI$_<j$,$$$J$$JQ?t$N$?$a$N%a%C%;!<%8$,ITMW$G$"$j!"(B
$BDL?.NL$,:GE,$G$"$k$H$$$&@-<A$r;}$D!#(B
%
$BH?LL!"%W%k7?$G$O0l$D$NJQ?t$NFI$_9~$_$KBP$7$F(B
$B1}I|$GFs$D$N%a%C%;!<%8$rI,MW$H$9$k!#(B
%
$B$3$N@-<A$O!"DL?.CY1d$NBg$-$JJ,;64D6-$K$*$$$F$O(B
$B5vMF$G$-$J$$@-<A$G$"$k!#(B

KLIC $B=hM}7O$NJ,;65!G=$O!"JQ?t$r4^$^$J$$4pDl9`$r(B
$BF~=PNO$G$-$k<jB3$-7?$N%=%1%C%H$N$_$G$"$k!#(B
%
$B=>$C$F!"K\8&5f$,L\I8$H$9$k@k8@7?J,;6%W%m%0%i%_%s%0$N$?$a$K$O!"(B
$BJQ?t$r4^$`9`$rF~=PNO$G$-$k@k8@7?$N%=%1%C%H$r<BAu$9$kI,MW$,$"$k!#(B

% KLIJava $B=hM}7O(B

%---------------------------------------------------------------

\Comment{
\section{ KL1/J $B=hM}7O(B, DKLIC $B=hM}7O(B }
$BJ,;6(B KL1 $B8@8l$rDs>'$7$?(B
} % end Comment

%---------------------------------------------------------------

\section{ $B4XO"8&5f(B }

$BJB9TO@M}7?8@8l$H$7$F!"(BKL1 $B8@8l$NB>$K(B Concurrent Prolog \cite{CProlog},
Janus \cite{Janus}, DRL \cite{DRL} $B$J$I$,$"$k!#(B

Janus $B$G$O%a%C%;!<%8(B \verb!^/1! $B$K$h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% $BJ,;6O@M}JQ?t$H$O(B
% $B%W%m%0%i%^$K%b!<%I$rL@<($5$;$kM}M3(B
% C $B8@8l$K$h$k5-=RItJ,$O>/$J$/C1=c$K(B

$B<BAu$rC1=c$K$9$k$?$a!"(B
DKLIC $B=hM}7O$N5!G=$O$$$/$D$+$N3,AX$KJ,3d$7$FDs6!$9$k!#(B
%
$B8D!9$N5!G=$rDs6!$9$k3F3,AX!"3F%5!<%P$O$G$-$k8B$jC1=c$K<BAu$7!"(B
Unix $B$N%3%^%s%I$N$h$&$KAH$_9g$o$;$k$3$H$K$h$C$F(B
$BJq3gE*$J5!G=$rDs6!$9$k%7%9%F%`$r9=@.$9$k!#(B

%---------------------------------------------------------------

\section{ DKLIC $BA4BN$N;EMM(B }

DKLIC $B=hM}7O$*$h$S$=$N1~MQ$O<!$N$h$&$J3,AX$r@.$9!#(B

\begin{enumerate}
\item $B@\B3%5!<%P(B dklicio
$B$O@k8@7?%=%1%C%H$r3NN)$9$k(B bind/2, connect/2 $B=R8l$rDs6!$9$k!#(B

\item $B8!:w%5!<%P(B naming (ORB) $B$O<!$NFs$D$N=R8l(B
$B$"$k$$$O%a%C%;!<%8$r=hM}$9$k!#(B
register $B$O%f!<%6Dj5A%5!<%P$rEPO?$9$k!#(B
lookup $B$OEPO?$5$l$?%5!<%P$r8!:w$9$k!#(B

\item $B%(!<%8%'%s%H6u4V(B exec (Mobile Agents / Fault Tolerance)
$B$O(B KL1 $B8@8l$K$h$C$F5-=R$5$l$?%b%P%$%k%(!<%8%'%s%H(B
$B$r<B9T!"@)8f$9$k5!G=$rDs6!$9$k!#(B

\item $B%f!<%6Dj5A%5!<%P(B.
$B2<0L$N@\B3%5!<%P$d8!:w%5!<%P$J$I$rMxMQ$7$F!"(B
$BJ,;6(B KL1 $B%W%m%0%i%^$OFH<+$N%5!<%P$rDj5A$9$k$3$H$,$G$-$k!#(B

\item $B%"%W%j%1!<%7%g%s(B.
$B2<0L$N@\B3%5!<%P!"8!:w%5!<%P!"%f!<%6Dj5A%5!<%P$J$I$rMxMQ$7$F!"(B
KL1 $B%W%m%0%i%^$OJ,;6%"%W%j%1!<%7%g%s$r5-=R$9$k$3$H$,$G$-$k!#(B
\end{enumerate}

%---------------------------------------------------------------

\section{ $BK\8&5f$NL\I8$HHO0O(B }

\newcommand{\A}{\var{A}}
\newcommand{\B}{\var{B}}
\newcommand{\C}{\var{C}}
\newcommand{\D}{\var{D}}

\Comment
{$B5f6KL\I8(B
$B%M%C%H%o!<%/$K@\B3$5$l$?$"$i$f$k7W;;;q8;$,JB9T%*%V%8%'%/%H$H$7$F$N(B
$B%$%s%?%U%'%$%9$r;}$A!"0MMj$K1~$8$F8GM-$N7W;;$rDs6!$9$k$h$&$J(B
$B@k8@7?J,;64D6-$r<B8=$9$k!#(B}

$BK\8&5f$K$*$$$F$O!"Nc30=hM}$OL\I8$H$7$J$$!#(B

$BK\8&5f$G$O(B DKLIC $B=hM}7O$N:G2<0L%5!<%P$G$"$k(B dklicio $B$r<BAu$9$k!#(B
$B8!:w%5!<%P$=$NB>$N>e0L%5!<%P$OK\8&5f$NL\I8$G$O$J$/!"1~MQNc$H$9$k!#(B

DKLIC $B=hM}7O$N4pK\%5!<%P(B dklicio $B$O!"(B
$B0J2<$N$h$&$J@k8@7?J,;6%W%m%0%i%_%s%0$r2DG=$K$9$k!#(B

\begin{verbatim}
name(NS, Table) :- NS = [register(Name,Server) | NS1] |
  generic:new(merge, Clients, Server),
  Table1 = [(Name,Clients) | Table],
  name(NS1, Table1).
name(NS, Table) :- NS = [lookup(Name,Result) | NS1] |
  lookup(Name, Result, Table, Table1),
  name(NS1, Table1).

lookup(Name, Result, Table, Table_) :- Table = [] |
  Result = not_found(Name),
  Table_ = Table.
lookup(Name, Result, Table, Table_) :- Table = [(N,S)|Table1], N=Name |
  S = {Client, S1},
  Result = found(Client),
  Table_ = [(N,S1) | Table1].
otherwise.
lookup(Name, Result, Table, Table_) :- Table = [(N,S)|Table1] |
  Table_ = [(N,S) |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%W%m%0%i%_%s%0$r2DG=$K$9$k$?$a$K(B
KL1 $B8@8l$,Hw$($k$Y$-5!G=$rJ,@O$7$?!#(B
%
$B$^$?!"$=$N5!G=$r<B8=$9$k$?$a$NL\I8$r@_Dj$7$?!#(B
%
$B<!>O$G$O!"(BDKLIC $B=hM}7O$NDL?.%W%m%H%3%k(B DKLICP $B$r2r@b$9$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% DKLICP $B8@8l(B
% opener $B:FMxMQ(B
% $BFs<T!";0<TDL?.(B

\chapter{ $B%W%m%H%3%k(B DKLICP }
\label{DKLICP}

$BA0>O$G$O!"(BKL1 $B8@8l$K$h$kJ,;6%W%m%0%i%_%s%0$r<B8=$9$k$?$a$K(B
$BL$Dj5AJQ?t$r4^$`(B KL1 $B9`$rAw<u?.$9$kI,MW$,$"$k$3$H$rL@$i$+$K$7!"(B
DKLIC $B=hM}7O$NL\I8$r@_Dj$7$?!#(B
%
$BK\>O$G$O!"O@M}JQ?t$r4^$`(B KL1 $B9`$rAw<u?.$9$k$?$a$K(B
dklicio $B$,;HMQ$9$kDL?.%W%m%H%3%k(B DKLICP $B$K$D$$$F2r@b$9$k!#(B

\vspace{1em}

$B<!$K(B DKLICP $B8@8l$N7A<02=$N3,AX$r5s$2$k!#(B
$B7A<0J8K!$N3,AX$K$D$$$F$O(B \cite{Turing} $B$r;29M$K$7$?!#(B
\begin{enumerate}
\item $B@5B'J8K!(B \( lex : String \rightarrow Token^* \).
KL1 $B8@8l$N;z6g2r@O$HF10l$G$"$k(B

\item $BJ8L.<+M3J8K!(B \( parse : Token^* \rightarrow Term^* \).
KL1 $B8@8l$N9=J82r@O$HF10l$G$"$k(B

\item $BJ8L.0MB8J8K!(B
\( unmarshal =\Def marshal^{-1} : (String \rightarrow) Term^* \).
$BJ,;6O@M}JQ?t!&M"=PF~I=$,Dj5A$9$k(B

\item $B0UL#O@(B.
$B!J%f!<%6Dj5A!K%5!<%P$K$h$C$FDj5A$5$l$k(B
\end{enumerate}

DKLIC $B=hM}7O$N<BAu$rC1=c$K$9$k$?$a!"(B
\( lex, parse \) $B$r(B KL1 $B8@8l$H6&M-$9$k$3$H$K$h$C$F!"(B
KLIC $B=hM}7O$N4{B8%Q!<%6$r$=$N$^$^MxMQ$9$k!#(B

$BB>8@8l$H$N(B inter-operability $B$N$?$a$K@5B'J8K!$HJ8L.<+M3J8K!(B
$B$r(B XML $B8@8l$KBP1~$5$;$kNc$K$D$$$F$O!"IUO?(B\ref{XML}$B$r;2>H$;$h!#(B

%---------------------------------------------------------------

\section{ $BFs<TDL?.$N%W%m%H%3%k(B }

\newcommand{\ID}{\var{ID}}
\newcommand{\Name}[1]{ \_\var{#1} }
\newcommand{\Host}{\var{Host}}
\newcommand{\Port}{\var{Port}}
\newcommand{\nl}{\(\backslash\)n}
\newcommand{\String}[1]{ ``#1'' }
\newcommand{\Term}{\var{Term}}

\begin{enumerate}
\Comment{
\item
$B%Q%1%C%H$N7gB;$dDI$$1[$7$,$J$$%M%C%H%o!<%/$rA0Ds$H$9$k!#(B
TCP/IP $B%=%1%C%H!"%/%i%$%"%s%H!&%5!<%P%b%G%k(B
} % end Comment

\item
$B$^$:!"%/%i%$%"%s%H$,%5!<%P$XJ8;zNs(B
\String{DKLICP 2002-01 \Host:\Port\nl} $B$rAw?.$9$k!#(B
$B$3$3$G!"(B\Host:\Port $B$O%/%i%$%"%s%H%W%m%;%9$r<B9T$9$k(B
DKLICP $BBP1~%5!<%P$N0LCV>pJs$G$"$k!#(B

$B$3$NJ8;zNs$r<u$1<h$C$?%5!<%P$O$=$N%/%i%$%"%s%H$XJ8;zNs(B
\String{DKLICP 2002-01 server\nl} $B$rAw?.$7!"(B
$B0J2<$N5,B'$K=>$C$F(B KL1 $B9`$NAw<u?.$r3+;O$7$FNI$$!#(B

$B%5!<%P$+$i$NJVEzJ8;zNs$r<u$1<h$C$?%/%i%$%"%s%H$O(B
$B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------------------------------------------------------

\section{ $BJ,;6O@M}JQ?t$N%i%$%U%5%$%/%k(B }

\newcommand{\State}[1]{\makebox{\(#1(\var{id})\)}}
\newcommand{\Opening}{\State{opening}}
\newcommand{\Opened}{\State{opened}}
\newcommand{\Closing}{\State{closing}}
\newcommand{\Closed}{\State{closed}}

\newcommand{\Message}[1]{\makebox{\({#1}Message(\var{id})\)}}
\newcommand{\OpenMessage}{\Message{Open}}
\newcommand{\CloseMessage}{\Message{Close}}

\newcommand{\Opener}{\State{opener}}
\newcommand{\Openee}{\State{openee}}
\newcommand{\Closer}{\State{closer}}
\newcommand{\Closee}{\State{closee}}

$BJ,;6O@M}JQ?t$N%i%$%U%5%$%/%k$O<!$N;0CJ3,$+$i@.$k!#(B

\begin{enumerate}
\item open. $BO@M}JQ?t$K(B \Name{ID} $B$r3d$jEv$F!"M"=P!J$=$7$FM"F~!K$9$k!#(B
\item use. $BJ,;6O@M}JQ?t$r9`$N0lIt$H$7$FAw<u?.$9$k!#(B
\item close. $BDL?.O)$rJD$8!"(B\Name{ID} $B$r2s<}$9$k!#(B
\end{enumerate}

$B6qBN2=%a%C%;!<%8!"D>7k%a%C%;!<%8!"GQ4~%a%C%;!<%8$r<u?.$9$k$H!"(B
$BDL?.O)$rJD$8$FJ,;6O@M}JQ?t$N<1JL;R(B \var{id} $B$r2s<}$9$k=hM}$,9T$o$l$k!#(B
%
$B$3$N$?$a!"$3$l$i$N%a%C%;!<%8$r(B \CloseMessage $B$H8F$V!#(B

$B$^$?!"<1JL;R$N3d$jEv$F$i$l$F$$$J$$HsJ,;6O@M}JQ?t$rM"=P$9$k$H$-!"(B
$BDL?.O)$r3+$$$F<1JL;R(B \var{id} $B$r3d$jEv$F$k=hM}$,9T$o$l$k!#(B
%
$B$3$N$h$&$K?7$?$JDL?.O)$r3+$/%a%C%;!<%8$r(B
\OpenMessage $B$H8F$V!#(B

\OpenMessage $B$NAw?.<T$r(B \Opener, $B<u?.<T$r(B \Openee $B$H8F$S!"(B
\CloseMessage $B$NAw?.<T$r(B \Closer, $B<u?.<T$r(B \Closee $B$H8F$V!#(B

$BJ,;6O@M}JQ?t$N>uBVA+0\$O<!$N$h$&$J$b$N$G$"$k!#(B
%
%\[ \{ \emptyset(id), \Opening, \Opened, \Closing, \Closed \} \]
%
\begin{enumerate}
\item \( \emptyset(id) \). $BMxMQ$5$l$?$3$H$,$J$$>uBV$G$"$k(B
\begin{enumerate}
\item \( \emptyset(id) \rightarrow \Opening \)
\\ $BM"=P$7$F$$$J$$(B \( id \) $B$N(B \OpenMessage $B$r1s3V%[%9%H$XM"=P$9$k(B
\item \( \emptyset(id) \rightarrow \Opened \)
\\ \OpenMessage $B$r1s3V%[%9%H$+$iM"F~$9$k(B
\end{enumerate}

\item \Opening.
\OpenMessage $B$rM"=P$7$?$,!"(B
$B1s3V%[%9%H$XM"F~$5$l$?$3$H$r3NG'$7$F$$$J$$>uBV$G$"$k(B
\begin{enumerate}
\item \( \Opening \rightarrow \Opened \)
\\ $BM"=P$7$?(B \( id \) $B$r1s3V%[%9%H$+$i<u?.$9$k(B
\item \( \Opening \rightarrow \Closing \)
\\ $BM"=P$7$?(B \( id \) $B$N(B \CloseMessage $B$r1s3V%[%9%H$XAw?.$9$k(B
\item \( \Opening \rightarrow \Closed \)
\\ $BM"=P$7$?(B \( id \) $B$N(B \CloseMessage $B$r1s3V%[%9%H$+$i<u?.$9$k!#(B
$B<u?.3NG'$rAw?.$9$kI,MW$,$"$k(B
\end{enumerate}

\item \Opened.
\OpenMessage $B$r1s3V%[%9%H$+$iM"F~$7$?>uBV$G$"$k(B
\begin{enumerate}
\item \( \Opened \rightarrow \Closing \)
\\ \CloseMessage $B$r1s3V%[%9%H$XAw?.$9$k(B
\item \( \Opened \rightarrow \Closed \)
\\ \CloseMessage $B$r1s3V%[%9%H$+$i<u?.$9$k!#(B
$B<u?.3NG'$rAw?.$9$kI,MW$,$"$k(B
\end{enumerate}

\item \Closing.
\CloseMessage $B$rAw?.$7$?$,!"(B
$B1s3V%[%9%H$+$i$N<u?.3NG'$r<u$1<h$C$F$$$J$$>uBV$G$"$k(B
\begin{enumerate}
\item \( \Closing \rightarrow \Closed \)
\\ \CloseMessage $B$r1s3V%[%9%H$+$i<u?.$9$k!#(B
$B<u?.3NG'$rAw?.$9$kI,MW$O$J$$(B
\end{enumerate}

\item \Closed.
\CloseMessage $B$r1s3V%[%9%H$+$i<u?.$7$?>uBV$G$"$k(B
\begin{enumerate}
\item \( \Closed \rightarrow \Opening \)
\\ \OpenMessage $B$r1s3V%[%9%H$X:FM"=P$9$k(B
\item \( \Closed \rightarrow \Opened \)
\\ \OpenMessage $B$r1s3V%[%9%H$+$i:FM"F~$9$k(B
\end{enumerate}
\end{enumerate}

$BA+0\%0%i%U$r4JLs2=$9$k$H(B \( \emptyset(id) = \Closed \) $B$G$"$k!#(B
$B$^$?!"(B\Opener $B$N(B ID $B6u4V$OJ,N%$7$F$"$k$N$G!"(B
\var{id} $B$,=EJ#$7$FH/9T$5$l$k$3$H$O$J$/!"(B
\Opening $B$H(B \Opened $B$r6hJL$9$kI,MW$O$J$$!#(B

\begin{figure}
\fig{var-state}
\caption{ state transition of distributed variables }
\end{figure}

%---------------------------------------------------------------

\section{ $BC/$,(B ID $B$r:FMxMQ$9$k$+(B }

\begin{enumerate}
\item \Closee $B$,(B \var{id} $B$r:FMxMQ$9$k>l9g!"(B
\CloseMessage $B$N<u?.3NG'$rAw$j=P$7$?D>8e$K!"(B
\OpenMessage $B$rAw?.$7$F(B \var{id} $B$r:FMxMQ$9$k$3$H$,$G$-$k!#(B

$B0lJ}!"(B\Closer $B$,(B \var{id} $B$r:FMxMQ$9$k>l9g!"(B
$BDL?.Aj<j$+$i$N(B \CloseMessage $B$N<u?.3NG'$r<u$1<h$k$^$G(B
\var{id} $B$r:FMxMQ$9$k$3$H$O$G$-$J$$!#(B

\item \Openee $B$,(B \var{id} $B$r:FMxMQ$9$k>l9g!"(B
\var{id} $B$NMxMQ8"$,8r8_$K0\F0$9$k!#(B

\item \Opener $B$,(B \var{id} $B$r:FMxMQ$9$k>l9g!"(B
\var{id} $B$r4^$`(B ID $B6u4V$NMxMQ8"$r;}$C$F$$$kB&$,(B
$B>o$K(B \var{id} $B$r:FMxMQ$9$k!#(B

\Openee $B$,:FMxMQ$9$k>l9g$H0[$J$j!"(B
ID $B6u4V$,F0E*$KJQ2=$9$k$3$H$O$J$$!#(B

$B:FMxMQ0J30$N>l9g$H@09g$7$F$$$k$N$G!"$3$N0F$r:NMQ$9$k!#(B
\end{enumerate}

\Closee $B$,(B \var{id} $B$r:FMxMQ$9$k>l9g!"(B
$B<u?.3NG'$rBT$?$:$K:FMxMQ$r;O$a$k$3$H$,$G$-$k!#(B
%
$B$7$+$7!"<!$N$h$&$K%/%i%$%"%s%H$+$i%5!<%P$X$N(B
$BE57?E*$JMW5a%9%H%j!<%`$r9M$($h$&!#(B
\begin{verbatim}
Request0 = [request0(Answer0) | Request1]
Request1 = [request1(Answer1) | Request2]
         :
\end{verbatim}
$B$3$3$K8=$l$kJQ?t(B Request0, Request1, Request2, Answer0, Answer1
$B$OA4$F!"%/%i%$%"%s%H$,(B open $B$9$k$b$N$G$"$k!#(B

$B$3$N$h$&$KE57?E*$JDL?.%Q%?!<%s$rB3$1$k8B$j!"(B
$B%5!<%P$O7h$7$FJQ?t$r(B open $B$;$:!"(B
$B%5!<%P$N(B ID $B6u4V$OC1D4A}2C$9$k!#(B
%
$B0lJ}!"%/%i%$%"%s%H$OJQ?t$r(B open $B$7B3$1!"(B
$B%/%i%$%"%s%H$N(B ID $B6u4V$OC1D48:>/$7!"(B
$B$d$,$F8O3i$9$k$G$"$m$&!#(B
%
$BJQ?t$N(B ID $B$r;q8;$H8+$J$94QE@$+$i$O!"(B
\Opener $B$,(B \var{id} $B$r:FMxMQ$9$kJ}<0$,E,@Z$G$"$k!#(B

%---------------------------------------------------------------

\section{ $B;0<TDL?.$N%W%m%H%3%k(B }

\newcommand{\exporting}{\var{exporting}}

$B%[%9%H(B \A--\B $B4V$KDL?.O)(B K$B!"%[%9%H(B \B--\C $B4V$KDL?.O)(B L $B$,3+$$$F$$$k;~!"(B
K $B$H(B L $B$N4V$KD>@\$N4XO"$,$J$1$l$P!"%[%9%H(B \A--\B $B4V!"(B
\B--\C $B4V$NDL?.$O$=$l$>$lFHN)$JFs<TDL?.$G$"$k!#(B

$B$7$+$7!"%[%9%H(B \B $BFb$GDL?.O)(B K, L $B$,D>7k$5$l$k$H!"(B
$BD>7k(B K=L $B$N<B9T$r%[%9%H(B \A $B$d(B \C $B$KCN$i$;$kI,MW$,$"$k>l9g$,$"$k!#(B

\begin{enumerate}
\item 
$B%[%9%H(B \B $B$K$*$$$FDL?.O)(B K, L $B$,$$$:$l$b(B in $B%b!<%I$G$"$k;~!"(B
in $B%b!<%I$NJQ?tF1;N$rD>7k$9$k$N$O!"(B
$BFI$_9~$_%b!<%I$NJQ?t$K@)Ls$r2]$7$F(B
$B$"$k<o$N=q$-9~$_$r9T$&$3$H$K$J$k$N$G!"(B
$B%b!<%IIU$-$G$"$k$H$$$&A0Ds$KH?$9$k!#(B

\item
$B%[%9%H(B \B $B$K$*$$$FDL?.O)(B K, L $B$,$$$:$l$b(B out $B%b!<%I$G$"$k;~!"(B
$B%[%9%H(B \A $B$d(B \C $B$KD>7k$rJs9p$9$kI,MW$O$J$$!#(B
%
K=L $B$O%[%9%H(B \B $B$+$i$N%^%k%A%-%c%9%H$G$"$j!"(B
$B=q$-<j(B \B $B$,FI$_<j(B \A, \C $B$K6qBNCM$rD>@\Aw?.$9$k@UG$$r;}$D!#(B

\item
$B%[%9%H(B \B $B$K$*$$$FDL?.O)(B K $B$,(B in $B%b!<%I!"DL?.O)(B L $B$,(B out $B%b!<%I$G$"$k;~!"(B
$B%[%9%H(B \B $B$O%[%9%H(B \A $B$X4V@\M"=P%a%C%;!<%8(B
\String{\Name{ID}=\Name{ID1}@\C}$B$rAw?.$9$k!#(B
%
$B$3$3$G(B \Name{ID} $B$O(B \A--\B $B4V$G(B K $B$K3d$jEv$F$i$l$?<1JL;R$G$"$k!#(B
$B$^$?!"(B\Name{ID1} $B$O(B \B--\C $B4V$G(B L $B$K3d$jEv$F$i$l$?<1JL;R$G$"$k!#(B
\A--\B $B4V$GDL?.$5$l$k%a%C%;!<%8Fb$NJQ?tL>$G$O!"(B
$B<+L@$J(B\String{@\A\B}$B$r>JN,$7$F$$$k$H9M$($FNI$$!#(B
\String{\Name{ID1}@\C}$B$G$O(B\String{@\B}$B$r>JN,$7$F$$$k!#(B
%
$B$3$N$H$-!"%[%9%H(B \B $B$K$*$$$FDL?.O)(B L $B$O4V@\M"=P$5$l$?(B
(\exporting) $B>uBV$XA+0\$9$k!#(B

\begin{enumerate}
\item $B4V@\M"=P%a%C%;!<%8$r<u?.$7$?%[%9%H(B \A $B$O(B
$B%[%9%H(B \C $B$X!"4V@\M"=P3NG'%a%C%;!<%8(B
\String{\Name{ID1}@\B=\Name{ID2}}$B$rAw?.$9$k!#(B
%
$B$3$3$G(B \Name{ID2} $B$O!"O@M}JQ?t(B K $B$N%[%9%H(B \A--\C
$B4V$K$*$1$k?7$?$JDL?.O)(B K' $B$N<1JL;R$G$"$k!#(B
$B$?$@$7!"%[%9%H(B \A $BFb$GO@M}JQ?t(B K $B$K(B
$B6qBNCM(B \Term $B$,4{$K=q$-9~$^$l$F$$$?>l9g!"(B
$B4V@\M"=P3NG'%a%C%;!<%8(B\String{\Name{ID1}@\B=\Term}
$B$rAw?.$9$l$PNI$/!"?7$?$K(B K' $B$r(B open $B$9$kI,MW$O$J$$!#(B

DKLICP $B$N%=%1%C%H3NN)(B (negotiation) $B;~$K!"%/%i%$%"%s%H$,(B
\Host:\Port $B$r<+8J?=9p$9$k$N$O!"?7$?$JDL?.O)(B K' $B$r3NN)(B
$B$9$k;~$KI,MW$G$"$k$3$H$,$"$k$?$a$G$"$k!#(B
$BFs<TDL?.$G$O!"%=%1%C%H$N3NN);~$K%/%i%$%"%s%H$,(B
\Host:\Port $B$r<+8J?=9p$9$kI,MW$O$J$$!#(B

\item $B4V@\M"=P3NG'%a%C%;!<%8$r<u?.$7$?%[%9%H(B \C $B$O%[%9%H(B \B $B$X(B
$B4V@\M"=P:Q$_%a%C%;!<%8(B\String{\Name{ID1}=Exported}$B$rAw?.$9$k!#(B

\item $B4V@\M"=P:Q$_%a%C%;!<%8$r<u?.$7$?%[%9%H(B \B $B$O(B
\exporting $B>uBV$NDL?.O)(B L $B$rJD$8$k(B (\Closed)$B!#(B
%
\exporting $B>uBV$NDL?.O)(B L $B$O!"4V@\M"=P:Q$_%a%C%;!<%80J30$N(B
\CloseMessage $B$K$h$C$F(B \Closed $B>uBV$XA+0\$7$F$O$J$i$J$$!#(B
%
$B$J$<$J$i!"(B\A $B$+$i(B \C $B$X4V@\M"=P3NG'%a%C%;!<%8$,FO$/A0$K(B
\Name{ID1} $B$,B>$NJQ?t$K:FMxMQ$5$l$F$O$J$i$J$$$+$i$G$"$k!#(B

\item \exporting $B>uBV$NDL?.O)(B L $B$KBP$7$F!"(B
$B4V@\M"=P%a%C%;!<%8(B\String{\Name{ID1}=\Name{ID3}@\D}$B$r<u?.$7$?$i!"(B
$B%[%9%H(B \B $B$O%[%9%H(B \C $B$X4V@\M"=PIT5v2D%a%C%;!<%8(B
\String{\Name{ID1}=Exporting}$B$rAw?.$9$k!#(B
%
$B4V@\M"=PIT5v2D%a%C%;!<%8$r<u?.$7$?%[%9%H(B \C $B$O!"(B
$B%[%9%H(B \A $B$+$i$N4V@\M"=P3NG'%a%C%;!<%8$rBT$A!"(B
$B4V@\M"=P%a%C%;!<%8(B\String{\Name{ID2}=\Name{ID3}@\D}$B$rAw?.$7D>$9!#(B
\end{enumerate}

$B$3$l$i$N%a%C%;!<%8DL?.$r=*$($k$HDL?.O)(B K=L $B$O!"(B
$B%[%9%H(B \A $B$+$i$N%^%k%A%-%c%9%H$G$"$k(B K=K' $B$X$H@\B3$7D>$5$l$F$$$k!#(B
\end{enumerate}

\begin{figure}
\fig{3com}
\figu{0.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$O!"(Bdklicio $B$NDL?.%W%m%H%3%k(B DKLICP $B$r2r@b$7$?!#(B
%
$BK\>O$G$O!"(BDKLIC $B=hM}7O$N:G2<0L%5!<%P$G$"$k(B
dklicio $B$N@_7W$K$D$$$F=R$Y$k!#(B

% \vspace{1em}
% \section{ Layers }

\newcommand{\E}{distributed}
\newcommand{\T}{variable\_table}

dklicio $B$O<!$N;0$D$N3,AX$+$i@.$k!#(B
\begin{enumerate}
\item $BJ,;6O@M}JQ?t(B \E
\item $BJQ?tI=(B \T ( \( \Leftrightarrow \) ID manager )
\item $B@k8@7?JQ?tF~=PNO%=%1%C%H(B io
\end{enumerate}

%---------------------------------------------------------------

\section{ $BJ,;6O@M}JQ?t(B \E }

\newcommand{\Fuse}{\makebox{fuse}}
\newcommand{\Bound}{\makebox{bound}}
\newcommand{\In}{\( \; + \)}
\newcommand{\Out}{\( \; - \)}
\newcommand{\Nio}{\( \; ? \)}
\newcommand{\id}{\var{id}}

% $BFs<TDL?.(B
% $B;0<TDL?.(B

% $BJ,;6C10l2=(B

$BJ,;6O@M}JQ?t$O6qBN2=!"D>7k!"GQ4~$5$l$?$3$H$r8!=P$9$kI,MW$,$"$k!#(B

$BJQ?tI=$N%(%s%H%j$H$J$kJ,;6O@M}JQ?t$O!"<!$N$h$&$J$b$N$G$"$k!#(B

\( Dist =\Def ID \times Var \ni (id, var) \)

$B35G0E*$K$O<!$N$h$&$J%/%i%9(B \E $B$r:n$k$3$H$K$J$k!#(B
\begin{verbatim}
d(ID, X, Report) :- wait(X) |
  Report = [bound(ID, X)].
alternatively.
d(ID, X, Report) :- fused(X) |
  Report = [fused(ID, X) | Report1],
  d(ID, X, Report1).
d(ID, X, Report) :- garbage(X) |
  Report = [removed(ID)].
\end{verbatim}
$B$9$J$o$A!"6qBN2=!"D>7k!"GQ4~$5$l$?$3$H$r8!=P$7!"(B
$B$=$N;]$rJQ?tI=$KJs9p$9$kI,MW$,$"$k!#(B

KLIC $B=hM}7O$O<!$N%a%=%C%I$K$h$C$F%/%i%9(B \E $B$rA`:n$9$k!#(B
\begin{enumerate}
\item $B%3%s%9%H%i%/%?(B \In\ID, {\Nio}Report

\item $B%$%Y%s%H(B \Fuse {\Nio}Any
\\
$B%m!<%+%k%[%9%HFb$G(B \E $B$,C10l2=$5$l$?$3$H$r<($9%$%Y%s%H$G$"$k!#(B

$B%m!<%+%k%[%9%HFb$N@)Ls5-21!JC10l2=$NMzNr!K$r(B \( constraints \) $B$H$9$k$H!"(B
\\
\( \Fuse: Dist \times Constraints \times Term \rightarrow
\\ \Tab Constraints \times \{ bound/2, fused/2 \} \)
\\
\( \Fuse((id, var), constraints, term) =
\\ \Tab (constraints \cup \{ var=term \},
\\ \Tab message(id, term))
\\ \Where
\\ \Tab message = bound \If term \in Bound
\\ \Tab message = fused \If term \not\in Bound \)

KLIC $B=hM}7O$GL$Dj5AJQ?tF1;N$ND>7k$r8!=P$9$k$K$O!"(B
$B$=$NL$Dj5AJQ?t$,%8%'%M%l!<%?%*%V%8%'%/%H$H$7$F<BAu$5$l$F$$$kI,MW$,$"$k!#(B
%
$B=>$C$F!"(B\E $BF1;N$ND>7k$r8!=P$9$k$?$a$K!"(B
\E $B$r%8%'%M%l!<%?%*%V%8%'%/%H$H$7$F<BAu$9$k!#(B

\item $B%$%Y%s%H(B gc ({\Out}Address)
\\
$B%m!<%+%k%[%9%HFb$G(B KLIC $B=hM}7O$N%3%T!<(B GC $B$,9T$o$l!"(B
$B%f!<%6%W%m%;%9$+$i$3$N%*%V%8%'%/%H$X$N;2>H$,@8B8$7$F$$$k$N$G!"(B
$B$3$N%*%V%8%'%/%H$r?7NN0h$X%3%T!<$9$kI,MW$,$"$k$3$H$r<($9%$%Y%s%H$G$"$k!#(B

$BJQ?tI=$+$i$3$N%*%V%8%'%/%H$X$N;2>H$O!V@8B8$7$F$$$J$$!W$N$G!"(B
$B$=$l0J30$N;2>H$,@8B8$7$F$$$J$$>l9g!"(B
$B$3$N%*%V%8%'%/%H$O5lNN0h$X<h$j;D$5$l!"GQ4~$5$l$k!#(B
\end{enumerate}

%---------------------------------------------------------------

\section{ ID manager (Name Server) }

Name Server $B$O35G0E*$KMM!9$J%l%Y%k$G8=$l$k!#(B
%
$BNc$($P!"(B
\begin{enumerate}
\item DNS $B$O%[%9%HL>$r(B IP $B%"%I%l%9$KBP1~IU$1$k!#(B
\item $B%=%1%C%H$O%]!<%HHV9f$r%5!<%P$KBP1~IU$1$k!#(B
\item ID manager $B$O(B ID $B$rJ,;6O@M}JQ?t$KBP1~IU$1$k!#(B
\item java.rmi.Naming (rmiregistry)
$B$O%$%s%?%U%'%$%9$r%5!<%P%*%V%8%'%/%H$KBP1~IU$1$k!#(B
\item ORB $B$O%5!<%S%9$rJ,;6%*%V%8%'%/%H$KBP1~IU$1$k!#(B
\end{enumerate}

DNS, ORB $B$O<BBN$K!"0[$J$kL>A06u4V$K$*$1$kJLL>$rIU$1$k!#(B
$B%f!<%6$O<BBN$NK\L>$rCN$kI,MW$,$J$/!"(B
$BJLL>$K$h$C$F<BBN$rFCDj$9$k$3$H$,$G$-$k!#(B

$B%=%1%C%H(B, ID manager, Java RMI $B$O(B
$B<BBN$K9-0hL>$rIU$1$k$3$H$K$h$C$F!"(B
$B1s3V%f!<%6$,<BBN$K%"%/%;%9$9$k$3$H$r2DG=$K$9$k!#(B

\Comment
{Name Server $B$KI,?\$N5!G=$G$O$J$$$,!"(B
 (DNS,) Java RMI, ORB $B$K$O8!:w5!G=$,$"$k!#(B}

$B$3$3$G:n$k(B Name Server $B$O<!$N$h$&$J$b$N$G$"$k!#(B
\\\( NS : ID \rightarrow \{ free, used \} \)

$B$3$N(B NS $B$KBP$7$F$O<!$NFs$D$NA`:n$r9T$&!#(B
\begin{eqnarray*}
get &:& NS \rightarrow ID \times NS
\\
release &:& NS \times ID \rightarrow NS
\end{eqnarray*}
\\
\( get(ns) = (id, ns \setminus \{ (id, free) \} \cup \{ (id, used) \}) \)
\\
\( release(ns, id) =
 ns \setminus \{ (id, used) \} \cup \{ (id, free) \} \)

NS $B$N5!G=$OJQ?tI=!JG[Ns!K$K4^$a$k$3$H$,2DG=$G$"$k$,!"(B
$B?7$7$$(B ID $B$r(B \( O(1) \) $B$G<hF@$9$k$?$a$K(B
$BL$;HMQ(B ID $B$r%j%9%H$G4IM}$9$k!#(B
%
$B%j%9%H$N07$$$O(B C $B8@8l$h$j(B KL1 $B8@8l$NJ}$,F@0U$H$7$F$$$k$N$G!"(B
NS $B$O(B KL1 $B8@8l$K$h$C$F5-=R$7!"(B
C $B8@8l$K$h$C$F5-=R$9$kJQ?tI=%*%V%8%'%/%H$H$OJL%W%m%;%9$H$9$k!#(B
%
$B$^$?!"%8%'%M%j%C%/%*%V%8%'%/%H$h$j$b(B KL1 $B%W%m%;%9$NJ}$,!"(B
$BB>$N(B KL1 $B%W%m%;%9$+$i$N%"%/%;%9$,MF0W$G$"$k$H$$$&M}M3$b$"$k!#(B

\begin{verbatim}
ns(NS, Free) :- NS = [get(ID) | NS1] |
  Free = [ID | Free1],
  ns(NS1, Free1).
ns(NS, Free) :- NS = [release(ID) | NS1] |
  Free1 = [ID | Free],
  ns(NS1, Free1).
\end{verbatim}
$B35G0E*$K$O>e$N$h$&$J(B NS $B$r:n$k$,!"(B
ID $B6u4V$,<B:]$K$OM-8B$G$"$k$3$H$r9MN8$9$kI,MW$,$"$k!#(B

$BNc$($P!"(B
$BL$;HMQ(B ID $B$,$J$$;~$K(B get $B$5$l$?$iJQ?tI=$r9-$2$k!#(B
%
$BJQ?tI=$,=L$s$@$iL$;HMQ(B ID $B$r:F7W;;$9$k!#(B

$BJQ?tI=!JG[Ns!K$N%$%s%G%/%9$rI=$9@0?t$r(B ID $B$H$7$F;HMQ$9$k!#(B

%---------------------------------------------------------------

\section{ $BJQ?tI=%*%V%8%'%/%H(B \T }

\newcommand{\Add}{ add }
\newcommand{\Remove}{ remove }
\newcommand{\GetID}{ getID }
\newcommand{\Get}{ get }
\newcommand{\Set}{ set }

$BJQ?tI=%*%V%8%'%/%H$O<!$N$h$&$J$b$N$G$"$k!#(B

\( Table =\Def 2^{Dist} \ni \{ (id, var) \} \)

\begin{eqnarray}
\forall i, j;
(id_i, var_i), (id_j, var_j) \in table \Rightarrow
\nonumber\\
\Tab (id_i = id_j \Leftrightarrow var_i = var_j)
\label{eq:distinct}
\end{eqnarray}
%
$BO@M}JQ?tF1;N$NF10l@-$rH=Dj$9$k$3$H$,2DG=$G$"$k$3$H$rA0Ds$H$9$k!#(B
%
$BF10l$NO@M}JQ?t$,F10l$NJQ?tI=$K$*$$$F(B
$BJ#?t$N0[$J$k%(%s%H%j$r;}$D$3$H$O$J$$(B (\ref{eq:distinct})$B!#(B

\begin{eqnarray}
&& State = Table \times NS
\nonumber\\
&& \forall id, ns, table;
\nonumber\\
&& \Tab (ns(id) = used \Leftrightarrow (id, var) \in table) \wedge
\nonumber\\
&& \Tab (ns(id) = free \Leftrightarrow (id, var) \not\in table)
\label{eq:encapsulated}
\end{eqnarray}
%
$BJQ?tI=%*%V%8%'%/%H$O(B NS $B$HO"F0$9$k!#(B
$BJQ?tI=%*%V%8%'%/%H$O(B NS $B$NFbIt$K1#JC$7!"(B
$BB>$N%W%m%;%9$+$iD>@\A`:n$5$l$J$$$h$&$K$9$k(B
(\ref{eq:encapsulated})$B!#(B

NS $B$O<!$N%a%=%C%I$K$h$C$FJQ?tI=%*%V%8%'%/%H$rA`:n$9$k!#(B
\begin{enumerate}
\item $B%3%s%9%H%i%/%?(B {\In}Length, {\Nio}Report

\item $B%$%Y%s%H(B gc ({\Out}Length)
\\
$B%m!<%+%k%[%9%HFb$G(B GC $B$,9T$o$l$F$$$k$3$H$r<($9%$%Y%s%H!#(B
%
$BJQ?tI=%*%V%8%'%/%H$O<+J,<+?H$r?7NN0h$X%3%T!<$9$k$,!"(B
$B%(%s%H%j(B \E $B$r%3%T!<$7$J$$!#(B
%
GC $B=*N;D>8e$KGQIJ$H$7$F2s<}$5$l$?(B \E $B$N8e;OKv$r$9$k!#(B

\item io $B$+$i$N%a%C%;!<%8(B \Add \Out\id, {\Nio}Var, ({\Out}Length)
\\
io $B$,JQ?tI=%*%V%8%'%/%H$KEPO?$5$l$F$$$J$$O@M}JQ?t$rM"=P$7$?$$;~!"(B
$B$^$?$O(B io $B$,1s3V%[%9%H$+$i(B \OpenMessage $B$r<u$1<h$C$?;~$K(B
$BH/$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( \Add: State \times Var \rightarrow ID \times State \)
\\
\( \Add(table, ns, var) =
\\ \Tab (id, table \cup \{ id \}, ns_1)
\\ \Where get(ns) = (id, ns_1) \)

\item io $B$+$i$N%a%C%;!<%8(B \Remove \In\ID
\\
io $B$,1s3V%[%9%H$+$i(B \String{\Name{ID}=Removed}
$B$r<u$1<h$C$?;~$KH/$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( \Remove: State \times ID \rightarrow State \)
\\
\( \Remove(table, ns, id) =
\\ \Tab (table \setminus \{ (id, var) \}, release(ns, id)) \)

\item io $B$+$i$N%a%C%;!<%8(B \GetID \Out\ID, {\Nio}Var
\\
io $B$,JQ?tI=%*%V%8%'%/%H$KEPO?:Q$_$NJ,;6O@M}JQ?t$r1s3V%[%9%H$KAw?.$7$?$$;~!"(B
$B%m!<%+%k%[%9%HFb$NO@M}JQ?t$KBP1~$9$k(B ID $B$rMW5a$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( \GetID: State \times Var \rightarrow ID \)
\\
\( \GetID(table, ns, var) = id
\\ \Where (id, var) \in table \)

\item io $B$+$i$N%a%C%;!<%8(B \Get \In\ID, {\Nio}Var
\\
io $B$,1s3V%[%9%H$+$i(B \String{\Name{ID}} $B$r<u$1<h$C$?;~$K!"(B
ID $B$KBP1~$9$k%m!<%+%k%[%9%HFb$NO@M}JQ?t$rMW5a$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( \Get: State \times ID \rightarrow Var \times State \)
\\
\( \Get(table, ns, id) = (var, table, ns)
\\ \Where (id, var) \in table \)

\item io $B$+$i$N%a%C%;!<%8(B \Set \In\ID, {\In}Bound
\\
io $B$,1s3V%[%9%H$+$i(B \String{\Name{ID}=\var{Bound}}
$B$r<u$1<h$C$?;~$KH/$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( \Set: State \times Constraints \times ID \times Bound \rightarrow
\\ \Tab State \times Constraints \)
\\
\( \Set(table, ns, constraints, id, bound) =
\\ \Tab (table \setminus \{ (id, var) \}, release(ns, id),
\\ \Tab constraints \cup \{ var = bound \}) \)

\item io $B$+$i$N%a%C%;!<%8(B \Fuse \In\ID, \In\ID1
\\
io $B$,1s3V%[%9%H$+$i(B \String{\Name{ID}=\Name{ID1}}
$B$r<u$1<h$C$?;~$KH/$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( \Fuse: State \times ID \times ID \rightarrow State \)
\\
\( \Fuse(table, ns, id, id_1) =
\\ \Tab (table \setminus \{ (id, var), (id_1, var_1) \} \cup
\\ \Tab \{ (id_1, var) \}, release(ns, id) ) \)

\item \E $B$+$i$N%a%C%;!<%8(B \Bound \In\ID, {\In}Bound
\\
\E $B$,6qBN2=$5$l$?;~$KH/$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( \Bound: State \times ID \times Bound \rightarrow State \)
\\
\( \Bound(table, ns, id, bound) =
\\ \Tab remove(table, ns, id) \)

\item \E $B$+$i$N%a%C%;!<%8(B fused \In\ID, {\In}Var
\\
\E $B$,B>$N(B \E $B$HC10l2=$5$l$?;~$KH/$9$k%a%C%;!<%8$G$"$k!#(B
\\
\( fused: State \times ID \times Var \rightarrow State \)
\\
\( fused(table, ns, id, var)
\\ = (table, ns) \If id < \GetID(var)
\\ = \Remove(table, ns, id) \If id > \GetID(var) \)

\item \E $B$+$i$N%a%C%;!<%8(B removed \ID
\\
\E $B$,(B KLIC $B$N(B GC $B%U%'%$%:Cf$K?7NN0h$X%3%T!<$5$l$J$+$C$?;~!"(B
$BGQ4~$5$l$kD>A0$KH/$9$k%a%C%;!<%8$G$"$k!#(B
\end{enumerate}

\begin{verbatim}
vt(VT, T, NS) :- VT = [add(ID,X) | VT1] |
  NS = [get(ID) | NS1],
  T1 = [(ID,X) | T],
  vt(VT1, T1, NS1).
vt(VT, T, NS) :- VT = [remove(ID) | VT1] |
  remove(T, ID, T1),
  NS = [release(ID) | NS1],
  vt(VT1, T1, NS1).
vt(VT, T, NS) :- VT = [get(ID,X) | VT1] |
  get(T, ID, X, T1),
  vt(VT1, T1, NS).
vt(VT, T, NS) :- VT = [set(ID,Bound) | VT1] |
  set(T, ID, Bound, T1),
  vt(VT1, T1, NS).
vt(VT, T, NS) :- VT = [fuse(ID,ID1) | VT1] |
  fuse(T, ID, ID1, T1),
  vt([remove(ID) | VT1], T1, NS).
vt(VT, T, NS) :- VT = [bound(ID,X) | VT1] |
  remote(set(ID,X)),
  vt([remove(ID)|VT1], T, NS).
vt(VT, T, NS) :- VT = [fused(ID,ID1) | VT1] |
  remote(fuse(ID,ID1)),
  vt([remove((ID)) | VT1], T, NS).
\end{verbatim}
$B35G0E*$K$O>e$N$h$&$JJQ?tI=%*%V%8%'%/%H$r:n$j$?$$!#(B

NS $B$K(B ID $B6u4V$,8O3i$7$?$H8@$o$l$?>l9g!"<+J,<+?H$r9-$2$k!#(B
$B<+J,<+?H$r=L$a$?>l9g!"(BNS $B$K(B ID $B6u4V$r=L$a$m$H8@$&!#(B

\vspace{1em}

$B0J>e$G!"(Bdklicio $B$N@_7W$r=*$($k!#(B
$B<!>O$G$O!"(Bdklicio $B$N<BAu$r9T$&!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% DKLIC $B=hM}7O$N<BAu(B

\chapter{ dklicio $B$N<BAu(B \Comment{(Implementation)} }
\label{impl}

$BA0>O$G$O!"(BDKLIC $B=hM}7O$N:G2<0L%5!<%P$G$"$k(B dklicio $B$N@_7W$r9T$C$?!#(B
%
$BK\>O$G$O!"(Bdklicio $B$N<BAu$K$D$$$F2r@b$9$k!#(B

%---------------------------------------------------------------

\section{ $BJ,;6O@M}JQ?t%*%V%8%'%/%H(B }

$BJ,;6O@M}JQ?t$O!"%m!<%+%k%[%9%HFb$N;2>H$,(B
$B$J$/$J$C$?$3$H$r8!=P$G$-$kI,MW$,$"$k!#(B
%
$B$^$?!"L$Dj5AJQ?tF1;N$ND>7k$r8!=P$9$kI,MW$,$"$k!#(B

KLIC $B=hM}7O$GL$Dj5AJQ?t$rI=8=$9$k%*%V%8%'%/%H$O(B
$B=c?hL$Dj5AJQ?t$HCfCG860xJQ?t$,$"$k!#(B
%
$BCfCG860xJQ?t$O!"(B
$BCfCG%4!<%k$d%3%s%7%e!<%^%*%V%8%'%/%H$,%U%C%/$5$l$?CfCG9=B$$+!"(B
$B%8%'%M%l!<%?%*%V%8%'%/%H$KJ,N`$5$l$k(B \cite{inside}$B!#(B
\begin{enumerate}
\item $B=c?hL$Dj5AJQ?t(B.
$B$^$@0lEY$b6qBNCM$rFI$_9~$^$l$?$3$H$,$J$$L$Dj5AJQ?t$G$"$k!#(B
KLIC $B=hM}7O$K$*$$$F$O<+J,<+?H$r;X$9%]%$%s%?$H$7$FI=8=$5$l$k(B

\item $BCfCG860xJQ?t(B (susp).
$B$3$NJQ?t$N6qBNCM$rFI$_9~$s$GCfCG$7$?(B
$B%*%V%8%'%/%H$,%U%C%/(B (hook) $B$5$l$F$$$kJQ?t$G$"$k(B
\begin{enumerate}
\item $BCfCG9=B$(B.
$B0l$D$NCfCG9=B$$K$OJ#?t$NCfCG%4!<%k$d(B
$B%3%s%7%e!<%^%*%V%8%'%/%H$r%U%C%/$9$k$3$H$,$G$-$k(B

\item $B%8%'%M%l!<%?%*%V%8%'%/%H(B.
$B%8%'%M%l!<%?%*%V%8%'%/%H$O>o$K<+J,<+?H$N$_$r%U%C%/$7$F$$$k!#(B
$BCfCG9=B$$HD>7k$5$l$k$H(B generate $B%a%=%C%I$,8F$S=P$5$l!"(B
$B6qBNCM$dCfCG9=B$$r@8@.$9$k=hM}$,9T$o$l$k!#(B
$B$=$N8e!"(BKLIC $B=hM}7O$,$=$N7k2L$r(B
$BD>7kAj<j$G$"$kCfCG9=B$$K=q$-9~$`(B
\end{enumerate}
\end{enumerate}

$B$3$N$&$A!"B>$NL$Dj5AJQ?t$H$ND>7k$r8!=P$G$-$k$N$O(B
$B%8%'%M%l!<%?%*%V%8%'%/%H$N$_$G$"$k!#(B
$BCfCG9=B$$,B>$NL$Dj5AJQ?t$HD>7k$5$l$k$H!"(B
KLIC $B=hM}7O$OCfCG9=B$$N%U%C%/72$rC1$K%^!<%8$7!"(B
$B$=$l$i$N%U%C%/72$K$OD>7k$rJs9p$7$J$$!#(B
$B=>$C$F!"J,;6O@M}JQ?t$O%8%'%M%l!<%?%*%V%8%'%/%H$H$7$F<BAu$9$kI,MW$,$"$k!#(B

\subsection{ fusesusp }

$BJ,;6O@M}JQ?t$rI=8=$9$k%8%'%M%l!<%?%*%V%8%'%/%H(B fusesusp
$B$O<!$N;0$D$N%a%s%P$r;}$D!#(B
\begin{enumerate}
\item id.
$B$3$N(B fusesusp $B$N<1JL;R$G$"$k!#(B
$B<1JL;R$NFbMF$O(B fusesusp $B$N%b!<%I$K$h$C$F0[$J$k!#(B

\item repo.
$B$3$N(B fusesusp $B$,6qBN2=!"D>7k!"GQ4~$5$l$?$i!"(B
$B$=$N;]$r<1JL;R$H6&$KJs9p$9$k!#(B
$BJs9p@h$O(B fusesusp $B$N%b!<%I$K$h$C$F0[$J$k!#(B

\item susp.
$B$3$N(B fusesusp $B$N6qBNCM$rFI$_9~$s$GCfCG$7$?(B
$BCfCG%4!<%k$d%3%s%7%e!<%^%*%V%8%'%/%H$r%U%C%/$7$F$$$kCfCG860xJQ?t$G$"$k!#(B
\end{enumerate}

fusesusp $B$O%8%'%M%l!<%?%*%V%8%'%/%H$G$"$k$N$G!"(B
$B6qBN2=!"D>7k!"GQ4~$5$l$?$3$H$r8!=P$9$k$3$H$,$G$-$k!#(B
\begin{enumerate}
\item $B$3$N(B fusesusp $B$K6qBNCM(B \Term $B$,=q$-9~$^$l$k$H!"(B
fusesusp $B$O(B susp $B$K(B \Term $B$r=q$-9~$_!"(B
repo $B$K6qBN2=(B bound(id, \Term) $B$rJs9p$9$k!#(B

\item
\begin{enumerate}
\item fusesusp $B0J30$NJQ?t(B X $B$HD>7k$5$l$k$H!"(B
fusesusp $B$O(B susp $B$H(B X $B$rD>7k$9$k!#(B
%
$B$9$k$H(B KLIC $B=hM}7O$,(B susp $B$H(B X $B$N%U%C%/$r%^!<%8$9$k!#(B

\item $BB>$N(B fusesusp $B$HD>7k$5$l$k$H!"8_$$$N(B susp $B$rD>7k$9$k!#(B
%
$B$9$k$H(B KLIC $B=hM}7O$,APJ}$N%U%C%/$r%^!<%8$9$k!#(B
\end{enumerate}
\end{enumerate}

\begin{figure}
\figu{0.8}{mode}
\caption{ channel and its modes }
\end{figure}

\begin{figure}
\figu{0.7}{fusesusp-in}
\hspace{3em}
\figu{0.7}{fusesusp-out}
\caption{ fusesusp (in and out) }
\end{figure}

fusesusp $B$O(B in/out $B$$$:$l$+$N%b!<%I$r;}$D!#(B
\begin{enumerate}
\item fusesusp(in) $B$O(B in $B%b!<%I$NJ,;6O@M}JQ?t$rI=$9!#(B
fusesusp(in) $B$N%a%s%P$O<!$N$h$&$J0UL#$r;}$D!#(B

id. \ID@\Host $B$H$$$&7A$NBg0h<1JL;R$H$9$k$,!"(B
C $B8@8l$K$h$C$F5-=R$9$k(B fusesusp $B$KITMW$JCN<1$r;}$?$;$J$$$?$a!"(B
fusesusp $B$O(B id $B$NFbIt7A<0$K$D$$$F2?$i2>Dj$rCV$+$J$$$h$&$K$9$k!#(B

repo. $BJQ?tI=$X$NJs9p%9%H%j!<%`$G$"$k!#(B

fusesusp(in) $B$OB>$N(B fusesusp(in) $B$HD>7k$5$l$k$3$H$O$J$$!#(B
$B$J$<$J$i!"(BDKLIC $B=hM}7O$O%b!<%IIU$-$N(B
$B%"%W%j%1!<%7%g%s$rA0Ds$H$7$F$$$k$+$i$G$"$k!#(B

fusesusp(out) $B$HD>7k$5$l$k$H!"(B
fusesusp(in) $B$O(B fusesusp(out) $B$N(B repo $B$N%U%C%/(B
bindhook:ID@Host $BKh$K(B repo $B$K(B fused(id, ID@Host) $B$rJs9p$9$k!#(B
%
$B$=$N8e!"(Bfusesusp(out) $B$N(B repo $B$K(B id $B$r=q$-9~$`!#(B
$B$3$l$O(B fusesusp(out) $B$,(B id $B$HD>7k$5$l$?$3$H$NJs9p$G$"$k$,!"(B
$B%8%'%M%j%C%/%*%V%8%'%/%HFb$G%U%!%s%/%?$r9=C[$9$k$N$,LLE]$G$"$k$N$G(B
C $B8@8l$K$h$k5-=RItJ,$r8:$i$9$?$a$K4JN,2=$7$?!#(B
$B$3$N!VD>7kJs9p!W$r<u$1<h$k$N$O(B fusesusp(out) $B$N(B bindhook $B$G$"$k$N$G!"(B
bindhook $B$,$3$N%a%C%;!<%8$r@5$7$/2r<a$9$k8B$jLdBj$O5/$-$J$$!#(B

\item fusesusp(out) $B$O(B out $B%b!<%I$NJ,;6O@M}JQ?t$KBP1~IU$1$i$l$?(B
$B%m!<%+%k%[%9%HFb$NO@M}JQ?t$rI=$9!#(B
fusesusp(out) $B$N%a%s%P$O<!$N$h$&$J0UL#$r;}$D!#(B

id. id $B$OB>$N(B fusesusp $B$HD>7k$5$l$?;~$KMxMQ$9$k$b$N$G$"$k$,!"(B
fusesusp(out) $BF1;N$N6hJL$OITMW$G$"$k$N$G!"(B
$BA4$F$N(B fusesusp(out) $B$N<1JL;R$O(B out $B$H$9$k!#(B

repo. $B$3$N(B fusesusp $B$N6qBN2=$rBT$D(B bindhook $B$X$NJs9p%9%H%j!<%`$G$"$k!#(B

fusesusp(out) $B$O(B fusesusp(in) $B$HD>7k$5$l$k$H!"(B
$B<+J,$HD>7kAj<j$r5UE>$7$FA0=R$N(B in--out $BD>7k=hM}$r9T$J$&!#(B

$BB>$N(B fusesusp(out) $B$HD>7k$5$l$k$H!"(B
$BD>7kAj<j$N(B repo $B$N%U%C%/(B bindhook:ID@Host $BKh$K(B
$B<+J,$N(B repo $B$K(B fused(out, ID@Host) $B$rJs9p$9$k!#(B
%
$B$=$N8e!"APJ}$N(B repo $B$rD>7k$9$k!#(B
$B$9$k$H(B KLIC $B=hM}7O$,APJ}$N(B repo $B$r%^!<%8$9$k!#(B
\end{enumerate}

\begin{figure}
\figu{0.6}{fused1}
\caption{ fusion of out--out to same remote host }
\end{figure}

\begin{figure}
\figu{0.7}{fused2}
\caption{ fusion of in--out to same remote host }
\end{figure}

\begin{figure}
\figu{0.6}{fused3}
\caption{ fusion of out--out to different remote hosts }
\end{figure}

\begin{figure}
\figu{0.7}{fused4}
\caption{ fusion of in--out to different remote hosts }
\end{figure}

\subsection{ bindhook }

bindhook $B$O(B fusesusp(out) $B$N(B repo $B$K%U%C%/$5$l$kCfCG%4!<%k$G$"$k!#(B
fusesusp(out) $B$K6qBNCM$,=q$-9~$^$l$k$H!"(Bbindhook $B$O3F!9$NC4Ev$9$k(B
$B1s3V%[%9%H$X6qBN2=$rJs9p$9$k!#(B
$B$9$J$o$A!"(Bbindhook $B$O3F!9(B out $B%b!<%I$NJ,;6O@M}JQ?t$rI=$9!#(B

$B0l$D$NO@M}JQ?t$NFI$_<j$,J#?t$N1s3V%[%9%H$KJ,;6$7$F$$$k>l9g!"(B
$B$=$NO@M}JQ?t(B fusesusp(out) $B$N6qBN2=$OJ#?t$N1s3V%[%9%H$K(B
$B%^%k%A%-%c%9%H$9$kI,MW$,$"$k!#(B
%
$B$3$N$?$a!"0l$D$N(B fusesusp(out) $B$KJ#?t$N(B bindhook $B$r%U%C%/$9$k!#(B

bindhook $B$O<!$N;0$D$N%a%s%P$r;}$D!#(B
\begin{enumerate}
\item ID@Host. $B$3$N(B bindhook $B$N<1JL;R$G$"$k(B
\item X. $B$3$N(B bindhook $B$,%U%C%/$7$F$$$k(B fusesusp(out) $B$N(B repo $B$G$"$k(B
\item Repo. $B$3$N(B bindhook $B$N6qBN2=$rBT$DJQ?tI=$X$NJs9p%9%H%j!<%`$G$"$k(B
\end{enumerate}

bindhook $B$O%U%C%/$7$F$$$k(B fusesusp(out) $B$+$i(B
$B6qBN2=!"D>7k!"GQ4~Js9p$r<u$1$k!#(B
\begin{enumerate}
\item X $B$K(B bound(out, \Term) $B$,Js9p$5$l$?$i!"(B
bindhook $B$O(B Repo $B$K(B bound(ID, \Term) $B$rJs9p$7$F=*N;$9$k!#(B

\item X $B$K(B ID1@Host1 $B$,=q$-9~$^$l$?$i!"(B
$B$3$N(B bindhook $B$,%U%C%/$7$F$$$k(B fusesusp(out) $B$,(B
fusesusp(in):ID1@Host1 $B$HD>7k$5$l$?$3$H$r0UL#$7$F$$$k!#(B

\begin{enumerate}
\item Host $B$H(B Host1 $B$,F1$8$J$i$P!"(B
ID=ID1 $B$N6qBNCM$r=q$-<j$G$"$k1s3V%[%9%H$KJs9p$9$kI,MW$O$J$$$N$G!"(B
bindhook $B$OD>7k(B fused(ID, ID1) $B$rJs9p$7$F=*N;$9$k!#(B

\item Host $B$H(B Host1 $B$,0[$J$k>l9g!"(B
ID@Host $B$,4V@\M"=P$5$l$?$3$H$r<($7$F$$$k$N$G!"(B
bindhook $B$OJQ?tI=$K4V@\M"=P%a%C%;!<%8(B
exporting(ID) $B$rJs9p$7$F=*N;$9$k!#(B
\end{enumerate}

\item X $B$K(B fused(out, ID1@Host1) $B$,Js9p$5$l$?$i!"(B
$B$3$N(B bindhook:ID@Host $B$r%U%C%/$7$F$$$k(B fusesusp(out) $B$,(B
bindhook:ID1@Host1 $B$r%U%C%/$7$F$$$kB>$N(B
fusesusp(out) $B$HD>7k$5$l$?$3$H$r<($9!#(B

\begin{enumerate}
\item Host $B$H(B Host1 $B$,F1$8$J$i$P!"F1$81s3V%[%9%H$K(B
ID=ID1 $B$N6qBNCM$rFsEYJs9p$9$kI,MW$O$J$$$N$G!"(B
bindhook:ID@Host $B$OD>7k(B fused(ID, ID1) $B$rJs9p$7$F=*N;$9$k!#(B
%
$B$D$^$j!"0l$D$N(B fusesusp(out) $B$K(B bindhook:ID@Host $B$H(B
bindhook:ID1@Host $B$,%U%C%/$5$l$J$$$h$&$K$9$k!#(B

\item Host $B$H(B Host1 $B$,0[$J$k>l9g!"(BID@Host=ID1@Host1
$B$O%m!<%+%k%[%9%H$+$i$N%^%k%A%-%c%9%H$G$"$k$N$G!"(B
bindhook:ID@Host $B$O2?$b$9$kI,MW$O$J$$!#(B
\end{enumerate}
\end{enumerate}

\begin{figure}
\fig{fusesusp}
\caption{ fusesusps and bindhooks }
\end{figure}

%---------------------------------------------------------------

\section{ $BJQ?tI=%*%V%8%'%/%H(B }

\newcommand{\gcvt}{gc\_variable\_tables}

dklicio $B$O!"1s3V%[%9%H$K@\B3$5$l$?%=%1%C%HKh$K0l$D(B
$B$NJQ?tI=$r%m!<%+%k%[%9%HFb$K@8@.$9$k!#(B
%
$B%=%1%C%H$r@\B3$7$?%/%i%$%"%s%H%[%9%HB&$K$"$k$+(B
$B@\B3$5$l$?%5!<%P%[%9%HB&$K$"$k$+$K$h$C$F!"(B
$BJQ?tI=$O(B Side = client / server $B$N$$$:$l$+$NB0@-$r;}$D!#(B

$B%/%i%$%"%s%H%[%9%H$O(B open $B$9$kJ,;6JQ?t$K(B
$B6v?t$+$i@.$k(B ID $B$r3d$jEv$F$k!#(B
$B%5!<%P%[%9%H$O4q?t$K4p$E$$$F(B ID $B$r@8@.$9$k!#(B
$B$3$N$3$H$K$h$C$F!"%/%i%$%"%s%H%[%9%HB&!&%5!<%P%[%9%HB&$G(B
$B3d$jEv$F$i$l$k(B ID $B6u4V$OJ,N%$5$l$F$$$k!#(B

\Opener $B$,$I$A$iB&$G$"$k$+$K$h$C$F(B
\Closer $B$,$I$A$iB&$G$"$k$+$,7hDj$5$l$kLu$G$O$J$$$N$G!"(B
$B$?$H$(JQ?tI=$rM"=PI=$HM"F~I=$KJ,3d$7$F$b(B
$B$=$l$i$rFHN)$K07$&$3$H$O$G$-$J$$!#(B
%
$B$^$?!"(B\Closer $B$K$h$C$FJQ?tI=$rJ,3d$7$?$H$7$F$b(B
$B$d$O$j(B \Opener $B$N(B ID $B6u4V$OJ,N%$7$J$1$l$P$J$i$J$$!#(B
$B$$$:$l$K$;$h!"JQ?tI=$rFHN)$JItJ,I=$KJ,3d$9$k$3$H$O$G$-$J$$!#(B

KLIC $B$N(B GC $B%U%'%$%:$GJQ?tI=$+$iJ,;6JQ?t$X$N(B
$B;2>H$r$?$I$C$F@8B8@-$rH=CG$7$F$O$J$i$J$$!#(B
%
$B$3$N$?$a!"JQ?tI=$O(B KLIC $B$N(B GC $B%U%'%$%:$K$*$1$k%3%T!<=hM}$r(B
KLIC $B=hM}7O$KG$$;$:<+J,$G9T$&%G!<%?%*%V%8%'%/%H$H$7$F<BAu$9$k!#(B

$BJQ?tI=%*%V%8%'%/%H$N%I%i%$%P$G$"$kJQ?t%M!<%`%5!<%P$O!"(B
$B<!$N%a%=%C%I$K$h$C$FJQ?tI=%*%V%8%'%/%H$rA`:n$9$k!#(B
\begin{enumerate}
\item state. $B8=:_$N(B ID $B$N>uBV$r<hF@$9$k%a%=%C%I$G$"$k(B
\item set\_state. ID $B$N>uBV$rJQ99$7$??7$?$JCM$rJV$9%a%=%C%I$G$"$k(B
\item id. ID $B$r<hF@$9$k%a%=%C%I$G$"$k(B
\item var. ID $B$NCM$r<hF@$9$k%a%=%C%I$G$"$k(B
\item add. $B%(%s%H%j$rDI2C$7$??7$?$JI=$rJV$9%a%=%C%I$G$"$k(B
\item bind. ID $B$K6qBNCM$r=q$-9~$s$G?7$?$JI=$rJV$9%a%=%C%I$G$"$k(B
\item fuse. ID $B$HB>$N(B ID1 $B$rD>7k$7$F?7$?$JI=$rJV$9%a%=%C%I$G$"$k(B
\item remove. $B%(%s%H%j(B ID $B$r:o=|$7$??7$?$JI=$rJV$9%a%=%C%I$G$"$k(B
\end{enumerate}

KLIC $B$N(B GC $B%U%'%$%:$,5/$-!"(BKLIC $B=hM}7O$+$i(B
$BJQ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"(B
\gcvt $B4X?t$O%$%s%9%?%s%9%a%=%C%I$G$J$/(B
$B%/%i%9%a%=%C%I$G$J$1$l$P$J$i$J$$!#(B
%
\gcvt $B4X?t$,%m!<%+%k%[%9%HFb$K$"$kA4$F$NJQ?tI=$r07$&$?$a!"(B
$BJQ?tI=$O%R!<%W>e$N%$%s%9%?%s%9JQ?t$G$J$/(B
$B@EE*$J%/%i%9JQ?t$rDL$7$F%j%9%H4IM}$7$F$*$/I,MW$,$"$k!#(B

%---------------------------------------------------------------

\section{ $BJQ?t%M!<%`%5!<%P(B }

$BJQ?t%M!<%`%5!<%P$OJQ?tI=%*%V%8%'%/%H$N%I%i%$%P$G$"$j!"(B
$BBh(B\ref{design}$B>O$G=R$Y$?%M!<%`%5!<%P$KAjEv$9$k!#(B

C $B8@8l$K$h$k5-=RItJ,$r>.$5$/C1=c$K$9$k$?$a!"(B
$BJQ?tI=%*%V%8%'%/%H$OHs>o$KC1=c$J%G!<%?%*%V%8%'%/%H$H$7$?!#(B
%
$B$7$+$7!"JQ?tI=$OJQ2=$9$k>uBV$r;}$D%W%m%;%9$G$"$k!#(B
$B=>$C$F!"JQ?tI=$OITJQ$NCM$H$7$F$G$O$J$/(B
$B%W%m%;%9$H$7$F$N%$%s%?%U%'%$%9$r;}$D$Y$-$G$"$k!#(B
%
$BJQ?t%M!<%`%5!<%P$O!"(B
$BCM$H$7$F$N%$%s%?%U%'%$%9$7$+;}$?$J$$JQ?tI=%*%V%8%'%/%H$KBP$7$F(B
$B%W%m%;%9$H$7$F$N%$%s%?%U%'%$%9$r(B decorate $B$9$k!#(B

$BJQ?t%M!<%`%5!<%P$O(B vt, repo $B$NFs$D$NI{%W%m%;%9$+$i@.$k!#(B

vt $BI{%W%m%;%9$O<!$N$h$&$JDL?.O)$r;}$D!#(B
\begin{enumerate}
\item $B%/%i%$%"%s%H(B repo $B$+$i$N(B close $BMW5a%9%H%j!<%`(B
\item $B%/%i%$%"%s%H(B dklicio:varin $B$+$i$N(B
 var, bind, fuse, remove $BMW5a%9%H%j!<%`(B VTi
\item $B%/%i%$%"%s%H(B dklicio:varout $B$+$i$N(B id $BMW5a%9%H%j!<%`(B VTo
\item $BJQ?tI=$KEPO?$5$l$?(B fusesusp(in) / bindhook
$B$+$i$NJs9p%9%H%j!<%`$+$i@.$k%Y%/%?(B
% \item $BJQ?tI=%*%V%8%'%/%H(B
\end{enumerate}

repo $BI{%W%m%;%9$O<!$N$h$&$JDL?.O)$r;}$D!#(B
\begin{enumerate}
\item $BJQ?tI=$KEPO?$5$l$?(B fusesusp(in) / bindhook
$B$+$i$NJs9p%9%H%j!<%`$r0lK\$K%^!<%8$7$?%9%H%j!<%`(B Repo
\item vt $B$X$N(B close $BMW5a%9%H%j!<%`(B
\end{enumerate}

%---------------------------------------------------------------

\section{ $B%b%8%e!<%k(B dklicio }

$B%b%8%e!<%k(B dklicio $B$O(B varin / varout $B$H$$$&(B
$BFs$D$NI{%W%m%;%9$+$i@.$k!#(B

varin / varout $B$O$=$l$>$l(B
unwrap / wrap $BItJ,=hM}$rMxMQ$7$F$$$k!#(B

varin $B$+$i(B vaout $B$X$O(B fflush $BMW5a%9%H%j!<%`$,DL$8$F$$$k!#(B

fflush/1 $B%a%C%;!<%8$K$h$C$F(B KLIC $B=hM}7O$,%P%C%U%!$N=q$-=P$7(B
$B$r9T$&$H$9$k$H!"(Bfflush/1 $B%a%C%;!<%8$rE,EY$KM^@)$9$k$3$H$G(B
$B%a%C%;!<%8DL?.$N%P%C%U%!%j%s%0$r9T$&$3$H$K$J$k!#(B

$B$7$+$7!"F~NO$+$i$NFI$_9~$_D>A0$K(B fflush $B$r9T$&$H$$$&5,Ls$O(B
$BDL?.CY1d$rL5;k$G$-$kI8=`F~=PNO$KBP$9$k$b$N$G$"$C$F!"(B
$BJ,;64D6-$K$*$$$F$3$N5,Ls$,E,@Z$G$"$k$+H]$+$O(B
$B<B:]$NDL?.>uBV$rDjNL2=$7$F9M;!$9$kI,MW$,$"$k!#(B

$B62$i$/$3$N5,Ls$O:GE,$G$O$J$$$,!"(B
$B9`$r=PNO$9$kEY$K(B fflush $B$r9T$&4{B8$N;n:n$b$d$O$j:GE,$G$O$J$$$G$"$m$&!#(B
%
$B$^$?!"(Bfflush/1 $B%a%C%;!<%8$K$h$C$F<B:]$K%P%C%U%!%j%s%0$,9T$o$l$k$+H]$+$O(B
$B2<0L%M%C%H%o!<%/$K$b0MB8$9$k$G$"$m$&!#(B

\begin{figure}
\fig{dklicio}
\caption{ dklicio and \T }
\end{figure}

\vspace{1em}

$B0J>e$G!"(BDKLIC $B=hM}7O$N<BAu$r=*$($k!#(B
%
$B<!>O$G$O!"(BDKLIC $B=hM}7O$K$D$$$FI>2A$H9M;!$r9T$&!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{ DKLIC $B=hM}7O$NI>2A$H9M;!(B \Comment{(Evaluation)} }
\label{eval}

$BA0>O$G$O!"(BDKLIC $B=hM}7O$r<BAu$7$?!#(B
%
$BK\>O$G$O!"(BDKLIC $B=hM}7O$K$D$$$FI>2A$H9M;!$r9T$&!#(B

%---------------------------------------------------------------

\section{ $B4{B8$N;n:n$+$i$N2~NIE@(B }

DKLIC $B=hM}7O$N4{B8$N;n:n(B \cite{DKLIC}, \cite{SPA2001}, \cite{takayama}
$B$G$OL$Dj5AJQ?tF1;N$ND>7k$r8!=P$9$k$3$H$,$G$-$J$+$C$?!#(B
%
$BK\8&5f$G$OL$Dj5AJQ?tF1;N$ND>7k$r8!=P$9$k$3$H$K$h$C$F!"(B
$BFs=EAw?.$NKI;_!"Cf7Q$NGS=|$r9T$&$3$H$r2DG=$K$7$?!#(B

$B$^$?!"4{B8$N;n:n$G$OJ,;6O@M}JQ?t$N(B ID $B$N:FMxMQ$,9T$o$l$F$$$J$+$C$?!#(B
%
$BK\8&5f$G$O(B ID $B$r:FMxMQ$7$FNI$$%?%$%_%s%0$H!"(B
$B%[%9%H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k$$$O(B IP $B%"%I%l%9$K$h$C$F%[%9%H$rFCDj$9$k!#(B
KLIC $B$N(B ID $B3d$jEv$FJ}<0$r$=$N$^$^3HD%$9$k$H!"(B
$BJQ?t<1JL;R$O(B KLIC $B$N@0?t$NHO0O$r1[$($F$7$^$&$G$"$m$&!#(B

DKLIC $B=hM}7O$O%[%9%H4V@\B3$NBPKh$KJQ?tI=$r0lBP(B
$B!J$=$l$>$l%=%1%C%H$NN>C<$K!K@8@.$9$k!#(B
DKLIC $B=hM}7O$O$^$@Nc30=hM}$r<BAu$7$F$$$J$$$,!"(B
$B>-MhNc30=hM}$r<BAu$7$?;~!"(B
$BLdBj$N5/$-$?%=%1%C%H$H0lBP$NJQ?tI=$N$_$r=hM}$7!"(B
$B$=$NB>$N7rA4$J%=%1%C%H$HJQ?tI=$O$=$N$^$^$K$7$F$*$/(B
$B$H$$$&$3$H$,2DG=$G$"$k!#(B
%
$B0lJ}!"(BKLIC $B$N$h$&$K3F%[%9%H$,M"=PI=$HM"F~I=$NAH$r(B
$B$?$@0l$D$7$+;}$?$J$$>l9g!"(B
$B$=$NCf$+$iLdBj$N5/$-$?@\B3$KBP1~$9$kJQ?t72$r(B
$BA*$S=P$5$J$1$l$P$J$i$J$$$G$"$m$&!#(B

\Comment{
eager push vs lazy pull
fflush $B%P%C%U%!%j%s%0(B
$BDjNLE*$J4QB,I>2A$O:#8e$N2]Bj$G$"$k!#(B
%
$BNc$($P!"7HBS>pJsC<Kv(B
TCP/IP $B$KAjEv$9$k?.Mj@-$N$"$k%W%m%H%3%k$,(B
 $BEE;R%a!<%k%7%9%F%`>e$K9=C[$5$l$?>l9g!"(B
$B>e5-$N%P%C%U%!%j%s%0J}<0$OM-8z$G$"$m$&$+!#(B
%
$B%Q%1%C%H?t@aLs(B
$B0lBP0l(B vs $BB?BP0l(B
}

%---------------------------------------------------------------

\section{ $BCf7QDL?.$NGS=|(B }

% linear vs non-linear

$B%W%C%7%e7?DL?.$K$*$1$kCf7Q$rGS=|$9$k$?$a$NDL?.%W%m%H%3%k$O!"(B
$BJ88%(B\cite{transit}$B$K$b8+$i$l$k!#(B
$B$?$@$7!"$3$N%W%m%H%3%k$ODL?.O)$,C10lBeF~$G$"$k$3$H$r(B
$BA0Ds$H$7$F$$$J$$$?$a!"(BDKLICP $B$h$j8zN($,0-$$!#(B
$B$^$?!"B?$/$NJQ?t$,@~7A$G$"$k$3$H$r0EL[$K2>Dj$7$F$$$k!#(B

$B%[%9%H(B \A $B$+$i(B \B $B$XDL?.O)(B K$B!"(B
$B%[%9%H(B \B $B$+$i(B \C $B$XDL?.O)(B L $B$,DL$8$F$$$k;~!"(B
$B%[%9%H(B \B $BFb$G(B K=L $B$,<B9T$5$l$?$,!"(B
K=L $B$r;2>H$9$k%W%m%;%9$,%[%9%H(B \B $BFb$K;D$C$F$$$k>l9g!"(B
$BJ88%(B\cite{transit}$B$NJ}<0$G$O(B
$B%[%9%H(B \A $BFb$G$N(B K $B$N6qBN2=%a%C%;!<%8$O(B
$B%[%9%H(B \B $B$rCf7Q$7$F%[%9%H(B \C $B$XFO$/!#(B

$B$3$l$OO@M}E*$K@5$7$$$,!"J,;64D6-$NCY1d;~4V$,L5;k$G$-$J$$$[$I(B
$BBg$-$$$3$H$r9MN8$9$k$HK>$^$7$/$J$$!#(B
%
DKLICP $B$O%[%9%H(B \B $BFb$G(B K=L $B$X$N;2>H$,;D$C$F$$$k$+H]$+$K4X$o$i$:!"(B
$B%[%9%H(B \A--\C $B4V$NDL?.$r%[%9%H(B \B $B$,Cf7Q$9$k$h$&$J>u67$rGS=|$9$k(B
$B$h$&$K@_7W$7$?!#(B

% \( k + l > k' \)

%---------------------------------------------------------------

\section{ Oz $B$H$NHf3S(B }

% static vs dynamic

$BJB9T@)Ls8@8l(B Oz $B$O@EE*2r@O$rL\;X$7$F$$$J$$!#(B
$BJ,;64D6-$K$*$$$F$O!"AG@-$NCN$l$J$$%G!<%?$d%b%P%$%k%3!<%I$KBP$7$F(B
$B@EE*2r@O!&8!>Z$r9T$($k$3$H$OHs>o$K=EMW$G$"$m$&!#(B

Oz $B$OB?J,LZ$N40A4$JC10l2=$rL\;X$7$F$$$k$N$KBP$7!"(B
DKLIC $B$OJ,;6JQ?t$rC1$KDL?.O)$H8+$J$7$F$$$k!#(B
%
DKLICP $B$G$O(B out $B%b!<%IF1;N$NJ,;6JQ?t$ND>7k$KBP$7$F(B
$B2?$N=hM}$b9T$o$J$$$,!"%b!<%I$KMj$i$J$$(B Oz $B$O(B
$B$3$N$h$&$JDL?.$N:GE,2=$r9T$&$3$H$,$G$-$J$$!#(B

% $BJ,;6(B GC
% $BB?BPB?(B

%---------------------------------------------------------------

\section{ $BDL?.Nc30=hM}(B }

$BDL?.Cf$K1s3V%[%9%H!"DL?.O)!"DL?.Aj<j$N%W%m%;%9$,Mn$A$?>l9g!"(B
$BFI$_9~$_%b!<%I$NJ,;6O@M}JQ?t$K6/@)E*$K(B {\tt []} $B$r=q$-9~$`$3$H$K$h$C$F!"(B
$BMn$A$?DL?.Aj<j$+$i$N%a%C%;!<%8$rBT$AB3$1$k%G%C%I%m%C%/$,(B
$B5/$-$J$$$3$H$rJ]>Z$9$k$3$H$,$G$-$k$G$"$m$&!#(B

%---------------------------------------------------------------

\section{ $B%9%H%j!<%`$XO"B3$7$?(B ID $B$r3d$jEv$F$FJV;v$r%P%C%U%!$9$k(B }

$B8=:_(B DKLIC $B=hM}7O$OJ,;6JQ?t$X$N(B ID $B$N3d$jEv$F$K4X$7$F!"(B
$B$=$NJQ?t$N7?$r2?$i2>Dj$7$F$$$J$$!#(B

$B$7$+$7!"%9%H%j!<%`$XO"B3$7$?(B ID $B$r3d$jEv$F$l$P!"(B
$B8D!9$N%3%s%9$KBP$7$F<u?.3NG'$rAw?.$;$:!"(B
$B0lDj;~4VKh$K(B\Name{i}$B$+$i(B\Name{j}$B$^$G$N%3%s%9$KBP$9$k(B
$B<u?.3NG'%a%C%;!<%8(B\String{\Name{i}-\Name{j}=Removed}
$B$rAw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B=>$C$F!"$3$N%9%H%j!<%`$OC10lBeF~$G$J$/$J$k!#(B
\begin{verbatim}
append(X, Y, Z) :- X = [] |
  Z = Y.
append(X, Y, Z) :- X = [A | X1] |
  Z = [A | Z1],
  append(X1, Y, Z1).
\end{verbatim}
append/3 $B=R8l$K$*$$$F%9%H%j!<%`(B X, Y, Z $B$,C10lBeF~$G$J$$>l9g!"(B
Z = Y $B$K$h$C$F(B Z $B$H(B Y $B$N$I$N;~E@(B (continuation) $B$rD>7k$9$k$N$+(B
$BH=CG$G$-$J$$!#(B

$B$^$?!"%9%H%j!<%`$,4V@\M"=P$5$l$k>l9g$b!"(B
$B%9%H%j!<%`$N$I$N;~E@$,4V@\M"=P$5$l$F$$$k$N$+H=CG$9$k$3$H$O$G$-$J$$!#(B
$B$I$N$h$&$J>l9g$K!"(B
$B%9%H%j!<%`$N(B cdr $B$K%9%H%j!<%`$N(B ID $B$rB(;~:FMxMQ$7$FNI$$$N$+(B
$B8!>Z$9$k$3$H$O:#8e$N2]Bj$G$"$m$&!#(B

%---------------------------------------------------------------

\section{ strictly linear ID allocation }

KL1 $B8@8l$N@EE*2r@O$NBN7O$K$O!"7?!&%b!<%IBN7O$NB>$K;2>H?tBN7O$,$"$k!#(B
$B;2>H?t$,$A$g$&$IFs$D$G$"$k$h$&$JJQ?t$O!"=q$-<j0l?M$KBP$7$FFI$_<j0l?M(B
$B$G$"$k$?$a!"GK2uE*BeF~$,2DG=$G$"$k!#$3$N@-<A$r@~7A@-$H8F$V!#(B

$B@~7A@-$N35G0$r6qBNCM$K$b2!$7?J$a$?(B strict linearity
$B$O!"%W%m%0%i%`$,0z?t$KEO$5$l$?;q8;$N$_$rMxMQ$7$F<B9T$r(B
$B9T$&$3$H$r<($9@-<A$G$"$k(B\cite{strict-linearity}$B!#(B
strictly linear $B$J%W%m%0%i%`$O(B
$BMxMQ$9$k;q8;$,@EE*$KH=L@$9$k$?$a!"(BGC $B$rI,MW$H$7$J$$!#(B

strict linearity $B$N35G0$rJQ?t$X$N(B ID $B3d$jEv$F$K$b(B
$BE,MQ$9$k$H!"<!$N$h$&$J(B stack/2 $B%5!<%P=R8l$O(B
$B2<5-$N(B strict linear $B$J(B stack/3 $B%5!<%P=R8l$K=q$-49$($k$3$H$,$G$-$k!#(B
\begin{verbatim}
stack(S, D) :- S = [] |
  true.
stack(S, D) :- S = [push(X) | S1] |
  stack(S1, [X|D]).
stack(S, D) :- S = [pop(X) | S1], D = [Y|D1] |
  X = Y,
  stack(S1, D1).
\end{verbatim}

\begin{verbatim}
stack(S, ^(R), D) :- S = [](*) |
  R = [](D).
stack(S, ^(R), D) :- S = [push([X|*]) | S1] |
  R = [push(*) | R1],
  stack(S1, R1, [X|D]).
stack(S, ^(R), D) :- S = [pop(^(X)) | S1], D = [Y|D1] |
  X = Y,
  R = [pop([*|*]) | R1],
  stack(S1, ^(R1), D1).
\end{verbatim}
$BA4$F$N%5!<%P$,(B strict linear $B$G$"$k$H2>Dj$9$k$H!"(B
DKLIC $B=hM}7O$O<u?.3NG'$r>JN,$9$k$3$H$,$G$-$k!#(B
$B$7$+$7!"$3$l$O%5!<%P%W%m%0%i%^$,<u?.3NG'$NAw?.$r(B
$BL@<($9$k$3$H$r0UL#$7!"<u?.3NG'$N@UG$$,(B DKLIC $B=hM}7O$+$i(B
$B%5!<%P%W%m%0%i%^$X0\$C$?$@$1$G$"$k$H8@$($k!#(B

%---------------------------------------------------------------

\section{ $B:#8e$N2]Bj(B }

$B8=:_(B DKLIC $B=hM}7O$OL$Dj5AJQ?t$NM"=PF~$H(B
$B$=$N6qBN2=!"D>7k!"GQ4~$N$_$r4IM}$7$F$$$k!#(B
%
$B$7$+$7!"5-9f=hM}8@8l(B KL1 $B$K$*$$$F(B
$B5-9f$N8zN(E*$JM"=PF~!"Aw<u?.$KBP$9$kMWK>$b$"$jF@$k$G$"$m$&!#(B

% $BJQ?t(B--$B6qBNCM%P%C%U%!%j%s%0%5!<%P(B

$B$^$?!"4{$K6qBN2=$5$l$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r4^$`>e0L%5!<%P$N<BAu$O:#8e$N2]Bj$G$"$k!#(B

\vspace{1em}

$B0J>e$G!"K\O@J8$r=*$($k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter*{ $B<U<-(B }

$BK\8&5f$NMM!9$J%"%$%G%"$O!"(B
$B>eED8&5f<<8@8lHI$N$_$J$5$s$H$N5DO@$NCf$G@8$^$l$F$-$?$b$N$G$9!#(B

$B$=$NCf$G$b!"FC$K>eEDOB5*@h@8$H2CF#5*IW$5$s$O(B
$B8@8lHI$N0l0w$H$7$F5DO@$NAj<j$H$J$C$F$/$l$?$P$+$j$G$J$/!"(B
$BO@J8$N=q$-J}$K$D$$$FCzG+$K;XF3$7$F2<$5$$$^$7$?!#(B
$B?<$/$*Ni?=$7>e$2$^$9!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\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 }

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

\newcommand{\home}{\%7E}
\newcommand{\URL}[1]{{\tt http://#1}}
\newcommand{\Bib}[1]{{\sl #1}}

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

\bibitem{transit}
Hiroshi Nakashima and Yu Inamura,
An Efficient Message Transfer Mechanism Bypassing Transit Processors.
In \Bib{Proc. Joint Symposium on Parallel Processing},
pp.~123--130, June 1992.

\bibitem{PIMOS}
$BBmOBCK(B $BJT(B, $BBh8^@$Be%3%s%T%e!<%?$NJBNs=hM}(B.
bit$BJL:}(B, $B6&N)=PHG(B, 1993.

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

\Comment
{\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{inside}
$B4XEDBg8c(B, Inside KLIC Version 1.0.
KLIC Task Group / AITEC / JIPDEC, 1998.
\URL{www.klic.org/software/klic/inside/master.html}

\bibitem{patch}
\URL{www.klic.org/}
\\\URL{www.ueda.info.waseda.ac.jp/{\home}takagi/kl1/klic-3.003/fix.html}
\\\URL{www.ueda.info.waseda.ac.jp/{\home}takagi/kl1/klic-3.003/rewriting.html}

\bibitem{linearity}
Ueda, K., Linearity Analysis of Concurrent Logic Programs.  
In \Bib{Proc.\ Int.\ Workshop on Parallel and Distributed
 Computing for Symbolic and Irregular Applications}, 
Ito, T. and Yuasa, T. (eds.), World Scientific, 2000, pp.~253--270.

\bibitem{strict-linearity}
Kazunori Ueda, Resource-Passing Concurrent Programming.
In \Bib{Proc. Fourth Int. Symp.
 on Theoretical Aspects of Computer Software},
Kobayashi, N. and Pierce, B. (Eds.),
Lecture Notes in Computer Science 2215, Springer, 2001, pp.~95--126.

\bibitem{Kima}
$BLVBe0iBg(B, $B>eEDOB5*(B,
Kima: $BJB9TO@M}%W%m%0%i%`<+F0=$@57O(B.
$B%3%s%T%e!<%?%=%U%H%&%'%"JL:}(B $B%=%U%H%&%'%"H/E8(B,
Vol.~18, No.~0 (2001), pp.~122--137.

\bibitem{kato}
$B2CF#5*IW(B, $B>eEDOB5*(B,
$BJB9TO@M}%W%m%0%i%`$K$*$1$kC`<!<B9TItJ,$NCj=PJ}K!O@(B.
In \Bib{Proc. JSSST Workshop
 on Programming and Programming Languages (PPL2001)}, 2001.

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

\bibitem{KL1/J}
$B8^==Mr9((B, $BJ,;6(BKL1$B8@8l=hM}7O$N@_7W$H<BAu(B.
$BAa0pEDBg3XM}9)3XIt>pJs3X2JB46HO@J8(B, 1999.

\bibitem{treecode}
$B8^==Mr9((B, $B%a%?%$%s%?%W%j%?$K4p$E$/J,;6JB9TO@M}7?8@8l=hM}7O(B.
$BAa0pEDBg3XBg3X1!M}9)3X8&5f2J=$;NO@J8(B, 2001.

\bibitem{DKLIC}
$B9bLZM42p(B, KL1$B$K$h$kJ,;6(BKL1$B8@8l=hM}7O$N<BAu(B.
$BAa0pEDBg3XM}9)3XIt>pJs3X2JB46HO@J8(B, 2000.
\URL{www.ueda.info.waseda.ac.jp/{\home}takagi/}

\bibitem{SPA2001}
$B9bLZM42p(B, $B>eEDOB5*(B,
dklic: KL1$B$K$h$kJ,;6(BKL1$B8@8l=hM}7O$N<BAu(B.
In \Bib{Proc. JSSST Workshop
 on Systems for Programming and Applications (SPA2001)}, 2001.
\URL{www.dcl.info.waseda.ac.jp/SPA2001/}

\bibitem{takayama}
$B9b;37<(B, $BJB9TO@M}7?8@8l(BKL1$B$K$h$kJ,;6(BKL1$B8@8l=hM}7O$N<BAu(B.
2000 $BG/EYAa0pEDBg3XM}9)3XIt>pJs3X2JB46HO@J8(B, 2001.

\bibitem{ryo}
$B>>B<NL(B, $BJB9TO@M}7?8@8l(BKL1$B$NJ,;63HD%$N$?$a$N1s3V%N!<%I4IM}$N<BAu(B.
2000 $BG/EYAa0pEDBg3XM}9)3XIt>pJs3X2JB46HO@J8(B, 2001.

\bibitem{kaneki}
$B6bLZM$2p(B, $BJB9TO@M}7?8@8l(BKL1$B$K$*$1$kNc30=hM}$N<BAu(B.
2001 $BG/EYAa0pEDBg3XM}9)3XIt>pJs3X2JB46HO@J8(B, 2002.

\bibitem{kokawa}
$BJ4@nM'9((B, DKLIC$B=hM}7O$K$*$1$kJ,;6;q8;$N0LCV4IM}(B.
2001 $BG/EYAa0pEDBg3XM}9)3XIt>pJs3X2JB46HO@J8(B, 2002.

\bibitem{Prolog}
P.~Deransart, A.~Ed-Dbali, L.~Cervoni,
Prolog: The Standard Reference Manual.
Springer-Verlag, 1996.

\bibitem{CProlog}
Ehud Shapiro, A subset of Concurrent Prolog and its interpreter.
ICOT Technical Report TR-003, ICOT, 1983.

\bibitem{Janus}
Vijay A. Saraswat, Ken Kahn, and Jacob Levy,
Janus: A Step towards Distributed Constraint Programming.
In \Bib{North American Conference on Logic Programming}, pp.~431--446, 1990.

\bibitem{DRL}
Diaz, M., Rubio, B. and Troya, J.~M.,
DRL: A Distributed Real-Time Logic Language.
In \Bib{Comput.\ Lang.}, Vol.~23, No.~2--4 (1997), pp.~87--120.

\bibitem{mobj}
Van Roy, P., Haridi, S., Brand, P., Smolka, G., Mehl, M. and Scheidhauer, R., 
Mobile Objects in Distributed Oz.
In \Bib{ACM Transactions on Programming Languages and Systems},
Vol.~19, No.~5, September 1997, pp.~804--851.

\bibitem{Oz}
Haridi, S., Van Roy, P., Brand, P. and Schulte, C.,
Programming Languages for Distributed Applications.
In \Bib{New Generation Computing}, Vol.~16, No.~3 (1998), pp.~223--261.

\bibitem{DLV}
Haridi,~S., Van~Roy,~P., Brand,~P., Mehl,~M., Scheidhauer,~R. and Smolka,~G.,
Efficient Logic Variables for Distributed Computing.
In \Bib{ACM Transactions on Programming Languages and Systems},
Vol.~21, No.~3, May 1999, pp.~569--626.

\bibitem{OS}
J. L. $B%T!<%?!<%=%s(B, A. $B%7%k%P!<%7%c%C%D(B $B6&Cx(B, $B1'DE5\9'0l(B, $BJ!ED98(B $B6&Lu(B,
$B%*%Z%l!<%F%#%s%0%7%9%F%`$N35G0(B. $BG]Iw4[(B, 1987.

\bibitem{Unix}
$B;38}OB5*(B $B4F=$(B, The UNIX Super Text. $B5;=QI>O@<R(B, 1992.

\bibitem{C}
$B%5%_%e%(%k(B P. $B%O!<%S%=%s(B, $B%,%$(B L. $B%9%F%#!<%k(B $B6&Cx(B, $B:XF#?.CK(B $B4FLu(B,
$B?7!&>\@b(B C $B8@8l(B. $B%=%U%H%P%s%/(B, 1994.

\bibitem{Turing}
R.C. $B%[%k%H(B $BB>(B, $BEr@uB@0l(B $B4FLu(B, $B>>ED85I'(B, $B;09%GnG7(B, $BC]2,>0;0(B $BLu(B,
$B%W%m%0%i%_%s%08@8l(B Turing --- $B8@8l;EMM$N4pACM}O@$H@_7W5;K!(B.
$B7<3X=PHG(B, 1990.

\bibitem{Java}
James Gosling, Bill Joy, Guy Steele $BCx(B, $BB<>e2m>O(B $BLu(B,
The Java $B8@8l;EMM(B. $B%"%8%=%s!&%&%'%9%l%$(B, 1997.

\bibitem{Sun}
Samuel C. Kendall, Jim Waldo, Ann Wollrath, Geoff Wyant,
A Note on Distributed Computing.
Sun Microsystems Research Technical Report TR-94-29, 1994.
\URL{www.sun.com/research/techrep/1994/abstract-29.html}

\end{thebibliography}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $BIUO?(B

\appendix

\chapter{ $BJdB-(B \Comment{(Appendices)} }

\section{ $B%b!<%I$J$7$N%W%m%0%i%`$rEy2A$J%b!<%IIU$-%W%m%0%i%`$X=q$-49$($k(B }
\label{moding}

$BK\@a$G$O!"Nc<($K$h$C$FHs7A<0E*$K=q$-49$($r@bL@$9$k!#(B
%
$B%b!<%I$J$7$N%W%m%0%i%`$O!"<!$N$h$&$K(B
$B%b!<%IIU$-$N%W%m%0%i%`$K=q$-49$($k$3$H$,$G$-$k!#(B

$B7k2L$N8!::$r9T$&$Y$-$H$3$m$G!"$"$k$Y$-7k2L$r(B
$B@Q6KE*$K=q$-9~$s$G$7$^$&%W%m%0%i%`$O%b!<%IIU$-$G$J$$!#(B
$B$3$N$h$&$J%W%m%0%i%`$r%b!<%IIU$-$K=q$-49$($k$K$O!"(B
$B7k2L$r8!::$9$k?7$?$J=R8l$r2C$($k!#(B

\begin{verbatim}
p(Arg1, Arg2) :- true |
  Result = normal,
  proc(Arg1, Result),
  post(Arg2).
\end{verbatim}
$B>e$N%W%m%0%i%`$O!"<jB3$-(B proc $B$,@5>o=*N;$9$k$3$H$rA0Ds$H$7$F(B
Result = normal $B$r%O!<%I%3!<%G%#%s%0$7$F$7$^$C$F$$$k!#(B
%
$B$7$+$7!"<jB3$-$N@5>o=*N;$rA0Ds$H$7$F7k2L$N8!::$rBU$k$N$O(B
$BNI$$%W%m%0%i%_%s%0%9%?%$%k$H$O8@$($J$$!#(B
%
$B$?$H$((B proc $B$,(B Result = normal $B$rJV$9$3$H$,J]>Z$5$l$F$$$?$H$7$F$b!"(B
$B<jB3$-(B post $B$,(B proc $B$N8e$K<B9T$5$l$k$Y$->l9g!"(B
proc $B$N=*N;$r8!::$9$k$3$H$O=EMW$G$"$k!#(B

$B>e$N%W%m%0%i%`$O2<$N$h$&$K=q$-49$(!"(B
$B7k2L$N8!::$r9T$&$N$,NI$$%W%m%0%i%_%s%0%9%?%$%k$G$"$k!#(B
\begin{verbatim}
p(Arg1, Arg2) :- true |
  proc(Arg1, Result),
  p1(Arg2, Result).

p1(Arg2, Result) :- Result = normal |
  post(Arg2).
p1(Arg2, Result) :- Result = abnormal |
  process_exception(Arg2).
\end{verbatim}

$BLZ$NC5:w$K$*$$$F!"3FItJ,LZ$KBP$7$F;R%W%m%;%9$r@8@.$7!"(B
$BAa$$<T>!$A$G7k2L$r=q$-9~$`$h$&$J%W%m%;%9$O%b!<%IIU$-$G$J$$!#(B
$B$3$N$h$&$KJB9T$K=q$-9~$^$l$k7k2L$O(B KLIC $B=hM}7O$,(B
$BDs6!$9$kJB9T%^!<%8%5!<%P(B merge $B$rMxMQ$7$F!"(B
$B7k2L$NJB9T=q$-9~$_$r0lK\$N%9%H%j!<%`$X=g=xIU$1$k$Y$-$G$"$k!#(B

$B6d9T8}:B$N;D9bCM$=$N$b$N$rAa$$<T>!$A$G=q$-9~$`$N$OL@$i$+$K8m$j$G$"$k!#(B
$B%m%C%/!"%;%^%U%)!"%b%K%?$N$h$&$J=q$-9~$_8"$N<hF@$r(B
$B6%Ah$9$k$h$&$K=q$-D>$9$Y$-$G$"$m$&!#(B

%---------------------------------------------------------------

\section{ DKLIC-XMLP: inter-operability }
\label{XML}

$BK\@a$G$O!"B>8@8l$K$*$$$F(B KL1 $B9`$N;z6g2r@O!"9=J82r@O$r(B
$BMF0W$K9T$&$?$a$K(B DKLICP $B$r(B XML $B8@8l$KBP1~$5$;$kNc$r5s$2$k!#(B

KL1 $B9`$b(B XML $B%G!<%?$b6&$KLZ9=B$$G$"$k$N$G!"(B
$B$=$l$i$NBP1~IU$1$OMF0W$G$"$k!#(B

\begin{verbatim}
f([X], {a, "s"})
\end{verbatim}

$BNc$($P!">e$N(B KL1 $B9`$O2<5-$N(B XML $B%G!<%?$H$7$FI=$9$3$H$,$G$-$k!#(B

\begin{verbatim}
<functor arity="2">
 <name>f</name>
 <arg number="1">
  <cons>
    <car><variable>X</variable></car>
    <cdr><atom>[]</atom></cdr>
  </cons>
 </arg>
 <arg number="2">
  <vector length="2">
    <elem number="0"><atom>a</atom></elem>
    <elem number="1"><string>s</string></elem>
  </vector>
 </arg>
</functor>
\end{verbatim}

DKLICP $B$K$*$1$k%a%C%;!<%8!J%Q%1%C%H!K$OA4$F(B KL1 $B9`$K$h$C$F(B
$B9=@.$5$l$k$N$G!"$3$l$i$r(B XML $B%G!<%?$KCV$-49$($l$P(B
DKLICP $B$r(B XML $BBP1~$H$9$k$3$H$,$G$-$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% DKLIC $B%=!<%9(B

\chapter{ DKLIC $B=hM}7O$N;EMM$H<BAu(B \Comment{(Specification)} }

\Comment{
\begin{verbatim}
dklicio
  bind inet(Port) ^Result=normal(^ServerSocket)
  connect inet(Host,Port) ^Result=normal(In,^Out)

ServerSocket
  accept ^Result=normal(In,^Out)

naming
  register Name Host Port
  lookup Name ^Result=normal(Host,Port)

exec
  go Agent
\end{verbatim}
} % Comment

%---------------------------------------------------------------

\section{ $B<g$J3+H/4D6-(B }

$B%W%m%0%i%`$N3+H/!&<B9T3NG'$O<!$N4D6-$G9T$C$?!#(B
\begin{enumerate}
\item Intel Pentium III 800EB
\item PC--AT $B8_495!(B
\item Debian GNU/Linux 2.2
\item KLIC--3.003--2002--01--25 \cite{patch}
\end{enumerate}

$B<!@a0J9_$K(B dklicio $B$N%=!<%9%W%m%0%i%`$r5s$2$k$,!"(B
$B8=:_;D$C$F$$$kLdBjE@$O<!$NDL$j$G$"$k!#(B
\begin{enumerate}
\item DKLICP $B$K40A4$KBP1~$7$F$$$J$$!#(B
\begin{enumerate}
\item $B%=%1%C%H@\B3;~$K%/%i%$%"%s%H$,%[%9%H$r?=9p$7$J$$!#(B
$BC1=c$J<BAu$H$7$F%[%9%H$r%W%m%0%i%^$K?=9p$5$;$k$3$H$b9M$($i$l$k$,!"(B
hostname $B$J$I$rMxMQ$7$F<+F02=$9$k$3$H$,K>$^$7$$$G$"$m$&!#(B
\item $B;0<TDL?.$N%W%m%H%3%k$r40A4$K$O<BAu$7$F$$$J$$!#(B
$B0lHL$K%=%1%C%H$rMxMQ$9$k%5!<%P$O%[%9%H$H%]!<%HHV9f$K$h$C$FFCDj$5$l$k!#(B
$B=>$C$F!"%[%9%H$r?=9p$9$k:]$K%]!<%HHV9f$b6&$K?=9p$9$Y$-$G$"$m$&!#(B
$BA0=R$N$h$&$K%[%9%H$O<+F0E*$KFCDj$9$k$3$H$,2DG=$G$"$j!"$9$Y$-$G$"$m$&$,!"(B
$B%]!<%HHV9f$O%W%m%0%i%^$K?=9p$5$;$k$Y$-$G$"$m$&$+!#(B
$B%W%m%0%i%^$K$H$C$F;H$$$d$9$$(B API $B$r9M;!$7!"<BAu$9$kI,MW$,$"$k!#(B
\end{enumerate}

\item $BJQ?tI=%*%V%8%'%/%H$N(B \gcvt $B4X?t$r<BAu$7$F$$$J$$!#(B
2002-01-25 $B;~E@$K$*$1$k(B KLIC--C API $B$OHa;4$J$b$N$G$"$j!"(B
$B$3$N%"%J%/%m$J%P!<%8%g%s$G3+H/!&;n83$r9T$&$3$H$O:$Fq$G$"$k!#(B
%
$B$b$C$HMF0W$K3+H/$r9T$($k(B KLIC--C API $B$r<BAu$9$k$?$a!"(B
$B8=:_(B KLIC $B$N@vN}$r?J$a$F$$$k!#(B

$BNc$($P!"JQ?tI=%*%V%8%'%/%H$N<!$N4X?t(B
\begin{verbatim}
SET_NEWOBJ(q* g_allocp, GD_OBJ_TYPE* GD_SELF, GD_OBJ_TYPE* newself,
  long g_method_functor, q* GD_ARGV, int len, int size )
\end{verbatim}
$B$N0z?t$N$&$A(B g\_method\_functor $B$d(B GD\_ARGV
$B$O;H$o$l$F$$$J$$$h$&$K8+$($k$,!"$3$l$O(B
KLIC--C API $B$,CfESH>C<$J1#JC$r9T$C$F$$$k$?$a$G$"$k!#(B
%
$B$3$l$i$N0z?t$,I,MW$G$"$k$3$H$K5$IU$/$?$a$K$O!"(B
$B$3$l$i$N0z?t$J$7$G%3%s%Q%$%k$7$F$_$F!"$[$H$s$I0UL#ITL@$J(B
$B%(%i!<%a%C%;!<%8$r8+$;$i$l!"$=$l$rFI$_2r$+$J$1$l$P$J$i$J$+$C$?!#(B
%
$B$^$?!"$[$H$s$I%I%-%e%a%s%H$N$J$$(B API $B$r8m$C$F;HMQ$7$?7k2L!"(B
$B%;%0%a%s%F!<%7%g%s%U%)!<%k%H$,5/$-$k$3$H$b$7$P$7$P$G$"$C$?!#(B
\end{enumerate}

%---------------------------------------------------------------

\section{ dklicio }
\prog{source/dklicio.kl1}

$B%I%i%$%P$rMxMQ$7$?%3%s%Q%$%k$H<B9T7k2L$O<!$NDL$j$G$"$k!#(B
\begin{verbatim}
% klic dklicio-test.kl1 dklicio.kl1 vart3.kl1 vart3data.c fusesusp.c
% ./a.out
server_socket
server
variable__table 0x805f96c newed side=1, free=1, used=-1, len=100
variable__table 0x8060850 newed side=0, free=0, used=-1, len=100
client
variable__table copied to 0x80785d8
variable__table copied to 0x80787b0
variable__table copied to 0x805f5cc
variable__table copied to 0x805f7a4
\end{verbatim}

$B<!$K%I%i%$%P(B dklicio-test.kl1 $B$r5s$2$k!#(B
\prog{source/dklicio-test.kl1}

%---------------------------------------------------------------
\section{ $BJQ?t%M!<%`%5!<%P(B }
\prog{source/vart3.kl1}

%---------------------------------------------------------------

\section{ $BJQ?tI=%*%V%8%'%/%H(B }
\prog{source/vart3data.c}

$B<!$N%3%^%s%I$G%3%s%Q%$%k$H<B9T3NG'$r9T$C$?!#(B
\begin{verbatim}
% klic vart3data-test.kl1 vart3data.c
% ./a.out
variable__table 0x804e4d8 newed side=0, free=0, used=-1, len=100
variable__table 0x804e4d8 id (0,_32B) found _32C
id (0,_32B) found false
variable__table 0x804e4d8 add (0,_32B) open = 0x804f17c
 + used=0, tab[0]=_32B, open
variable__table 0x804e4d8 + (0,_32B) = 0x804f17c
variable__table 0x804e4d8 id (2,_330) found _338
id (2,_330) found false
variable__table 0x804e4d8 add (2,_330) open = 0x804f1ac
 + used=2, tab[2]=_330, open
variable__table 0x804e4d8 + (2,_330) = 0x804f1ac
variable__table 0x804e4d8 id (4,_333) found _33A
id (4,_333) found false
variable__table 0x804e4d8 add (4,_333) open = 0x804f1b4
 + used=4, tab[4]=_333, open
variable__table 0x804e4d8 + (4,_333) = 0x804f1b4
vt(=(0,_32B),=(2,_330),=(4,_333))
variable__table 0x804e4d8 set_state #4, closing = 0x804f1c0
variable__table 0x804e4d8 var (0,_350) found _351
var(0,_32B,true)
vt(=(0,_32B),=(2,_330),=(4,_333))
variable__table 0x804e4d8 fuse #2 (_362) with #0
variable__table 0x804e4d8 fuse(2,0,(null),)
vt(=(0,_32B),=(2,_32B),=(4,_333))
variable__table 0x804e4d8 bind #0 (_374) to [{i,3,2},"sdgl"]
 bind tab[0]=_32B, open to [{i,3,2},"sdgl"]
variable__table 0x804e4d8 bind(0,[{i,3.200000},"sdgl"],(null),)
vt(=(0,[{i,3,2},"sdgl"]),=(2,[{i,3,2},"sdgl"]),=(4,_333))
variable__table 0x804e4d8 - #4 (_385) = 0x804f2e0
variable__table 0x804e4d8 remove(4,(null),)
vt(=(0,[{i,3,2},"sdgl"]),=(2,[{i,3,2},"sdgl"]),=(4,_333))
gc(922,27)
vt(=(0,[{i,3,2},"sdgl"]),=(2,[{i,3,2},"sdgl"]),=(4,_11))
\end{verbatim}

$B<!$K%I%i%$%P(B vart3data-test.kl1 $B$r5s$2$k!#(B
\prog{source/vart3data-test.kl1}

%---------------------------------------------------------------

\section{ fusesusp }
\prog{source/fusesusp.c}

$B<!$N%3%^%s%I$G%3%s%Q%$%k$H<B9T3NG'$r9T$C$?!#(B
\begin{verbatim}
% klic fusesusp-test.kl1 fusesusp.c vart3.kl1 vart3data.c
% ./a.out
xyz(fusesusp(@(3,local),_63FD,_14),\
 fusesusp(@(4,remote),_63FA,_19),fusesusp(out,_63F7,_48))
fusesusp @(3,local) copied
fusesusp @(4,remote) copied
fusesusp out copied
gc(99,80)
xyz(fusesusp(@(3,local),_D,_14),\
 fusesusp(@(4,remote),_1A,_21),fusesusp(out,_27,_30))
fusesusp out bound to 24
fusesusp @(3,local) bound to 33
:(bindhook,bound(@(5,host),24))
:(bindhook,bound(@(6,node),24))
xyz(fusesusp(@(3,local),33,[bound(@(3,local),33)]),\
 fusesusp(@(4,remote),_1A,_21),fusesusp(out,24,[bound(out,24)]))
\end{verbatim}

$B<!$K%I%i%$%P(B fusesusp-test.kl1 $B$r5s$2$k!#(B
\prog{source/fusesusp-test.kl1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{ DKLIC $B=hM}7O$N1~MQNc(B \Comment{(Sample Applications)} }

\section{ Remote Predicate Call }

dklicio $B$rMxMQ$7$F1s3V=R8l8F$S=P$7$r9T$&(B
$B%/%i%$%"%s%H(B/$B%5!<%P7O$O<!$N$h$&$K$J$k!#(B

$B$^$:!"(BRPC $B%/%i%$%"%s%H$r5s$2$k!#(B
\begin{verbatim}
:- module rpc_client.

new(Host, Port, RPC) :- true |
  dklicio:connect(inet(Host, Port), R),
  new1(RPC, R).
new1(RPC, R) :- R = normal(Sock) |
  RPC = Sock.
\end{verbatim}
$B$3$N(B RPC $B%/%i%$%"%s%H$rMxMQ$9$k%f!<%6%W%m%;%9$O!"(B
$B%9%H%j!<%`(B RPC $B$K1s3V8F$S=P$7$7$?$$%4!<%k$r(B
$B<!$N$h$&$K=q$-9~$a$PNI$$!#(B
\begin{verbatim}
  RPC = [append(X, Y, ^(Z)), chat(^(I), O) | RPC1],
\end{verbatim}
$B7k2L$r$b$i$&$?$a$N(B in $B%b!<%I$NJQ?t$r(B
\verb!^/1! $B$N0z?t$H$7$F$$$k$3$H$KCm0U$;$h!#(B
%
$B$3$NI=5-$O!"(BJanus \cite{Janus} $B$+$i<Z$j$?$b$N$G$"$k!#(B

$B<jB3$-7?8@8l$H0[$J$j!"$3$l$i$NJ,;6JQ?t$OC1=c$J@0?t$dJ8;zNs$@$1$G$J$/(B
$BJQ?t$r4^$`J#;($J(B KL1 $B9`$H$7$F$NCM$r<h$k$3$H$,$G$-$k!#(B

$B<!$K(B RPC $B%5!<%P$r5s$2$k!#(B
\begin{verbatim}
:- module rpc_server.

new(Port) :- true |
  dklicio:bind(inet(Port), R),
  new1(R).
new1(R) :- R = normal(ServSock) |
  accept(ServSock).

accept(ServSock) :- true |
  ServSock = [accept(R) | ServSock1],
  accept1(ServSock1, R).
accept1(ServSock,R) :- R=normal(Sock) |
  rpcd(Sock),
  accept(ServSock).

rpcd(Sock) :- Sock = [M:Call|Sock1] |
  functor(Call, Name, Arity),
  generic:new(module, Modu, M),
  generic:new(predicate,
    Pred, Modu, Name, Arity),
  args_vector(Call, Arity, V, []),
  apply(Pred, V).

args_vector(F,Arity,V,L) :- Arity=:=0 |
  new_vector(V, L).
args_vector(F,Arity,V,L) :- Arity > 0 |
  arg(Arity, F, Arg),
  L1 = [Arg | L],
  Arity1 := Arity - 1,
  args_vector(F, Arity1, V, L1).
\end{verbatim}

%---------------------------------------------------------------
\Comment{ \section{ Chat Server } }

%---------------------------------------------------------------

\section{ $B8!:w%5!<%P(B }

DKLIC $B$K$*$1$k%M!<%`%5!<%P$NNc$r<!$K5s$2$k!#(B
\begin{verbatim}
name(NS, Table) :- NS = [register(Name,Server) | NS1] |
  generic:new(merge, Clients, Server),
  Table1 = [(Name,Clients) | Table],
  name(NS1, Table1).
name(NS, Table) :- NS = [lookup(Name,Result) | NS1] |
  lookup(Name, Result, Table, Table1),
  name(NS1, Table1).

lookup(Name, Result, Table, Table_) :- Table = [] |
  Result = not_found(Name),
  Table_ = Table.
lookup(Name, Result, Table, Table_) :- Table = [(N,S)|Table1], N=Name |
  S = {Client, S1},
  Result = found(Client),
  Table_ = [(N,S1) | Table1].
otherwise.
lookup(Name, Result, Table, Table_) :- Table = [(N,S)|Table1] |
  Table_ = [(N,S) | Table1_],
  lookup(Name, Result, Table1, Table1_).
\end{verbatim}
$B$3$N(B name $B%5!<%P$O!"(Bregister/2 $B%a%C%;!<%8$K$h$C$F(B
$B%f!<%6Dj5A%5!<%P$X$NDL?.O)(B Server $B$KL>A0(B Name $B$rIU$1$FI=$KEPO?$9$k!#(B
%
$B$^$?!"(Blookup/2 $B%a%C%;!<%8$K$h$C$F;XDj$5$l$?(B
Name $B$rI=$NCf$G8!:w$9$k!#(B
Name $B$,8+$D$+$C$?>l9g!"(BName $B$HL>IU$1$i$l$?%f!<%6Dj5A%5!<%P$X$NDL?.O)(B
Server $B$X$H%^!<%8$5$l$kDL?.O)$N$&$A0lK\$rJV$9!#(B

$B$3$NJV$5$l$?DL?.O)(B Client $B$KBP$7$F(B
$B%/%i%$%"%s%H$O%f!<%6Dj5A%5!<%P$X$NMW5a%a%C%;!<%8$r=q$-9~$s$GNI$$!#(B
%
$BJ#?t$N%/%i%$%"%s%H$+$i%f!<%6Dj5A%5!<%P$,JB9T$K<u$1<h$k%a%C%;!<%8Ns$O!"(B
$B0lK\$NDL?.O)(B Server $B$K%^!<%8$5$l$F$$$k!#(B

$B%/%i%$%"%s%H!"(Bname $B%5!<%P!"%f!<%6Dj5A%5!<%P$,$=$l$>$l(B
$B%[%9%H(B \A, \B, \C $B$K$"$k$H$-!"(B
DKLIC $B=hM}7O$N4{B8$N;n:n$G$O%/%i%$%"%s%H$+$i(B
name $B%5!<%P$rDL$8$F%f!<%6Dj5A%5!<%P$X@\B3$5$l$?DL?.O)$KN.$l$k%a%C%;!<%8$O!"(B
name $B%5!<%P$,Cf7Q$r=*N;$7$F$b%[%9%H(B \B $B$rCf7Q$7$FDL?.$5$l$F$$$?!#(B

dklicio $B$rMQ$$$F%[%9%H4VDL?.$r9T$C$F$$$l$P(B
name $B%5!<%P$,%f!<%6Dj5A%5!<%P$NCg2p8!:w$r=*$($?8e!"(B
name $B%5!<%P$NCf7Q!"=>$C$F%[%9%H(B \B $B$NCf7Q$O9T$o$l$J$$!#(B

%---------------------------------------------------------------
\Comment{ \section{ Mobile Agent } }

\end{document}
