%%
%% cu-PrologIII $BF|K\8l%f!<%6!<%:%^%K%e%"%k(B 92.2
%%  			revised on 16-Mar-92
%%				   7-July-94 apnd$BDI2C(B
%%				   27-Sep-94 %S, atom_to_str$BDI2C(B
%%				   4-Nov-94  EUC $B4A;z%5%]!<%H(B
\documentstyle[]{jarticle}
\setlength{\textwidth}{165mm}
\setlength{\textheight}{260mm}
\setlength{\topmargin}{-1.0in}
\setlength{\evensidemargin}{0in}
\setlength{\oddsidemargin}{0in}

\newtheorem{defs}{[$BDj5A(B]}
\newtheorem{ex}{$BNc(B}
\newtheorem{thm}{$BDjM}(B}
\newcommand{\cuprolog}{{\sf cu-Prolog}}
\newcommand{\normalskip}{\baselineskip=1.2\normalbaselineskip}
\newcommand{\programskip}{\baselineskip=0.8\normalbaselineskip}
\newcommand{\bcapt}{\small \sf }
\newcommand{\ecapt}{\rm  \normalsize }
\newcommand{\bcat}{\left[ \begin{array}{l}}
\newcommand{\ecat}{\end{array} \right]}
\newcommand{\bscat}{\left \{ \begin{array}{l}}
\newcommand{\escat}{\end{array} \right \}}
\newcommand{\bdisj}{\left \{ \begin{array}{l}}
\newcommand{\edisj}{\end{array} \right \}}

\begin{document}
\normalskip

\title{cu-Prolog$BBh;0HG%f!<%6!<%:%^%K%e%"%k(B}
\author{
$BDEED(B $B9((B\\
($B:b(B)$B?7@$Be%3%s%T%e!<%?5;=Q3+H/5!9=(B  $BBhFs8&5fIt(B\\
$B")(B108 $BEl5~ET9A6h;0ED(B1--4--28 $B;0ED9q:]%S%k(B21$B3,(B\\
Tel : 03 (3456) 3069 \hspace{.5cm}
Fax : 03 (3456) 1618 \hspace{.5cm}
E-mail : tsuda@icot.or.jp
}
\date{1994$BG/(B7$B7n(B7$BF|(B}
\maketitle

\tableofcontents
\newpage

\section{$B35MW(B}
$B@)LsO@M}7?8@8l(Bcu-Prolog$B$O!"<+A38@8l=hM}$NC10l2=J8K!$NFCD'$G$"$k@k8@E*(B
$B$JJ8K!5-=R$N<BAu$rL\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B}
$BK\%^%K%e%"%k$O(BICOT Free Software$B$H$7$F8x3+$5$l$F$$$k(BUNIX$BHG(Bcu-Prolog$BBh;0(B
$BHG$N%f!<%6!<%:%^%K%e%"%k$G$"$k!#(B

\subsection{cu-Prolog$B<B9T%b%8%e!<%k$N:n@.K!(B}
cu-Prolog$BBh;0HG$O!"(BC$B8@8l$K$h$k0J2<$N%b%8%e!<%k$+$i$J$k!#(B
\begin{itemize}
\item $B%X%C%@%U%!%$%k(B
\begin{description}
\item [{\tt include.h}] $B9=B$BN!&%^%/%m$NDj5A(B
\item [{\tt funclist.h}] $BB>%b%8%e!<%k$G;H$o$l$k4X?t$N30It;2>H(B
\item [{\tt varset.h}] $BBg0hJQ?t$N=i4|2=(B
\item [{\tt globalv.h}] $BBg0hJQ?t$N30It;2>H(B
\item [{\tt defsysp.h}] $BAH$_9~$_=R8lJQ?t$N=i4|2=(B
\item [{\tt sysp.h}] $BAH$_9~$_=R8lJQ?t$N30It;2>H(B
\end{description}

\item $B%7%9%F%`$N4pK\%b%8%e!<%k(B
\begin{description}
\item [{\tt main.c}] $B=hM}7O%H%C%W%l%Y%k(B
\item [{\tt mainsub.c}] main.c$B$N%5%V%k!<%A%s(B
\item [{\tt new.c}] $B%a%b%j4IM}(B
\item [{\tt read.c}] $B%W%m%0%i%`!&9`$NFI$_9~$_(B
\item [{\tt print.c}] $B9`$NI=<(%k!<%A%s(B
\end{description}

\item Prolog$B=hM}7O%b%8%e!<%k(B
\begin{description}
\item [{\tt refute.c}] $B=hM}7OK\BN(B
\item [{\tt unify.c}] $BC10l2=(B
\end{description}

\item $BAH$_9~$_=R8l$K4X$9$k%b%8%e!<%k(B
\begin{description}
\item [{\tt defsysp.c}] $BAH$_9~$_=R8l$N=i4|2=(B
\item [{\tt syspred1.c}] $BAH$_9~$_=R8l$NDj5A(B.1
\item [{\tt syspred2.c}] $BAH$_9~$_=R8l$NDj5A(B.2
\item [{\tt jpsgsub.c}] JPSG$B%Q!<%6MQAH$_9~$_=R8l$NDj5A(B
\end{description}

\item $B@)Ls2r>C7O$K4X$9$k%b%8%e!<%k(B
\begin{description}
\item [{\tt modular.c}] $B@)Ls2r>C7O%(%s%H%j!"6&DL%D!<%k(B
\item [{\tt trans.c}] $B@)Ls2r>C7O%a%$%s(B
\item [{\tt tr\_sub.c}] $B@)Ls2r>C7O%5%V(B
\item [{\tt tr\_split.c}] $BAG<0$NJ,3d%k!<%A%s(B
\end{description}
\end{itemize}

$B$3$l$i$N%b%8%e!<%k$r%3%s%Q%$%k!"%j%s%/$7$F<B9T%U%!%$%k$rF@$k!#(B
$BNc$($P(BUNIX$B$N>l9g$O>e5-$N%U%!%$%k$r0l$D$N%G%#%l%/%H%j$KCV$-!"(B
\begin{quote}
	{\tt cc -o cuprolog *.c <cr>}
\end{quote}
$B$H$9$k!#$^$?E:IU$N(Bmakefile$B$rMQ$$$F!"(B
\begin{quote}
	{\tt make <cr>}
\end{quote}	
$B$H$7$F$b$h$$!#(B

\par
$B%3%s%Q%$%k$NCm0U!#(B
$B;HMQ$9$k5!<o!"%3%s%Q%$%i$K$h$C$F$O!"%3%s%Q%$%kA0$K(Binclude.h$BCf$N:G=i$N(B
{\tt \#define}$BJ8$r=q$-49$($kI,MW$,$"$k!#(B
\begin{itemize}
\item SUN4$B$N>l9g!"(B{\tt \#define SUN4 1}
\item UNIX4.2BSD$B$N%i%$%V%i%j(B{\tt times()}$B$,%5%]!<%H$5$l$F$$$k>l9g!"(B
{\tt \#define CPUTIME 60}
\item $B$=$l0J30$N>l9g(B(CPU$B%?%$%`$OI=<($5$l$J$$(B)$B!"(B	{\tt \#define CPUTIME 0}
\end{itemize}

ver3.9(94/11/4) $B$h$j!"%9%H%j%s%04X?t$G(BEUC$B4A;z%3!<%I(B(2$B%P%$%H%3!<%I(B)$B$rG'<1(B
$B$9$k$3$H$,2DG=$H$J$C$?!#(B
include.h $B$K$F(B
\begin{quote}
{\tt \#define KANJI 1}
\end{quote}
$B$H$9$k$H!"(Bstrlen, divstr, substring, concat2, concat $B$NAH$_9~$_=R8l$K$F!"(B
$BA43Q%+%J$d4A;z(B(2$B%P%$%H(B)$B$r(B1$BJ8;z$HG'<1$7$?=hM}$r9T$J$&!#(B{\tt KANJI} 
$B$r(B 1 $B0J30$NCM$K@_Dj$9$k$H!"=>Mh$HF1$8$/(B1$B%P%$%H$r(B1$BJ8;z$H$7$?=hM}$r9T$J$&!#(B

$B$^$?!"(Bcu-Prolog$B$K$O0J2<$N%G!<%?NN0h$,$"$k!#(B
\begin{description}
\item [{\dg $B%7%9%F%`%R!<%W(B}:]	$B%W%m%0%i%`@a!"?7=R8lDj5AEy!#(B
	$B%G%U%)%k%HCM$O(B{\tt SHEAP\_SIZE} ($B%G%U%)%k%H$O(B600Kbytes)
\item [{\dg $B%f!<%6%R!<%W(B}:]	Prolog$BH?G};~$N0l;~E*$J9=B$Ey!#(B 
	$BBg$-$5$O(B{\tt HEAP\_SIZE}  ($B%G%U%)%k%H$O(B500Kbytes)
\item [{\dg $B@)Ls%R!<%W(B}:]	$B@)Ls!&(BPST$B$N0l;~E*$J9=B$Ey!#(B
	$BBg$-$5$O(B{\tt CHEAP\_SIZE}  ($B%G%U%)%k%H$O(B500Kbytes)
\item [{\dg $B4D6-%9%?%C%/(B}:]	Prolog$BH?G};~$N4D6-!#(B
	$BBg$-$5$O(B{\tt ESP\_SIZE}  ($B%G%U%)%k%H$O(B80Kbytes)
\item [{\dg $B%f!<%6%9%?%C%/(B}:]	Prolog$BH?G};~$N%]%$%s%?$N$D$1$+$(Ey!#(B
	$BBg$-$5$O(B{\tt USTACK\_SIZE}  ($B%G%U%)%k%H$O(B30Kbytes)
\item [{\dg $BJ8;zNs%R!<%W(B}:]	$BJ8;zNs$N3JG<NN0h!#(B
	$BBg$-$5$O(B{\tt NAME\_SIZE}   ($B%G%U%)%k%H$O(B50Kbytes)
\end{description}
cu-Prolog$B<B9TCf$K!"$3$l$i%R!<%W!"%9%?%C%/$N%*!<%P!<%U%m!<$,IQHK$K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$-$k!#(B
\item {\tt -Cxxx} : {\tt xxx}$B$K$O?tCM$r;XDj$9$k!#@)Ls%R!<%W$NBg$-$5(B
(Kbyte$BC10L(B)$B$rJQ99$9$k$3$H$,$G$-$k!#(B
\item {\tt -Exxx} : {\tt xxx}$B$K$O?tCM$r;XDj$9$k!#4D6-%9%?%C%/$NBg$-$5(B
(Kbyte$BC10L(B)$B$rJQ99$9$k$3$H$,$G$-$k!#(B
\item {\tt -Uxxx} : {\tt xxx}$B$K$O?tCM$r;XDj$9$k!#%f!<%6!<%9%?%C%/$NBg$-$5(B
(Kbyte$BC10L(B)$B$rJQ99$9$k$3$H$,$G$-$k!#(B
\item {\tt -Nxxx} : {\tt xxx}$B$K$O?tCM$r;XDj$9$k!#J8;zNs%R!<%W$NBg$-$5(B
(Kbyte$BC10L(B)$B$rJQ99$9$k$3$H$,$G$-$k!#(B
\item $B%U%!%$%kL>(B : $B5/F0$HF1;~$KFI$_9~$`%U%!%$%k$r;XDj$9$k!#(B
\end{itemize}

$BNc$($P!"%7%9%F%`%R!<%W$r(B800Kbytes, $B@)Ls%R!<%W$r(B600Kbytes, $B$G=i4|%U%!%$(B
$B%k(Bfoo.p$B$rFI$_9~$s$G(Bcu-Prolog$B$rN)$A>e$2$k$K$O!"(B
\begin{quote}
	{\tt cuprolog -S800 -C600 foo.p}
\end{quote}
$B$H$9$k!#(B
\par
cu-Prolog$B$r=*N;$9$k$K$O%H%C%W%l%Y%k$+$i!"(B{\tt \%Q} $B$^$?$O(B 
{\tt :-halt.}
$B$H$9$k!#(B

\subsection{$BBhFsHG$+$i$N2~NIE@(B}
cu-Prolog$BBh;0HG$O!"BhFsHG$HHf$Y<g$H$7$F0J2<$N$h$&$JE@$G2~NI$,$J$5$l$F(B
$B$$$k!#(B
\begin{itemize}
\item $B@)LsJQ49$N%b%8%e!<%k2=!&%^%K%e%"%k@)LsJQ49F3F~(B
\item PST($BItJ,9`(B)$B%G!<%?9=B$$NF3F~(B, $B$=$l$KH<$&@)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G@-L>(B/$BAG@-CM$NJB$S$r(B\verb+{}+$B$G0O$s$@$b$N!#(B
$BAG@-L>$O1Q>.J8;z$G;O$^$kJ8;zNs!"AG@-CM$O9`$r<h$k!#(B
\item [{\dg $B%3%a%s%H(B($B9T(B)}:] \verb+%%+$B$G;O$^$k9T!"$^$?$O(B\verb+\*+$B$H(B
\verb+*\+$B$G0O$^$l$?J8;zNs(B($B$3$N>l9g%3%a%s%H$NF~$l;R$O5v$5$J$$(B)
\end{description}

\subsection{$B@)LsIU%[!<%s@a(B(Constrained Horn Clause: CHC)}
cu-Prolog$B$N%W%m%0%i%`@a$O(B,Constrained Horn Clause(CHC: $B@)LsIU%[!<(B
$B%s@a(B)$B$H8F$P$l!"DL>o$N%[!<%s@a$K@)Ls$r2C$($?$b$N$K$J$C$F$$$k!#(BCHC$B$O0J2<(B
$B$N(B3$B<oN`$N@a$+$i$J$k!#(B
\begin{enumerate}
\item {\tt $H; C_{1},\cdots, C_{n}.$} \hfill ($B;v<B@a(B)
\item {\tt $H:-B_{1},\cdots, B_{m}; C_{1},\cdots, C_{n}$.} \hfill ($B%k!<%k@a(B)
\item {\tt $:-B_{1},\cdots, B_{n}; C_{1},\cdots, C_{n}$.} \hfill ($B<ALd@a(B)
\end{enumerate}
{\tt $H$}$B$OF,It(B($B%X%C%I(B)$B!"(B{\tt $B_{1},\cdots, B_{n}$}$B$OK\BN!"(B{\tt
$C_{1},\cdots, C_{n}$}$B$O@)LsIt$H8F$V!#@)LsIt$,6u$N@)LsIU$-%[!<%s@a$,DL(B
$B>o$N%[!<%s@a$G$"$k!#(B

$B$J$*!"%W%m%0%i%`$NK\BN$GAG<0$rI=$9JQ?t$b5v$7$F$$$k!#$3$l$K$h$j!"(B
\begin{verbatim}
        call(X) :- X.
        not(X)  :- X, !, fail.
        not(_).
\end{verbatim}
$B$H!"(B{\tt call/1}, {\tt not/1}$B$,Dj5A$G$-$k!#(B

\subsection{$BItJ,9`(B(PST)$B$N5-=R(B}
cu-Prolog$BBh;0HG$G$O(B
$BItJ,9`(B(Partially Specified Term: PST)$B$r9`$H$7$F;HMQ(B
$B$9$k$3$H$,$G$-$k!#ItJ,9`$O<!$N$h$&$K!"%i%Y%k$HCM$r(B{\tt /}$B$r%G%j%_%?$H(B
$B$7$?BP$NITDj8D$NJB$S$rCf3g8L$G0O$s$@$b$N$G$"$k!#%i%Y%k$O%"%H%`!"CM$O9`(B
$B$r$H$k!#(B
\begin{quote}
	{\tt \{l1/a, l2/X, l3/\{f/b,g/c\}\} }
\end{quote}

$BItJ,9`$NF3F~$K$h$jC10l2=$,3HD%$5$l$k!#(B
$BItJ,9`(BX,Y$B$NC10l2=7k2L$,ItJ,9`(BZ$B$N>l9g!"0J2<$,@.$jN)$D!#(B
\begin{itemize}
\item $\forall l, l/v \in X, l \not\in Y \rightarrow l/v \in Z$
\item $\forall l, l/v \in Y, l \not\in X \rightarrow l/v \in Z$
\item $\forall l, l/v \in X, l/u \in Y \rightarrow l/unify(u,v) \in Z$
\end{itemize}
$BNc$($P!"(B{\tt \{l/a,m/X\}} $B$H(B {\tt \{m/b,n/c\}} $B$NC10l2=7k2L$O(B 
{\tt \{l/a,m/b,n/c\}}
$B$H$J$k!#(B

$BF10l$NItJ,9`$,%W%m%0%i%`Cf$KJ#?t=P8=$9$k>l9g$K$O!"G^2pJQ?t$rMQ$$$F@)Ls(B
$B$K$h$jI=<($5$l$k!#Nc$($P(B
\begin{verbatim}
     f(X) :- g1(_p1,X),g2(_p2,X); _p1={f/a,g/c}.
\end{verbatim}
$B$N$h$&$K$J$k!#(B{\tt \%w}$B%3%^%s%I$G=q$-=P$5$l$?%U%!%$%kCf$G$O!"ItJ,(B
$B9`$rI=$9JQ?t$O>e$N$h$&$K(B {\tt \_p1,\_p2, $\cdots$} $B$HI=$5$l$k!#$3$N$h(B
$B$&$JG^2pJQ?t$O(B{\tt \%R}$B%3%^%s%I(B($B@)Ls$N%W%j%W%m%;%9(B)$B$K$h$C$F!"ItJ,9`$X$N%]%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(B($BAG<0Ns(B)$B$K$*$$$F(B

\begin{quote}
\begin{enumerate}
\item $BF10lJQ?t$,6&DL$N@.J,$r;}$DJ#?t$N0z?t0LCV$K=P8=$7$F$$$k!"$^$?(B
$B$O(B
\item $BF10lJQ?t$,@.J,(B\verb!{[]}!$B$N0z?t$H!"@.J,$,ItJ,9`$N%Q%9$N$_$N0z(B
$B?t0LCV$K8=$l$F$$$k!"$^$?$O(B
\item $B@.J,$,(B$\phi$$B$G$J$$0z?t0LCV$,6qBN2=$5$l$F$$$k>l9g(B
\end{enumerate}
\end{quote}
$B$O(B{\dg $B0MB84X78(B}$B$,$"$k$H$$$&(B.	\hfill $\Box$
\end{defs}

$BNc$($P!"(B{\tt Cmp(p,1) = \{f,g\}}, 
{\tt Cmp(q,1) = \{h\}}$B$N>l9g!"@)Ls(B{\tt p(\{f/b\})} $B$O0MB84X78$,$"$j!"(B
{\tt p(X),q(X)} $B$d(B 
{\tt p(\{l/a,m/b\})} $B$O0MB84X78$r;}$?$J$$!#(B

\begin{defs}[$B%b%8%e%i!<(B($B@)Ls$NI8=`7A(B)]
$B0MB84X78$NB8:_$7$J$$@)Ls$r%b%8%e%i!<$H$$$&!#(B\hfill $\Box$
\end{defs}


\subsection{BNF$B5-K!$K$h$k(Bcu-Prolog$B$N9=J8(B}
$B0J2<$O(Bcu-Prolog$B$N9=J8$N(BBNF$B$K$h$k5-=R$G$"$k!#(B
$B4A;z%3!<%I$O(BEUC$B$KBP1~$7$F$$$k!#(B
\small
\begin{eqnarray*}
<char>& ::= & <capital> | <small> | <digit> | <$B4A;z(B> \\
<charwhite> & ::= & <char> | <space>\\
<capital>& ::= & A|B|C| \ldots |X|Y|Z \\
<small>& ::= & a|b|c| \ldots |x|y|z \\
<digit>& ::= & 0|1|2|3|4|5|6|7|8|9 \\
<series> & ::= & <digit> | <digit><series> \\
<number>& ::= & <series> | <series>.<series> \\
<charseq>& ::= & <char> | <char><charseq> \\
<cwseq>& ::= & <charwhite> | <charwhite><cwseq> \\
<string>& ::= & "<cwseq>"\\
<smallseq>& ::= & <small> | <small><charseq> \\
<capitalseq>& ::= & <capital> | <capital><charseq> \\
<term>& ::= &<var> | <atom> | <smallseq>(<term\_list>) | <PST> \\
<term\_list>& ::= &<term> | <term>,<term\_list>\\
<var>& ::= &<capitalseq> | \_<charseq> | \_\\
<atom>& ::= &<constant>|<string>|<number>\\
<constant>& ::= &<smallseq> | '<cwseq>'\\
<PST>& ::= &{<pair\_list>}\\
<pair\_list>& ::= &<pair> | <pair>,<pair\_list>\\
<pair>& ::= &<name>/<term>\\ 
<af>& ::= &<smallseq>(<term\_list>) | <smallseq> | <op\_term> | <var> \\
<af\_ist>& ::= &<af> | <af>,<af\_list>\\
<HORN> & ::= & <af> | <af>:-<af\_list> | ?-<af\_list> \\
<CHC> & ::= & <horn>. | <horn>;<af\_list>. \\
<op\_term> &::= &<op1><term> | <term><op2><term>\\
<op1> &::= & not\\
<op2> &::= & <=> | = | =.. | > | >= | < | <= | == \\
\end{eqnarray*}
\normalsize

\section{$B%7%9%F%`%3%^%s%I0lMw(B}
cu-Prolog$B$N%H%C%W%l%Y%k$N%3%^%s%I$K$O0J2<$N$b$N$,MQ0U$5$l$F$$$k!#(B
$B$3$3$G!"(B{\em predicate}$B$O!"(B{\em predicate\_name}$B$^$?$O(B 
{\em predicate\_name}{\tt /}{\em arity}$B$rI=$9$H$9$k!#(B

\subsection{Prolog$B$K4X$9$k%3%^%s%I(B}
\begin{tabular}{ll}
{\tt \%h}&	$B%X%k%W(B	\\
{\tt \# {\em OS\_command}} & OS$B$N%3%^%s%I$r<B9T$9$k(B\\
{\tt \%d} {\em predicate}	& $B=R8l$NDj5A$rI=<($9$k(B\\
{\tt \%d.}& $BA4=R8l$NDj5A$rI=<($9$k(B\\
{\tt \%d/} &  $B=R8lL>$rI=<($9$k(B($B4JLs$5$l$?=R8l$b4^$`(B) \\
{\tt \%d?} &  $B=R8lL>$rI=<($9$k(B($B4JLs$5$l$?=R8l$O4^$^$J$$(B)\\
	   &  $B%7%9%F%`AH$_9~$_=R8l$K$O(B \verb%+%:recursive, \verb%^%:functor\\
	   &  $B%f!<%6=R8l$K$O(B \verb+*+:spied,\verb+-+:reduced,\verb-+-:recursive,\verb+#+:$B@)LsJQ49$K$h$k?7=R8l(B\\
{\tt \%f}	& $B%7%9%F%`%R!<%W$N;HMQ>u67$rI=<((B\\
{\tt \%G}	& ($B@EE*(B)$B%,!<%Y%8%3%l%/%7%g%s(B\\
{\tt \%Q}&	cu-Prolog$B$r=*N;$9$k(B	\\
{\tt \%R}	& $B%7%9%F%`%j%;%C%H(B\\
{\tt \%S}	& $BD>A0$N<ALd$N=hM}$KBP$9$kE}7W>pJs$NI=<((B\\
{\tt \%c {\em $B?t(B}}	& $B?dO@$N?<$5$N>e8B$r@_Dj$9$k!#$3$l$h$j?<$$%4!<(B
$B%k$O<:GT$H$9$k(B\\
{\tt \%u}	& $BL$Dj5A=R8l$r%(%i!<(B(TURE)$B$K$9$k$+!"<:GT(B(FALSE)$B$K$9$k(B
$B$+$N%9%$%C%A(B\\
\end{tabular}

\subsection{$B%U%!%$%kF~=PNO$K$D$$$F$N%3%^%s%I(B}
\begin{tabular}{ll}
{\tt "{\em filename}"} & $B%W%m%0%i%`%U%!%$%k$r%(%3!<%P%C%/$J$7$GFI$_9~$`(B
\\
{\tt "{\em filename}?}& $B%W%m%0%i%`%U%!%$%k$r%(%3!<%P%C%/$D$-$GFI$_9~$`(B
\\
{\tt \%l {\em filename}}	& $B%m%0%U%!%$%k$r@_Dj$9$k(B\\
{\tt \%l no}		& $B%m%0%U%!%$%k$X$N5-O?$rCf;_$9$k(B\\
{\tt \%w {\em filename}}	& $B%W%m%0%i%`$r%U%!%$%k$K=q$-=P$9(B\\
\end{tabular}

\subsection{$B%G%P%C%0%3%^%s%I(B}
\begin{tabular}{ll}
{\tt \%p {\em predicate}} & $B=R8l$N%9%Q%$%U%i%0$r@_Dj(B/$B2r=|$9$k%9%$%C%A(B\\
{\tt \%p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8=`7A$G$J$$@)Ls$r;}$DDj5A@a$rI=<($9$k(B
\end{tabular}

\subsection{$B$=$NB>$N%3%^%s%I(B}
\begin{tabular}{ll}
{\tt \%C}	& JPSG$B%Q!<%6MQAH9~$_%U%!%s%/%?(Bcat()$B$r:FDj5A$9$k!#(B
\end{tabular}

\subsection{Macintosh$BHG(B cu-Prolog$B%a%K%e!<(B}
Macintosh$BHG$G$O!"%7%9%F%`%3%^%s%I$NB?$/$,%a%K%e!<$+$i<B9T$G$-$k!#(B
\subsubsection{File$B%a%K%e!<(B}
\begin{tabular}{ll}
{\tt Open}	& cu-Prolog$B$N%W%m%0%i%`%U%!%$%k$rFI$_9~$`(B\\
{\tt Save Predicates}	& $B%W%m%0%i%`$r%U%!%$%k$K=q$-=P$9(B({\tt \%w})\\
{\tt Quit}	& cu-Prolog$B$r=*N;$9$k(B({\tt \%Q})
\end{tabular}

\subsubsection{Command$B%a%K%e!<(B}
\begin{tabular}{ll}
{\tt Help}	& $B%X%k%W$rI=<($9$k(B({\tt \%h})\\
{\tt Show Predicate}	& $B=R8lDj5A$rI=<($9$k(B({\tt \%d})\\
{\tt Set Log File}	& $B%m%0%U%!%$%k$r@_Dj!&2r=|$9$k(B({\tt \%l})\\
{\tt Preprocess Constraint}	& $B@)Ls$rA0=hM}$9$k(B({\tt \%P})\\
{\tt Max \# of Refutation}	& Prolog$B?dO@$NCJ?t$N:GBg$r@_Dj$9$k(B({\tt \%c})\\
{\tt List New Predicates}	& $B@)LsJQ49$G:n$i$l$??7=R8l$NF3F~@a$rI=<($9$k(B({\tt \%L})\\
{\tt Reset}	& cu-Prolog$B$N%j%;%C%H(B({\tt \%R})\\
{\tt Handling Undef}	& $BL$Dj5A=R8l$r%(%i!<(B(true),$B<:GT(B(false)$B$K$9$k$+$r@Z$jBX$($k(B({\tt \%u})\\
{\tt Print Level}	& $BI=<($N%l%Y%k$r@_Dj$9$k(B\\
{\tt Garbage Collection}	& $B@EE*%,!<%Y%8%3%l%/%7%g%s$r9T$&(B($BL$%5%]!<%H(B {\tt\%G})\\
{\tt New Predicate Name}	& $B@)LsJQ49$G$G$-$k?7=R8l$NL>A0$r:FDj5A$9$k(B({\tt \%n})\\
{\tt Max \# of Vars in Trans}	& $B@)LsJQ49$G0l@)LsCf$NJQ?t$N:GBg8D?t$r@_Dj$9$k!#$3$l$r1[$($k@)Ls$O=hM}$7$J$$!#(B\\

\end{tabular}
\subsubsection{Trace$B%a%K%e!<(B}
\begin{tabular}{ll}
{\tt Step Trace}	& $B%9%F%C%W%H%l!<%9%b!<%I$K$9$k(B({\tt \%s})\\
{\tt Normal Trace}	& $B%N!<%^%k%H%l!<%9%b!<%I$K$9$k(B({\tt \%t})\\
{\tt Trace Off}	& $B%N!<%H%l!<%9$K$9$k(B\\
{\tt Marking Spy}	& $B=R8l$N%9%Q%$%U%i%0$r@_Dj$9$k(B({\tt \%p})\\
\end{tabular}

\subsubsection{MODE$B%a%K%e!<(B}
\begin{tabular}{ll}
{\tt All Modular mode}	& $B@)Ls$rA4It%b%8%e%i!<$KJQ49$9$k(B({\tt \%a})\\
{\tt M-solvable mode}	& $B@)Ls$r(BM-solvable$B%b!<%I$GJQ49$9$k(B($BDj5A@a$N>/(B
$B$J$/$H$b0l$D$,%b%8%e%i!<$K$J$k(B)\\
\end{tabular}

\section{cu-Prolog $BAH9~$_=R8l!&%U%!%s%/%?(B}
\subsection{$B0lHLE*$JAH9~$_=R8l(B}
cu-Prolog$BBh;0HG$G$O!"0J2<$NAH9~$_=R8l$,MQ0U$5$l$F$$$k!#(B
$B0z?t$N%b!<%I$O!"(B+$B$O6qBN2=$5$l$?9`!"(B-$B$O<+M3JQ?t$rI=$9!#(B
$B$J$*!"(Bstrlen, divstr, substring, concat2, concat $B$N%9%H%j%s%04X78$NAH$_(B
$B9~$_=R8l$G$O(BEUC$B4A;z%3!<%I$rG'<1$7$?=hM}$b$G$-$k!#>\$7$/$OK\9F:G=i$N%3%s(B
$B%Q%$%k$NCm0U$r;2>H$N$3$H!#(B

\subsubsection{$B4X?tE*$JAH$_9~$_=R8l(B}
$B2r$,0l$D(B($B%P%C%/%H%i%C%/$7$J$$(B)$B$N=R8l$G$"$k!#(B
\begin{tabbing}
PREDICATE1234567890\= FUNCTION \kill
$B=R8l(B	\> $BF0:n(B\\
{\tt !/0} \> $B%+%C%H(B \\
{\tt abolish/2} \> {\tt abolish(P+,A+)} $B=R8l(B{\tt P/A}$B$NDj5A$r>C5n$9$k(B\\
{\tt arg/3} \> {\tt arg(Pos+,T+,Arg-)} {\tt T}$B$N(B{\tt Pos}$BHVL\$N0z?t$r(B
{\tt Arg}$B$HC10l2=$9$k(B\\
	\> $BNc(B:{\tt arg(2,test(a,b,c),X)}$B$G$O(B{\tt X=b}\\
{\tt assert/1,2,3} \> 
     {\tt assert(Head+),assert(Head+,Body+),assert(Head+,Body+,Cstr+)}\\
	\> $B@a(B {\tt Head:-Body;Cstr}$B$r%W%m%0%i%`$N:G8e$KIU$12C$($k(B\\
{\tt asserta/1,2,3} \> $B@a$r%W%m%0%i%`$N:G=i$KIU$12C$($k(B\\
{\tt assertz/1,2,3} \> $B@a$r%W%m%0%i%`$N:G8e$KIU$12C$($k(B\\
{\tt attach\_constraint/1} \> {\tt attach\_constraint(Cstr+)} 
{\tt Cstr}$B$r?7$?$J@)Ls$H$7$FIU$12C$($k(B\\
	\> {\tt Cstr}$B$OAG<0$^$?$OAG<0$N%j%9%H(B\\
{\tt atom\_to\_str/2} \> {\tt atom\_to\_str(ATOM+,STR-)} \\
	\> $B%"%H%`$rJ8;zNs$KJQ49$9$k!#(B\\
{\tt close/1} \> {\tt close(FP+)} {\tt open/3}$B$G:n$i$l$?%U%!%$%k%]%$%s%?(B{\tt FP}$B$rJD$8$k(B\\
{\tt compare/3} \> {\tt compare(X+,Y+,C-)} {\tt X}$B$H(B{\tt Y}$B$,6&$K?tCM(B
$B$^$?$OJ8;zNs$N;~$K$=$l$i$NBg>.4X78$rJV$9!#(B\\
\> {\tt C}$B$NCM$O(B\verb->-,\verb-==-,\verb-<-$B$N$$$:$l$+$G$"$k!#(B\\
	\> $BNc(B: {\tt compare("abc","xyz",'<')}\\
	\> \hspace{15pt}{\tt compare(123,456,'<')}\\
{\tt concat2/2} \> {\tt concat2(Str+,List-)} $BJ8;zNs(B{\tt Str}$B$r0lJ8;zKh(B
$B$KJ,2r$7$?%j%9%H$r(B{\tt List}$B$HC10l2=$9$k(B\\
	\> $BNc(B: {\tt concat2("ab",["a","b"])}\\
{\tt default} \> {\tt default(X?,Y+,Z+)} PST$B$N(B{\tt X}$B$,(B{\tt Y}$B$N(B
$BB0@-CM$r0l$D$G$b4^$^$J$1$l$P(Bfail,\\
	\>$B$=$&$G$J$1$l$P(B{\tt X}$B$K(B{\tt Z}$B$,DI2C$5$l$k!#(B\\
	\>$BNc(B: {\tt :- X=\{pos/p,sem/Y\},default(X,\{pos/p\},\{ajn/[],refl/[]\}).} $B$J$i(B\\ 
	\>{\tt X=\{pos/p,ajn/[],refl/[],sem/Y\}}\\
	\>\hspace{15pt}{\tt :- X=\{pos/n,sem/Y\},default(X,\{pos/p\},\{ajn/[],refl/[]\}).} 
	$B$O(Bfail\\
{\tt divstr/4} \> {\tt divstr(X+,N+,Y-,Z-)}
$BJ8;zNs(B{\tt X}$B$N(B{\tt N}$BHVL\$+$iA0$r(B{\tt Y}$B$K8e$r(B{\tt Z}$B$K%P%$%s%I$9$k(B\\
	\>({\tt N}$B$,Ii$N>l9g$OJ8;zNs$NKvHx$+$i?t$($k(B)\\
	\> $BNc(B: {\tt divstr("abcdefg",3,"abc","defg").}\\
	\>\hspace{15pt}{\tt divstr("abcdefg",-2,"abcde","fg").}\\
{\tt equal/2} \> {\tt equal(X,Y)} {\tt X}$B$H(B{\tt Y}$B$rC10l2=$9$k(B\\
{\tt neq/2} \> {\tt neq(X,Y)} {\tt X}$B$H(B{\tt Y}$B$,C10l2=2DG=$J>l9g@.8y$9$k(B\\
{\tt eq/2} \> {\tt eq(X,Y)} {\tt X}$B$,(B{\tt Y}$B$HEy$7$$$+%A%'%C%/$9$k(B\\
{\tt fail/0}  \> $B>o$K<:GT$9$k(B \\
{\tt functor/3} \> {\tt functor(T+,F,A)} {\tt T}$B$N=R8lL>$,(B{\tt F/A}\\
	\>$BNc(B: {\tt functor(p(a,b),p,2)}\\
{\tt geq/2}	\> {\tt geq(X+,Y+)} $B?tCMHf3S(B ({\tt X>=Y})\\
{\tt greater/2} \> {\tt greater(X+,Y+)} $B?tCMHf3S(B ({\tt X > Y})\\
{\tt halt/0}	\> cu-Prolog$B$r=*N;$9$k(B\\
{\tt leq/2}	\> {\tt leq(X+,Y+)} $B?tCMHf3S(B({\tt X=<Y})\\
{\tt less/2} \> {\tt less(X+,Y+)} $B?tCMHf3S(B({\tt X < Y})\\
{\tt ml/2}	\> univ.$B=R8l(B {\tt ml(T+,L-)} $B$O(B {\tt T=..L}$B$HEy2A(B\\
	\> {\tt L}$B$O9`(B{\tt T}$B$N=R8lL>$H0z?t$+$i$J$k%j%9%H$G$"$k(B\\
	\>$BNc(B: {\tt ml(f(a,b,c),X) --> X=[f,a,b,c]}\\
{\tt multiply/3} \> {\tt multiply(X+,Y+,Z-)} $B?tCM>h;;(B \verb$X * Y = Z$\\
{\tt name/2} \> {\tt name(A+,L-)} $BJ8;zNs(B{\tt A}$B$rJ8;z$N%j%9%H(B
{\tt L}$B$KJQ49(B\\
	\>$BNc(B: {\tt name(abc,[97,98,99])}.\\
{\tt nl/0}	\> `\verb+\n+'$B$rI=<($9$k(B\\
{\tt op/3}	\> {\tt op(P+,T+,Op+)} $B1i;;;R$^$?$O$=$N%j%9(B
$B%H(B{\tt Op}$B$r(B,$BM%@hEY$r(B{\tt P}$B!"%?%$%W$r(B{\tt T}$B$H$7$FDj5A$9$k(B\\
	\>$BM%@hEY$O(B0$B$+$i(B1000$B$^$G!#%?%$%W$O(B{\tt xf,yf,fx,fy,xfx,xfy,yfx}$B$N(B
$B2?$l$+$G$"$k!#(B\\
	\> $BNc(B: {\tt :-op(700,xfx,'=').}\\
{\tt open/3}	\> {\tt open(FileName+,Type+,FP-)} $B%9%H%j!<%`$r3+$/(B\\
	\> {\tt FileName}$B$O%U%!%$%kL>(B, {\tt Type}$B$O(B {\tt r} (read) $B$^$?$O(B 
{\tt w} (write). \\
	\>{\tt FP}$B$O?7$7$/:n$i$l$k%U%!%$%k%]%$%s%?$G$"$k(B.\\
{\tt pnames/2} \> {\tt pnames(PST+,FL)} {\tt PST}$B$NAG@-L>$N%j%9%H$r(B
{\tt FL}$B$HC10l2=$9$k(B\\
	\> $BNc(B: {\tt pnames(\{l/a,m/b\},[l,m])}.\\
{\tt pvalue/3} \> {\tt pvalue(PST+,F+,V)} {\tt PST}$B$NAG@-(B{\tt F}$B$NCM$r(B
{\tt V}$B$HC10l2=$9$k(B\\
	\> PST$B$KAjEv$9$kAG@-$,$J$$>l9g$K$O(Bfail$B$9$k(B\\
{\tt read/1}	\> {\tt read(X)} $B8=%9%H%j!<%`$+$i9`$rFI$_9~$_0z?t$HC10l2=$9$k(B\\
	\> {\tt read(X)} $B$KBP$7$F%W%m%s%W%H(B({\tt ?})$B$,=P$FF~NOBT$A$H$J(B
$B$k(B.\\
	\> $B%-!<%\!<%I$+$iF~NO$5$l$?J8;zNs$H(B{\tt X}$B$H$,C10l2=$9$k(B.\\
{\tt read/2}	\> {\tt read(X-,FP+)} $B$O%U%!%$%k%]%$%s%?(B{\tt FP}$B$+$iFI$_9~$`(B.\\
	\> {\tt FP}$B$,%U%!%$%kKvHx$J$i$P!"(B{\tt X}$B$O(B{\tt end\_of\_file}$B$H(B
	$BC10l2=$9$k(B\\
{\tt reset\_timer/0} \> CPU$B%?%$%^$r%j%;%C%H$9$k(B ({\tt timer/2}$B;2>H(B)\\
{\tt retract/1,2,3}	\> {\tt retract(Head+), retract(Head+,[Body+]),retract(Head+,[Body+],[Cstr+])}\\
	\>{\tt Head:-Body;Cstr.} $B$HC10l2=$9$k@a$r0l$D>C5n$9$k(B\\
	\> $BNc(B: {\tt retract(p1(a))} : $B@a(B {\tt p1(a).} $B$,>C5n$5$l$k(B\\
	\> \hspace{15pt}{\tt retract(f(X),[m(X,Y)])} : $B@a(B {\tt f(X):-m(X,Y).} $B$,>C5n$5$l$k(B\\
	\> \hspace{15pt}{\tt retract(f(X),[m(X,Y)],[c(Y)])} : $B@a(B {\tt f(X):-m(X,Y);c(Y).} $B$,>C5n$5$l$k(B\\
{\tt see/1}	\> {\tt see(F-)} 
	$BL>A0(B{\tt F}$B$N%U%!%$%k$,8=F~NO%9%H%j!<%`$K$J$k(B\\
{\tt seen/0}	\> {\tt see/1}$B$G:n$i$l$?8=F~NO%9%H%j!<%`$rJD$8$k(B\\
{\tt strcmp/3} \> {\tt strcmp(X+,Y+,C-)} $BJ8;zNs(B{\tt X,Y}$B$NBg>.4X78$r(B
	{\tt C}$B$K%P%$%s%I$9$k(B\\
	\> {\tt C}$B$NCM$O(B\verb->-,\verb-==-,\verb-<-$B$N$$$:$l$+(B\\	
	\> $BNc(B: {\tt strcmp("abc","xyz",'<').}\\
{\tt strlen/2}	\> {\tt strlen(S+,L)} {\tt L}$B$OJ8;zNs(B{\tt S}$B$ND9$5(B\\
	\> $BNc(B: {\tt strlen("abcdef",6).}\\
{\tt substring/3}\> {\tt substring(X+,N+,Y-)} $BJ8;zNs(B{\tt X}$B$N(B{\tt N}$BHV(B
$BL\0J9_$r(B{\tt Y}$B$K%P%$%s%I$9$k(B\\
	\>({\tt N}$B$,Ii$N>l9g$OJ8;zNs$NKvHx$+$i?t$($k(B)\\
	\> $BNc(B: {\tt substring("abcdefg",3,"defg")}\\
	\> \hspace{15pt}{\tt substring("abcdefg",-3,"efg").}\\
{\tt substring/4}\> {\tt substring(X+,N+,L+,Y-)} $BJ8;zNs(B{\tt X}$B$N(B
{\tt N}$BHVL\0J9_(B{\tt L}$B8D$NJ8;zNs$r(B{\tt Y}$B$K%P%$%s%I$9$k(B\\
	\>({\tt N}$B$,Ii$N>l9g$OJ8;zNs$NKvHx$+$i?t$($k(B)\\
	\> $BNc(B: {\tt substring("abcdefg",3,2,"de")}\\
	\> \hspace{15pt}{\tt substring("abcdefg",-3,2,"ef").}\\
{\tt sum/3} \> {\tt sum(X,Y,Z)} $B?tCM2C;;(B \verb$X + Y = Z$\\
	\> ($BCm(B:$B>/$J$/$H$b(B2$B$D$N0z?t$O?tCM$K%P%$%s%I$7$F$$$l$P$h$$(B)\\
{\tt tab/0}	\> $B%?%V$rI=<($9$k(B \\
{\tt tab/1}	\> {\tt tab(FP+)} $B%U%!%$%k%]%$%s%?(B{\tt FP}$B$K%?%V$r=PNO$9$k(B\\
{\tt tell/1}	\> {\tt tell(T+)} $BL>A0(B{\tt T}$B$N%U%!%$%k$r8==PNO%9%H%j!<(B
$B%`$K$9$k(B\\
{\tt timer/2} \> {\tt timer(X-,Y-)} 
	{\tt X}$B$O(B{\tt reset\_timer}$B0J8e$N(BCPU$B;~4V!"(B\\
	\>{\tt Y}$B$K$O$=$NFb@)LsJQ49$G;H$o$l$?(BCPU$B;~4V$r%P%$%s%I$9$k(B\\
{\tt told/0}	\> {\tt tell/1}$B$G:n$i$l$?8==PNO%9%H%j!<%`$rJD$8$k(B\\
{\tt true/0}	\> $B>o$K@.8y$9$k(B\\
{\tt unbreak/0} \> $B%9%F%C%W%H%l!<%9$G(Bbreak$B$7$?8e!"(B:-unbreak.$B$G$=$N;~E@(B
$B$KLa$k(B\\
{\tt var/1}	\> {\tt var(T)} {\tt T}$B$,<+M3JQ?t$G$"$k$H$-@.8y(B\\
{\tt write/1} \> {\tt write(T)} $B9`(B{\tt T}$B$rI=<($9$k(B\\
	\> {\tt T}$B$,%9%H%j%s%0$N>l9g!"0zMQ5-9f$OI=<($5$l$J$$(B
\end{tabbing}

\subsubsection{$B=R8lE*$JAH$_9~$_=R8l(B}
$B2r$,J#?t$"$j$&$k(B($B%P%C%/%H%i%C%/$9$k(B)$BAH$_9~$_=R8l$G$"$k!#(B
\begin{tabbing}
PREDICATE1234567890\= FUNCTION \kill
$B=R8l(B	\> $BF0:n(B\\
{\tt apnd/3}	\> {\tt apnd(List,List,List+)} $B$^$?$O(B 
	{\tt apnd(List+,List,List)}\\
	\> ($BBh(B1$B$b$7$/$OBh(B3$B0z?t$,%P%$%s%I$5$l$F$$$J$1$l$P(Bfail)  
	{\tt append}$B=R8l$NAH$_9~$_HG(B\\
{\tt clause/3} \> {\tt clause(T+,Body-,Cstr-)} {\tt T}$B$HC10l2=$9$k%X%C%I(B
	$B$r;}$D@a$N(B\\
	\> $BK\BN$r(B{\tt Body},$B@)Ls$r(B{\tt Cstr}$B$K%P%$%s%I$9$k(B\\
{\tt concat/3} \> {\tt concat(S1,S2,S)} $BJ8;zNs(B{\tt S1}$B$H(B{\tt S2}$B$rO"7k(B
$B$7$?$b$N$r(B{\tt S}$B$H%P%$%s%I$9$k(B\\
	\> {\tt concat(S1+,S2+,S-)} $B$^$?$O(B {\tt concat(S1-,S2-,S+)}\\
	\>$BNc(B: {\tt concat("ab","cd",S) --> S="abcd"}\\
	\>\hspace{15pt}{\tt concat(X,Y,"abc") -->} \\
	\> \hspace{17pt} {\tt X="",Y="abc" or X="a",Y="bc" or X="ab",Y="c" or X="abc",Y=""}\\
{\tt count/1} \> {\tt count(X-)} $B8F$S=P$7Kh$K0[$J$k?t(B
	({\tt X=0,1,2,$\cdots$})$B$rJV$9(B\\
{\tt execute/1} \> {\tt execute(L+)} $B%j%9%H(B{\tt L}$B$GM?$($i$l$?AG<0Ns$r(B
$B=g<!<B9T$9$k(B\\
	\>{\tt execute([memb(X,[a,b]),memb(X,[b,c])])}\\
{\tt gensym/1} \> {\tt gensym(X-)} $B8F$S=P$7Kh$K0[$J$kJ8;zNs$rJV$9!#(B\\
	\>$B=i4|CM$O%3%^%s%I(B\verb-%n-$B$GJQ$($i$l$k(B($B%G%U%)%k%H$O(B{\tt c})\\
{\tt isop/3}	\> {\tt isop(Prec,Type,OP)} {\tt Prec}$B$H(B{\tt Type}$B$O1i(B
$B;;;R(B{\tt OP} $B$NM%@hEY$H%?%$%W(B\\
	\> $BNc(B: {\tt :-isop(X,Y,Z).} $B$KBP$7(B {\tt X=900, Y=xfy, Z='/'} $BEy(B\\
{\tt memb/2}	\> {\tt member(Atom,List+)} {\tt member}$B=R8l$NAH$_9~$_HG(B\\
{\tt or/2,3,4,5}	\> $BJ#?t$N%4!<%k$r<B9T(B\\
	\> $BNc(B: {\tt :-or(memb(X,[a,b]),memb(X,[j,k])).}\\
	\> \hspace{17pt} {\tt --> X=a,b,j,k}\\
\end{tabbing}

\subsection{$B@)LsJQ49$K4X$9$kAH9~$_=R8l(B}
\begin{tabbing}
PREDICATE1234567890\= FUNCTION \kill
$B=R8l(B	\> $BF0:n(B\\
{\tt condname/2}	\> {\tt condname(Cstr+,PL-)} $B@)Ls(B{\tt Cstr}$B$N(B
$B=R8lL>$N%j%9%H$r(B{\tt PL}$B$K%P%$%s%I$9$k(B\\
	\> $BNc(B: {\tt condname([f(a,b),g(c,d)],[g,f])}\\
{\tt pcon/0}	\> $B=R8l<B9T;~E@$G$N@)Ls$rI=<($9$k(B\\
{\tt project\_cstr/1}	\> {\tt project\_cstr(Term+)} 
$B=R8l<B9T;~E@$G$N@)Ls$N$&$A!"(B\\
$B9`(B{\tt Term}$B$NCf$K4^$^$l$kJQ?t$K4XO"$9$k$b$N$rI=<($9$k(B\\
{\tt project\_cstr/2}	\> {\tt project\_cstr(Term+,Var-)} 
$B=R8l<B9T;~E@$G$N@)Ls$N$&$A!"(B\\
$B9`(B{\tt Term}$B$NCf$K4^$^$l$kJQ?t$K4XO"$9$k$b$N$rJQ?t(B{\tt Var}$B$K%P%$%s%I$9$k(B\\
{\tt unify/2} \> {\tt unify(C+,NC-)} {\tt C}$B$r@)LsJQ49$7$?$b$N$r(B
{\tt NC}$B$K%P%$%s%I$9$k(B\\
	\> {\tt C},{\tt NC}$B$O$N$h$&$JAG<0$N%j%9%H(B \\
	\> $BNc(B: {\tt unify([member(X,[a,b,c]),f(X,Y)],[c0(X,Y)])}
\end{t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,3$B0J30(B\\
2 \>$BCM$H$7$FJ8K!HOaF$r0l$D<h$kAG@-(B(Adjacent$BEy(B)\\
3 \>$BCM$H$7$FJ8K!HOaF$N=89g$r<h$kAG@-(B(Subcat$BEy(B)
\end{tabbing}

$B%G%U%)%k%H$G$O!"(B{\tt [POS,1,FORM,1,AJA,2,AJN,2,SC,3,SEM,1]} $B$D$^$j(B
\begin{tabbing}
fffffamejjjjj\=JPSG feature\kill
$BAG@-L>(B \>  $BBP1~$9$k(BJPSG$B$NAG@-(B\\
POS \> pos\\
FORM \> gr,vform,pform, and so on\\
AJA \> adjacent\\
AJN \> adjunct\\
SC \> subcat\\
SEM \> sem
\end{tabbing}
$B$H$J$C$F$$$k!#(B

$B$^$?(B{\tt tree}$B%3%^%s%I$K$h$j(B{\tt cat}$B%U%!%s%/%?$O(B
\begin{quote}
{\tt $BBh(B1$BAG@-CM(B[$BBh(B2$BAG@-CM(B, $BBh(B3$BAG@-L>(B:$BBh(B3$BAG@-CM(B, $\cdots$ ]:$B:G=*AG@-CM(B}
\end{quote}
$B$N=g$K!"$5$i$KAG@-CM$,(B{\tt []}$B$NAG@-$O>J$$$F%W%j%s%H$5$l$k!#(B

\begin{defs}[$BMzNr(B]
$BMzNr$O<!$N$h$&$KDj5A$5$l$k(B
\begin{itemize}
\item $BJ8K!HOaF$OMzNr(B
\item {\tt C}$B$H(B{\tt W}$B$,J8K!HOaF$N;~(B{\tt t(C,W,[ ])}$B$OMzNr(B
\item {\tt L}$B$H(B{\tt R}$B$,MzNr!"(B{\tt M}$B$,J8K!HOaF$N;~!"(B{\tt t(M,L,R)}$B$OMzNr(B
\item {\tt L}$B$H(B{\tt R}$B$,MzNr!"(B{\tt C}$B$H(B{\tt W}$B$,J8K!HOaF$N;~!"(B
{\tt t(t(C,W,[ ]),L,R)}$B$OMzNr(B \hfill $\Box$
\end{itemize}
\end{defs}

\par
{\tt tree(t(C,W,[ ]))}$B$O(B
\begin{verbatim}
     C--W
\end{verbatim}
$B$r=PNO$7!"(B{\tt tree(t(M,L,cat(n,ga,[],[],[],ken)))}$B$O(B
\begin{verbatim}
     ---M
      |
      |-L
      |
      |-n[ga]:ken
\end{verbatim}
$B$r=PNO$9$k!#(B

\section{$B%U%!%$%k$NF~=PNO(B}
\subsection{$B%W%m%0%i%`$NFI$_9~$_(B}
\begin{itemize}
\item $B%7%9%F%`5/F0$HF1;~$KFI$_9~$`$K$O!"(BOS$B$N%W%m%s%W%H$+$i(B
\begin{quote}
	{\tt cuprolog {\em filename}}
\end{quote}
$B$H$9$k!#%(%3!<%P%C%/$O$J$$!#(B
\item $B%H%C%W%l%Y%k$+$i%(%3!<%P%C%/$J$7$GFI$_9~$`(B
\begin{quote}
	{\tt "{\em filename}" }
\end{quote}
\item $B%H%C%W%l%Y%k$+$i%(%3!<%P%C%/$"$j$GFI$_9~$`(B($B%G%P%C%0;~$J$I(B)
\begin{quote}
	{\tt "{\em filename}? }
\end{quote}
\end{itemize}

\subsection{$B%W%m%0%i%`$NJ]B8(B}
$B%W%m%0%i%`$r%U%!%$%k$KJ]B8$9$k$K$O!"%H%C%W%l%Y%k$+$i(B
\begin{quote}
	{\tt \%w {\em filename} }
\end{quote}
$B$H$9$k!#(B

\subsection{$B%m%0%U%!%$%k$N@_Dj!"2r=|(B}
\begin{itemize}
\item $B%m%0%U%!%$%kL>$r@_Dj$9$k!#$3$l0J8e$N2hLL$O$9$Y$F@_Dj$5$l$?%U%!%$%k(B
$B$K3JG<$5$l$k!#(B
\begin{quote}
	{\tt \%l {\em filename} }
\end{quote}
\item $B%m%0$NCf;_(B
\begin{quote}
	{\tt \%l no }
\end{quote}
\end{itemize}

\section{$B@)LsJQ495!9=(B}

\subsection{$B@)LsJQ49$N$_$N<B9T(B}
$B<!$N$h$&$K!"@)LsJQ495!9=$N$_$rC1FH$G<B9T$9$k$3$H$,$G$-$k!#(B

\subsubsection{@$B%b!<%I(B}
$B%H%C%W%l%Y%k$+$i@)LsJQ495!9=$rC1FH$G;H$&$3$H$,$G$-$k(B($B<g$K%G%P%C%0MQ(B)$B!#(B
\begin{quote}
	{\tt @ member(X,[a,b,c]),member(X,[b,c,d]).}
\end{quote}
$B$H$9$k$H!"(Bcu-Prolog$B$O$3$l$HEy2A$G%b%8%e%i!<$J@)Ls(B($BNc$($P(B
{\tt c0(X)})$B$H!"@)LsJQ49$N:]$K:n$i$l$??7=R8l$NDj5A$rJV$9!#(B

\subsubsection{{\tt unify(C,NC)}}
$BAH$_9~$_=R8l(B{\tt unify}$B$K$h$j(BProlog$B>e$GJQ49%k!<%A%s$rM[$K;H$&$3$H$b$G$-$k!#(B
$B$3$N>l9g!"@)Ls$O<!$N$h$&$KAG<0$rMWAG$H$9$k%j%9%H$G5-=R$9$k!#(B
\begin{quote}
	{\tt [c0(X,[a,b,c]), c1(P,Q,R), c2(Q,S)] }
\end{quote}
{\tt unify(OldCond, NewCond)}$B$O!"(B{\tt OldCond}$B$,%j%9%H7A<0$N@)Ls$K6qBN(B
$B2=$5$l$F$$$F!"(B{\tt NewCond}$B$,<+M3JQ?t$N>l9g$K$N$_@)LsJQ49$r<B9T$7!"(B
{\tt NewCond}$B$K$O!"(B{\tt OldCond}$B$HEy2A$G%b%8%e%i!<$J@)Ls$,3JG<$5$l$k!#(B

\subsection{$B@)LsJQ49$NA`:n(B}
$B@)LsJQ49$G$G$-$k?7$7$$@a$N=89g(B($B0J2<!"!V@a=89g!W$H8F$V(B)$B$H$7$F!"0J2<$N(B3
$B$D$rMQ0U$9$k!#(B
\begin{description}
\item [{\tt DEFINITION}] $B?7=R8l$NF3F~@a(B
\item [{\tt NON-MODULAR}] $B?7Dj5A@a$N$&$A%b%8%e%i!<$G$J$$@a(B
\item [{\tt MODULAR}] $B?7Dj5A@a$N$&$A%b%8%e%i!<$J@a(B
\end{description}

$B%b%8%e%i!<$G$J$$@)Ls$r(BC$B!"(BC$B$K4^$^$l$kJQ?t$r(B
{\tt $X_{1},\cdots,X_{n}$}$B!"(B
{\tt p}$B$r(B{\tt n}$B0z?t$N?7=R8lL>$H$9$k!#@)LsJQ49%k!<%A%s$O(B
\begin{quote}
{\tt p($X_{1}$,$\cdots$,$X_{n}$)==C.}
\end{quote}
$B$r(B{\tt DEFINITION}$B$KIU2C$7!"0J2<$N;0$D$N4pK\A`:n$r7+$jJV$9$3$H$G!"(B
{\tt DEFINITION} $B$*$h$S(B {\tt NON-MODULAR} $B$r6u$K$9$k$3$H$,$G$-$?>l9g$K(B
$B@.8y$9$k!#(B
$B$3$N$H$-!"(B{\tt MODULAR}$B$NCf$N@a$,?7Dj5A@a$G!"(BC$B$O(B
{\tt p($X_{1},\cdots,X_{n}$)}
$B$K=q$-49$($i$l$?$3$H$K$J$k!#(B

$B$J$*8=<BAu$G$O!"@)LsJQ49$NA08e$G(Breduction$BA`:n(B($BDj5A@a$,0l$D$N=R8l$O6/@)(B
$BE*$KE83+$9$k(B)$B$r9T$C$F$$$k!#(B
\par
$B@)LsJQ49$O<!$N;0$D$N4pK\A`:n$+$i$J$k!#(B
\begin{enumerate}
\item {\em unfolding}\\
	{\tt NON-MODULAR}$B$^$?$O(B{\tt DEFINITION}$B$+$i0l@a(B $H:-L,R.$ 
$B$r<h$j=|$/!#(B$L$$B$O%j%F%i%k!"(B$R$$B$O;D$j$NK\BN$G$"$k!#(B
$L$$B$HC10l2=$9$kF,It$r;}$D%W%m%0%i%`$r(B
$P_{i}:-B_{i}$ 
($P_{i}\theta_{i}=L\theta_{i}$, $i=1,\ldots,n$)
$B$H$9$k$H!"(B
$H\theta:-B_{i}\theta,R\theta$ ($i=1,\ldots,n$) 
$B$r!"K\BN$,%b%8%e%i!<$N>l9g$O(B {\tt MODULAR} $B$K!"$=$&$G$J$$>l9g$O(B
{\tt NON-MODULAR}$B$KIU$12C$($k!#(B

\item {\em folding}\\
{\tt NON-MODULAR}$B$h$j!"<!$N>r7o$rK~$?$9(B $B0l@a(B $H:-B,D.$ 
$B$r<h$j=|$/!#(B
\begin{itemize}
\item $B$ $B$H(B $D$ $B$OJQ?t$N0MB84X78$r;}$?$J$$(B
\item {\tt DEFINITION} $B$K(B $B@a(B $P==Q$ $B$,$"$C$F!"(B$Q\theta=B$ $B$rK~$?$9(B
\end{itemize}
{\tt NON-MODULAR} $B$K(B $H:-P\theta,D.$$B$r2C$($k!#(B

\item {\em modularize}\\
	{\tt NON-MODULAR}$B$+$i0l$D$N@a(B$H:-B_{1},\cdots,B_{n},R$
$B$r<h$j=|$/!#$?$@$7!"(B
\begin{itemize}
\item $B_{i} (i=1,\cdots,n)$, $R$ $B$OAG<0Ns(B
\item $B_{i}$$B$H(B$B_{j}$ $(i \neq j)$ $B$OJQ?t$N0MB84X78$r;}$?$J$$(B
\item $R$ $B$O%b%8%e%i!<(B
\end{itemize}
$B$H$9$k!#(B
$B3F(B $B_{i}$ $B$OJQ?t(B$X_{i,1},\cdots,X_{i,m_{i}}$ $B$r4^$_!"(B
$p_{i}$$B$r(B$m_{i}$$B0z?t$N?7=R8l$H$7$F!"(B
{\tt $P_{i}=p_{i}(X_{i,1},\cdots,X_{i,m_{i}})$}$B$H$9$k(B($i=1,\cdots,n$) $B!#(B
$B$3$N$H$-!"(B
{\tt $P_{i}$ == $B_{i}$.}$B$r(B{\tt DEFINITION}$B$KDI2C$7(B($i=1,\cdots,n$)$B!"(B
{\tt MODULAR}$B$K(B$H:-P_{1},\cdots,P_{n},R$.$B$rDI2C$9$k!#(B
\end{enumerate}


\subsection{$B@)LsJQ49$N%R%e!<%j%9%F%#%C%/(B}
$B8=9T$N(Bcu-Prolog$B$G$O@)LsJQ49$r<!$N<j=g$G9T$C$F$$$k!#(B
\begin{enumerate}
\item {\tt DEFINITION}$B$K@a$,$"$k>l9g$K$O!"(B{\tt DEFINITION}$B$h$j0l$D$N@a(B
C$B$rA*$S(Bunfolding$B$9$k!#@a(BC$B$O(BDEFINITION$B$h$j<h$j=|$/!#(B

\item {\tt DEFINITION}$B$,6u$N>l9g$K$O!"(B{\tt NON-MODULAR}$B$h$j@a(BN$B$rA*$S!"(B
N$B$NF,It$K$*$$$FA4$F$N0z?t$,Aj0[$J$kJQ?t$N>l9g$K$O(B,unfolding$B$r9T$&!#(B

\item $B$=$&$G$J$$>l9g$O(B{\tt NON-MODULAR}$B$NG$0U$N@a(BN$B$NK\BN$r(Bfolding$B$^$?(B
$B$O(Bmodularize$B$9$k!#(B

\item $B0J>e$NA`:n$r!"(B{\tt DEFINITION}$B$*$h$S(B{\tt NON-MODULAR}$B$,6u$K$J$k(B
$B$^$G7+$jJV$9!#(B
\end{enumerate}
$B$7$?$,$C$F!"%R%e!<%j%9%F%#%C%/$H$7$F$O(B
\begin{itemize}
\item {\tt DEFINITION}$B$+$i$N@a$NA*$SJ}(B
\item {\tt NON-MODULAR}$B$+$i$N@a$NA*$SJ}(B
\item unfolding$B$K$*$$$FE83+$9$k%j%F%i%k$NA*$SJ}(B
\end{itemize}
$B$,9M$($i$l$k!#(B
\subsubsection{{\tt DEFINITION}$B$+$i$N@a$NA*Br(B}
{\tt DEFINITION}$B$O%9%?%C%/$G<BAu$7$F$*$j!"(B
$B$b$C$H$b:G?7$N$b$N$rA*Br$7$F$$$k!#(B
\subsubsection{{\tt NON-MODULAR}$B$+$i$N@a$NA*Br(B}
$B8=:_(B{\tt DEFINITION}$B$*$h$S(B
{\tt NON-MODULAR}$B$O%9%?%C%/$G<BAu$7$F$*$j!"(B
$B$b$C$H$b:G?7$N$b$N$rA*Br$7$F$$$k!#(B
\subsubsection{unfold$B$9$k%j%F%i%k$NA*Br(B}
unfolding$B$K$*$1$k%j%F%i%k$NA*Br$K4X$9$k%R%e!<%j%9%F%#%C%/$O!"(B
$B8=9T$G$O0J2<$NMWAG(B
$B$K$h$j3F%j%F%i%k$N3h@-78?t$r7W;;$7!"3h@-78?t$N:G$b9b$$$b$N$+$iE83+$7$F(B
$B$$$k!#(B
\begin{eqnarray*}
Arity & = & \mbox{$B=R8l$N0z?t$N8D?t(B}\\
Const & = & \mbox{$B0z?t$N$&$ADj?t$K6qBN2=$7$F$$$k$b$N$N8D?t(B}\\
Vnum  & = & \mbox{$B0z?t$K8=$l$k<+M3JQ?t$,@)LsA4BN$NCf$G2?2s=P8=$7$F$$$k(B
$B$+$N8D?t(B}\\
Funct & = & \mbox{$B0z?t$N$&$A(B($BJQ?t$r4^$`(B)$BJ#9g9`$K6qBN2=$7$F$$$k$b$N$N8D?t(B}\\
Rec   & = & \mbox{$B=R8l$,:F5"E*$J$i(B1$B!"$=$&$G$J$1$l$P(B0}\\
Defs  & = & \mbox{$B=R8l$NDj5A@a$N8D?t(B}\\
Units & = & \mbox{$B=R8l$NDj5A@a$N$&$AC10L@a(B($BK\BN$,6u(B)$B$N8D?t(B}\\
Facts & = & \mbox{$B=R8lDj5A$,$9$Y$FC10L@a$+$i$J$k>l9g$K(B1$B!"$=$&$G$J$1$l$P(B0}\\
\mbox{$B3h@-78?t(B} & = & 3*Const + 2*Funct + Vnum - Defs + Units - 2*Rec +
3*Facts
\end{eqnarray*}
$B3h@-78?t$O!"(Bcu-Prolog$B$N@)LsJQ49$K4X$7$F:#$^$G7P83E*$KF@$i$l$F$$$?%R%e!<(B
$B%j%9%F%#%C%/$r4^$`$h$&$K7hDj$7$?!#(B
$B$5$i$KMWAG$rA}$d$7$F<B83$r9T$&$3$H$G$h$jM-8z$J%R%e!<%j%9%F%#%C%/$bF@$i(B
$B$l$k$H;W$o$l$k!#(B


\subsection{$B<B9TNc(B}
$B$3$3$G$O!"(Bcu-Prolog$B$N@)LsJQ497O$N<B9TNc$r$$$/$D$+<($9!#$$$:$l$b!"A0=R(B
$B$N(B@$B%3%^%s%I$K$h$k<B9T$G$"$k!#(B

\subsubsection{$B5-9f!&AH9g$;@)Ls(B}
$B=R8l(B{\tt member/2}$B$*$h$S(B{\tt append/3}$B$O5-9fE*!&AH9g$;E*$J@)Ls$K$*$$$F(B
$BNI$/;H$o$l$k!#(B
$B$3$l$i$K$h$k@)Ls$GHs%b%8%e%i!<$J$b$N$r%b%8%e%i!<$KJQ49$9$kNc$G$"$k!#(B

\begin{verbatim}
tsuda@icot21[5] cup3              % cu-Prolog$B$N5/F0(B
	*****  cu - Prolog   Ver. III  *****
Copyright: Institute for New Generation Computer Technology,  Japan 1989-91
in Cooperation with SIRAI@sccs.chukyo-u.ac.jp
	All Modular mode	(help ->  %h)

_member(X,[X|Y]).                 % member/2$B$NDj5A(B
_member(X,[Y|Z]):-member(X,Z).
_append([],X,X).                  % append/3$B$NDj5A(B
_append([A|X],Y,[A|Z]):-append(X,Y,Z).

_@ member(X,[a,b,c]),member(X,[b,c,d]).    % $B%f!<%6@)LsF~NO(B1

solution = c0(X_0)                % $BEy2A$G%b%8%e%i!<$J@)Ls(B
c0(b).                            % $B@)LsJQ49Cf$K:n$i$l$??7=R8l$NDj5A(B
c0(c).
CPU time = 0.017 sec (Constraints Handling = 0.000 sec)

_@ member(X,[a,b,c]),member(X,[j,k,l]).    % $B%f!<%6@)LsF~NO(B2

solution = fail.                  % $B@)LsJQ49$K<:GT(B
CPU time = 0.017 sec (Constraints Handling = 0.000 sec)

_@ member(A,X),append(X,Y,Z).            % $B%f!<%6@)LsF~NO(B3

solution = c2(X_1, Y_2, Z_3, A_0)        % $BEy2A$G%b%8%e%i!<$J@)Ls$H$=$NDj5A(B
c4(V0_0, V1_1, V2_2, [V0_0 | V3_3]) :- append(V1_1, V2_2, V3_3).
c3(V0_0, V1_1, V2_2, [V0_0 | V3_3], V4_4) :- c2(V1_1, V2_2, V3_3, V4_4).
c2([V0_0 | V1_1], V2_2, V3_3, V0_0) :- c4(V0_0, V1_1, V2_2, V3_3).
c2([V0_0 | V1_1], V2_2, V3_3, V4_4) :- c3(V0_0, V1_1, V2_2, V3_3, V4_4).
CPU time = 0.050 sec (Constraints Handling = 0.000 sec)
\end{verbatim}

\subsubsection{$BA*8@E*AG@-9=B$$NC10l2=(B}
cu-PrologIII$B$O(BPST$B$rF3F~$9$k$3$H$G!"8@8l3X$NC10l2=J8K!$G=EMW$J%G!<%?9=(B
$BB$$G$"$k!"A*8@E*AG@-9=B$$KBP1~$9$k$3$H$,$G$-$?!#Nc$($P<!$N$h$&$JA*8@E*(B
$BAG@-9=B$(B\cite{eis:uni}:
\[
\bcat
	{\tt a} = \bdisj
	\bcat 	{\tt b}={\tt +}\\ {\tt c}={\tt -} \ecat\\
	\bcat 	{\tt b}={\tt -}\\ {\tt c}={\tt +} \ecat
	\edisj
\ecat
\; \mbox{$B$*$h$S(B} \;
\bcat
	{\tt a}= \bcat {\tt b}={\tt <d>} \ecat\\
	{\tt d}=\bcat \: \ecat
\ecat
\]
$B$O!"(BPST$B$H@)Ls$rMQ$$$F!"(B{\tt X=\{a/U\},s(U)} $B$*$h$S(B 
{\tt Y=\{a/\{b/V\},d/V\}}$B$HI=$9$3$H$,$G$-$k!#(B
$B$?$@$7(B{\tt s/1}$B$O<!$N$h$&$KDj5A$5$l$F$$$k!#(B
\begin{verbatim}
  s({b/+,c/-}).     % s/1 $B$NDj5A(B
  s({b/-,c/+}).
\end{verbatim}
{\tt X} $B$H(B {\tt Y}$B$NC10l2=$O(B
$B@)Ls(B {\tt X=Y=\{a/U,d/V\},U=\{b/V\},s(U)} $B$r%b%8%e%i!<$KJQ49$9$k$3$H$G(B
$B9T$J$o$l$k!#(B
$B0J2<$O(Bcu-PrologIII$B$K$h$k<B9TNc$G$"$k!#(B

\begin{verbatim}
_s({b/'+',c/'-'}).           % $BA*8@$NDj5A(B
_s({b/'-',c/'+'}).

_@ X={a/U},s(U),X={a/{b/V},d/V}.     % $BA*8@E*AG@-9=B$C10l2=(B

solution = c0(X_0, V_2, {a/{b/V_2}, d/V_2}, U_1, {a/U_1})   % $BJQ498e(B
c0(_p1, '+', _p1, {b/'+', c/'-'}, _p1);_p1={a/{b/'+', c/'-'}, d/'+'}. %$B?7=R8l(B 
c0(_p1, '-', _p1, {b/'-', c/'+'}, _p1);_p1={a/{b/'-', c/'+'}, d/'-'}.
CPU time = 0.000 sec (Constraints Handling = 0.000 sec)

_:-c0(X,_,_,_,_).              % $B?7@)Ls$r2r$/(B
  X = {a/{b/'+', c/'-'}, d/'+'};           % $B2r(B1
  X = {a/{b/'-', c/'+'}, d/'-'};           % $B2r(B2
no.
CPU time = 0.000 sec (Constraints Handling = 0.000 sec)
\end{verbatim}

$BA*8@E*AG@-9=B$C10l2=$N7k2L!"(B{\tt X}$B$K$O?7$?$K(B{\tt c0(X,\_,\_,\_,\_)} 
$B$J$k@)Ls$,$+$+$C$F$$$k!#(B
$B<B:]$K(B{\tt X}$B$,$I$N$h$&$JCM$r<h$jF@$k$+$rD4$Y$k$K$O!"(B
$B>e$N$h$&$K?7@)Ls$r2r$$$F$d$l$PNI$$!#(B
$B$3$NNc$G$O!"C10l2=8e$N(B{\tt X}$B$O(B2$B$D$N(BPST {\tt \{a/\{b/+,c/-\},d/+\}} 
$B$*$h$S(B 
{\tt \{a/\{b/-,c/+\},d/-\}} 
$B$NA*8@$K$FI=$5$l$k!#(B


\section{$B%H%l!<%95!G=(B}
cu-Prolog$B$K$O!"%G%P%C%0MQ$K%H%l!<%95!G=$,$"$k!#(B
$B:G=i$K=R8l$K%9%Q%$%U%i%0$r@_Dj$7$F$+$i!"<!$N$$$:$l$+$N%H%l!<%9%b!<(B
$B%I$rA*$V!#(B
\begin{description}
\item [{\dg $B%N!<%^%k%H%l!<%9(B}:] ($B%W%m%s%W%H$O(B\$$B$K$J$k(B)$BESCf$G%9%H%C%W$7$J$$(B
\item [{\dg $B%9%F%C%W%H%l!<%9(B}:] ($B%W%m%s%W%H$O(B\verb+>+$B$K$J$k(B)$B<B9T$r0l;~(B
$BDd;_$7!"F~NOBT$A$K$J$k!#(B
\end{description}

\subsection{$B%9%Q%$%U%i%0$N@_Dj(B}
\begin{tabular}{ll}
{\tt \%p *} & $BA4=R8l$K%9%Q%$%U%i%0$r@_Dj$9$k(B\\
{\tt \%p .} & $BA4=R8l$N%9%Q%$%U%i%0$r2r=|$9$k(B\\
{\tt \%p {\em predicate}} & 
	$B=R8l$N%9%Q%$%U%i%0$r%9%$%C%A$9$k(B\\
{\tt \%p > } & $B@)LsJQ49$N%9%Q%$%U%i%0$r%9%$%C%A$9$k(B\\
{\tt \%p ?} & $B%9%Q%$$5$l$F$$$k=R8lL>$rI=<($9$k(B
\end{tabular}

\subsection{$B%H%l!<%9%b!<%I(B}
$B%H%l!<%9%b!<%I$KF~$k%9%$%C%A$O0J2<$,MQ0U$5$l$F$$$k!#%H%l!<%9%b!<(B
$B%I$+$i0J2<$N%3%^%s%I$r:F$S9T$&$H%N!<%H%l!<%9%b!<%I$KLa$k$3$H$,$G$-$k!#(B

\begin{tabular}{ll}
{\tt \%s} & $B%9%F%C%W%H%l!<%9$N%9%$%C%A!#(B
$B%W%m%s%W%H$O(B`\verb+>+'$B$K$J$k(B\\
{\tt \%t} & $B%N!<%^%k%H%l!<%9$N%9%$%C%A!#(B
$B%W%m%s%W%H$O(B`\verb+$+'$B$K$J$k(B
\end{tabular}

$B%9%F%C%W%H%l!<%9%b!<%I$G$O!"%4!<%k$rI=<($7$F$+$i%f!<%6$NF~NOBT$A$K$J$k!#(B
$B0J2<$K$h$j%3%^%s%I$r;XDj$9$k!#(B
\begin{tabbing}
operation\=function \kill
$BF~NO(B \> $BF0:n(B\\
$B%j%?!<%s(B \> $B<B9T$r7QB3$9$k(B\\
{\tt s} \> $B:G:8%4!<%k$,=*N;$9$k$^$G%H%l!<%9$r>JN,$9$k(B\\
{\tt a}	\> $B?F%4!<%k$rI=<($9$k(B\\
{\tt b} \> $B%V%l!<%/!#0l;~E*$K%H%C%W%l%Y%k$K0\$k!#(B
{\tt :-unbreak}$B$K$h$j$3$N;~E@$KLa$k$3$H$,$G$-$k!#(B\\
{\tt f} \> $B8=:_$N%4!<%k$r(Bfail$B$5$;$k!#(B\\
{\tt l} \> $B%j!<%W!#$3$N%4!<%k$N=*N;$^$GHt$V!#(B\\
{\tt z} \> $B<B9T$rCf;_$9$k(B
\end{tabbing}

\subsection{$B@)LsJQ49$N%H%l!<%9(B}
$B@)LsJQ49$N%H%l!<%9$O!"$^$:(B\verb+%p >+$B$K$h$C$F@)LsJQ49$K%9%Q%$$r$+$1$?8e$K!"(B
\verb+%t+$B$^$?$O(B\verb+%s+$B$K$h$j!"%N!<%^%k%H%l!<%9$+%9%F%C%W%H%l!<%9$+$r;X(B
$BDj$9$k!#(B
\subsubsection{$B%H%l!<%9$NI=<((B}
{\tt DEFINITION}$B$K4^$^$l$k@a(B($B?7=R8l$NF3F~@a(B)$B$O!"0J2<$N=q<0$GI=<($5$l$k!#(B
\begin{quote}
[$B@aHV9f(B($B@a>uBV(B,$B=R8lDj5A?t(B)] $BF3F~@a(B\\
{\tt [1(d,0)] c0(X) <=> member(X,[a,b,c]). ($BNc(B)}
\end{quote}
$B$3$3$G!"@a>uBV$O0J2<$N5-9f$GI=$9!#(B
\begin{tabbing}
char\=function \kill
{\tt r} \> removed: unfolding$B$K$h$j>C5n$5$l(B($B0J2<$N(B{\tt f,g}$B$G$J$$(B)$B@a(B\\
{\tt d} \> derivation: $BF3F~@a$G(Bunfolding$B$5$l$F$$$J$$$b$N(B\\
{\tt g} \> registered: $B?7=R8l$NDj5A$K0l$D0J>e$NC10L@a$,F@$i$l$?$b$N(B\\
{\tt f} \> false\_registerd: $B?7=R8l$NDj5A$,6u$H$J$C$?$b$N(B\\
\end{tabbing}
\par
{\tt NON-MODULAR}$B$*$h$S(B{\tt MODULAR}$B$K4^$^$l$k@a(B($B?7$7$/Dj5A$5$l$?@a(B)$B$O!"(B
$B0J2<$N=q<0$GI=<($5$l$k!#(B
\begin{quote}
\verb+<+$B@aHV9f(B{\tt (}$B@a>uBV(B,$B=R8lDj5A?t(B{\tt )}\verb+>+ $B?7Dj5A@a(B\\
{\tt <2(u)> c0(X):-member(X,[b,c]).} ($BNc(B)
\end{quote}
$B$3$3$G!"@a>uBV$O0J2<$N5-9f$GI=$9!#(B
\begin{tabbing}
char\=function \kill
{\tt r} \> removed: $B4JLs2=A`:n!"(Bunfolding$B$K$h$j>C5n$5$l$?@a(B \\
{\tt u} \> untouched: {\tt NON-MODULAR}$B$N@a(B\\
{\tt m} \> modular: $BK\BN$KJQ?t$N6&M-4X78$,$J$$@a(B\\
{\tt i} \> unit: $BC10L@a(B\\
\end{tabbing}

\subsubsection{$B%9%F%C%W%H%l!<%9$N%f!<%6F~NO(B}
$B%9%F%C%W%H%l!<%9$G$O!"%H%l!<%9I=<($K<!$$$G%f!<%6$NF~NOBT$A$K$J$k!#0J2<(B
$B$K$h$j%3%s%H%m!<%k$r;XDj$9$k!#(B
\begin{tabbing}
operationoperation\=function \kill
$BF~NO(B \> $BF0:n(B\\
$B%j%?!<%s(B \> $B7QB3(B: $B%G%U%)%k%H$N%R%e!<%j%9%F%#%C%/%9$G@a$H%j%F%i%k$rA*Br(B
$B$77QB3$9$k(B\\
{\tt u CN LN} \>$B%^%K%e%"%k(Bunfolding:{\tt CN}$B$G@aHV9f!"(B{\tt LN}$B$GK\BN(B
$B$N2?HVL\$rE83+$9$k$+$r;XDj$9$k!#(B\\
{\tt s} \> $B%H%l!<%9$NCf;_(B: $B0J8e$NJQ492aDx$OI=<($5$l$J$$!#(B\\
{\tt n} \> $B%9%F%C%W%H%l!<%9$NCf;_(B: $B0J8e%N!<%^%k%H%l!<%9$H$J$k!#(B\\
{\tt q} \> $B@)LsJQ49$NCfCG(B: $B$=$N;~E@$G?7Dj5A@a$N$&$A>C5n$5$l$F$$$J$$$b(B
$B$N$r%"%5!<%H$7$F@)LsJQ49$r=*N;$9$k!#(B\\
{\tt z} \> $B@)LsJQ49$NCf;_(B: $B?7Dj5A@a$r>C5n8e!"@)LsJQ49$r=*N;$9$k!#(B\\
\end{tabbing}


\section{JPSG$B%Q!<%6(B}
JPSG(Japanese Phrase Structure Grammar)$BEy$NC10l2=J8K!$N%Q!<%6$r!"(B
cu-Prolog$B$N(BCHC$B$G5-=R$9$k$3$H$r9M$($h$&!#(B
JPSG$B$K$*$1$k@)Ls$O!"6I=jE*$J;^J,$+$l$K$*$1$k(B
$BJ8K!HOaF(B($B?F!":81&L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B<!$K5s$2$k$N$O!"=uF0;l!V$l$k!W$N<-=q$N0lIt$G$"$k!#(B
$B!V$l$k!W$O8^CJ(B,$B%5JQF0;l$NL$A37A$K@\B3$7!"F0;l$N(B{\tt subcat}$B$NCM$,(B
$BFs$D(B($B<g3J!"L\E*3J(B)$B$J$i$PDL>o$N<u?H$K$J$j!"0l$D(B($B<g3J(B)$B$J$i$PHo32$N<u(B
$B?H$K$J$k!#(B

\begin{verbatim}
%% $B!V$l$k!W$N<-=q(B ($BK\BN$,6u$N(BCHC)
lex(reru,{sc/SC, sem/Sem, adjacent/{pos/v,infl/I,sc/VSC,sem/Sem}});
     reru_form(I),      % $B3hMQ8l(B($B@)Ls!K(B
     reru_sem(VSC,Vsem,SC,Sem).  % subcat$B$H(Bsem$B$NAH9g$;(B($B@)Ls!K(B

%%%%%% $B@)Ls$r9=@.$9$k=R8l$NDj5A(B %%%%%%
reru_form(vs).  % $BD>A0$NF0;l$N3hMQ7?(B (5$BCJ(B)
refu_form(vs1). %                    ($B%5JQ(B)

reru_sem([{form/ga,sem/Sbj}],Sem,       % $BHo32$N<u?H$KBP1~(B
         [{form/ga,sem/A},{form/ni,sem/Sbj}], 
         affected(A,Sem)). 
reru_sem([{form/ga,sem/Sbj},{form/wo,sem/Obj}], Sem,  % $BDL>o$N<u?H$KBP1~(B
         [{form/ga,sem/Obj},{form/ni,sem/Sbj}], Sem). 
\end{verbatim}

\[
\bcat
	\bdisj
	\bcat
		adjc = \bcat
			sc = \bscat 
					\bcat pos=ga\\sem=S1 \ecat
				     \escat\\
				sem = Sem1\\
			  \ecat\\
		sc = \bscat \bcat form=ga\\sem=A \ecat, 
			\bcat form=ni\\sem=S1 \ecat \escat\\
		sem = affected(A,Sem1)\\
	\ecat\\
	\bcat
		adjc = \bcat
				sc = \bscat 
					\bcat pos=ga\\sem=S2\ecat,
					\bcat pos=wo\\sem=O2\ecat 
					\escat\\
				sem = Sem2\\
			   \ecat\\
		sc = \bscat 
			\bcat pos=ga\\s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@-$NCM$O(B
$B!";R$NB+G{AG@-$NCM$NOB$HC10l2=$9$k!#(B
\end{quote}
CHC$B$rMQ$$$k$H!"$3$N86M}$O<!$N$h$&$K6g9=B$5,B'$KKd$a9~$`$3$H$,$G$-$k!#(B
\[{\tt psr([foot(MS)],[foot(LDS)],[foot(RDS)]); union(LDS,RDS,MS).}\]
$B$7$+$7!"(BProlog$B$G$3$N<o$N@)Ls$r5-=R$7$?>l9g$K!"<B9T$O<jB3$-E*(B
(psr$B$+(Bunion$B$N$I$A$i$+$,@h$K<B9T$5$l$k(B)$B$K$J$C$F$7$^$$!"JQ?t$N6qBN2=$N>u(B
$B67$K$h$C$F$O8zN($,0-$/$J$k!#(B

\subsection{JPSG$B$NAG@-(B}
JPSG$B%Q!<%6$G$O0J2<$NAG@-$r<h$j07$C$F$$$k!#(B
\begin{tabbing}
fffffamejjjjj\=feature typejjj\=feature valuefeature value \=	\kill
($BAG@-L>(B) \> ($BAG@-7?(B) \> ($B<h$jF@$kCM(B) 	\>($BMQES(B)\\
pos	\> $B<g<-AG@-(B \> {\tt n,v,p} \> $BIJ;l(B\\
infl	\> $B<g<-AG@-(B \> {\tt vc,vv,$\cdots$} \> $BIJ;l$N3hMQ$N<oN`(B\\
form	\> $B<g<-AG@-(B \> {\tt root, sbj,obj, $\cdots$} \> $BIJ;l$N3hMQ7A(B\\
gr	\> $B<g<-AG@-(B \> {\tt ga,wo,$\cdots$} \> $BL>;l$NJ8K!4X78(B\\
mod	\> $B<g<-AG@-(B \> {\tt +,-}	\> $B=$>~2DG=@-(B\\
dep	\> $B<g<-AG@-(B \> $B%+%F%4%j$N<g<-AG@-(B	\> $B=$>~$9$k%+%F%4%j(B\\
view	\> $B<g<-AG@-(B \>	{\tt asp(B,E,D)} \>$B;kLn!&%"%9%Z%/%H!&;2>H;~4V(B\\
adjacent \> Subcat$BAG@-(B \> $B%+%F%4%j(B	\>$BD>A0$KMh$k%+%F%4%j(B\\
sc	\> Subcat$BAG@-(B	\> $B%+%F%4%j(B	\> $BJd8l(B\\
slash	\> $BB+G{AG@-(B \> $B%+%F%4%j$N<g<-AG@-(B	\> $BJ8$N%.%c%C%W$KAjEv(B\\
pslash	\> $BB+G{AG@-(B \> $B%+%F%4%j$N<g<-AG@-(B	\> resumptive pronoun$B$K$F@8$8$k(B\\
refl 	\> $BB+G{AG@-(B \> $B%+%F%4%j$N<g<-AG@-(B	\> $B!V<+J,!W$K$F@8$8$k(B\\
sem	\>		\> 		\> $B0UL#(B
\end{tabbing}

\subsection{$B<B9TNc(B}
$B0J2<$O!"(Bcu-Prolog$B$K$h$k(BJPSG$B%Q!<%6$N<B9TNc$G$"$k!#!V7r$,F`=oH~(B
$B$r0&$9$k!W$K$O[#Kf@-$,$J$$$N$GBP1~$9$kJ8K!HOaF$KIU?o$9$k@)Ls$O6u$G$"$k!#(B
$B!V7r$,0&$9$k!W$O!V7r$,(B(t$B$r(B)$B0&$9$k!W$H$$$&%.%c%C%W$N$"$kJ8!"$^$?$O!V7r(B
$B$,0&$9$k(B(t)$B!W$H$$$&4X78@a!"$NFsDL$j$NFI$_$,$"$k!#$3$l$i$N[#Kf@-$O%H%C(B
$B%W%l%Y%k$KIU?o$9$k@)Ls$NJ#?t$N2r$H$7$FI=$5$l$F$$$k!#(B

\programskip
{\footnotesize
\begin{verbatim}
tsuda#icot21[5]% cup3		% cu-Prolog$B$NN)$A>e$2(B


	*****  cu - Prolog III  *****
Copyright: Institute for New Generation Computer Technology,  Japan 1989-91
in Cooperation with SIRAI@sccs.chukyo-u.ac.jp
	M-solvable mode	(help ->  %h)

_"jpsg/j4.p"			% JPSG$B%Q!<%6%U%!%$%k$rFI$_9~$`(B
=== open 'jpsg/j4.p'

 ****** end of file ******* 
CPU time = 2.050 sec
_:-p([ken,ga,naomi,wo,ai,suru]). %$B!V7r$,F`=oH~$r0&$9$k!W$N2r@O(B
				%$B9=J8LZ$,JV$k(B
				%% The parser returns the parse tree.
{sem/[love,ken,naomi], core/{form/Form_3670, pos/v}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[suff_p]
 | 
 |--{sem/[love,ken,naomi], core/{form/vs2, pos/v}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[subcat_p]
 |   | 
 |   |--{sem/ken, core/{form/ga, pos/p}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[adjacent_p]
 |   |   | 
 |   |   |--{sem/ken, core/{form/n, pos/n}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[ken]
 |   |   | 
 |   |   |__{sem/ken, core/{form/ga, pos/p}, sc/[], refl/[], slash/[],
    psl/[], ajn/[], ajc/[{sem/ken, core/{pos/n}, sc/[], refl/ReflAC_140}]}---[ga]
 |   | 
 |   |__{sem/[love,ken,naomi], core/{form/vs2, pos/v}, sc/[{sem/ken,core/{form/ga, pos/p}}], 
         refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[subcat_p]
 |       | 
 |       |--{sem/naomi, core/{form/wo, pos/p}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[adjacent_p]
 |       |   | 
 |       |   |--{sem/naomi, core/{form/n, pos/n}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[naomi]
 |       |   | 
 |       |   |__{sem/naomi, core/{form/wo, pos/p}, sc/[], refl/[], slash/[], 
   psl/[], ajn/[], ajc/[{sem/naomi, core/{pos/n}, sc/[], refl/ReflAC_960}]}---[wo]
 |       | 
 |       |__{sem/[love,ken,naomi], core/{form/vs2, pos/v}}---[ai]
 | 
 |__{sem/[love,ken,naomi], core/{form/Form_3670, pos/v}, sc/[],
    refl/[], slash/[], psl/[], ajn/[], ajc/[{sem/[love,ken,naomi],
    core/{form/vs2, pos/v}, sc/[], refl/ReflAC_3702}]}---[suru]

category= {sem/[love,ken,naomi], core/{form/Form_3670, pos/v},
sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]} 
				%$B%H%C%W%l%Y%k$N%+%F%4%j(B
constraint= syu_ren(Form_3670)	%$B$=$l$KIU?o$9$k@)Ls(B ($B=*;_7A$^$?$OO"BN(B
			      	%$B7A$KBP1~$9$k(B)
true.
CPU time = 0.750 sec
19%(program) 6%(pst/const) 12%(string)


_:-p([ken,ga,ai,suru]).		%$B!V7r$,0&$9$k!W$N9=J82r@O(B

{sem/[love,Sbj_394,Obj_396], core/{form/Form_1056, pos/v},sc/Msc_1128,
     refl/Mref_1130, slash/Msl_1132, psl/[], ajn/[], ajc/[]}---[suff_p]
 | 
 |--{sem/[love,Sbj_394,Obj_396], core/{form/vs2, pos/v}, sc/Csc_1102,
     refl/Cref_1104, slash/Csl_1106, psl/[], ajn/[], ajc/[]}---[subcat_p]
 |   | 
 |   |--{sem/ken, core/{form/ga, pos/p}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[adjacent_p]
 |   |   | 
 |   |   |--{sem/ken, core/{form/n, pos/n}, sc/[], refl/[], slash/[], psl/[], ajn/[], ajc/[]}---[ken]
 |   |   | 
 |   |   |__{sem/ken, core/{form/ga, pos/p}, sc/[], refl/[], slash/[],
     psl/[], ajn/[], ajc/[{sem/ken, core/{pos/n}, sc/[], refl/ReflAC_140}]}---[ga]
 |   | 
 |   |__{sem/[love,Sbj_394,Obj_396], core/{form/vs2, pos/v}}---[ai]
 | 
 |__{sem/[love,Sbj_394,Obj_396], core/{form/Form_1056, pos/v}, sc/[],
     refl/[], slash/[], psl/[], ajn/[], ajc/[{sem/[love,Sbj_394,Obj_396],
     core/{form/vs2, pos/v}, sc/[], refl/ReflAC_1116}]}---[suru]

category= {sem/[love,Sbj_394,Obj_396], core/{form/Form_1056, pos/v},
          sc/Msc_1128, refl/Mref_1130, slash/Msl_1132, psl/[], ajn/[], ajc/[]}
constraint= c31(Cref_1104, Mref_1130, Csl_1106, Msl_1132, Csc_1102,
         Msc_1128, Obj_396, Sbj_394, HC_222, Hsl_226),syu_ren(Form_1056)
true.
CPU time = 0.367 sec
20%(program) 2%(pst/const) 13%(string)
				%$B%H%C%W%l%Y%k$N@)Ls$r2r$/(B
_:-c31(_,Refl,_,Slash,_,SC,Obj,Sbj,_,_).
  Refl = []  Slash = []  SC = [{sem/V0_36, core/{form/wo, pos /p}}]  
Obj = V0_36  Sbj = ken; % $B2r(B1:subcat$B$,;D$C$F$$$k(B
  Refl = []  Slash = [{sem/V3_58}]  SC = []  Obj = V3_58  Sbj = ken;
				% $B2r(B2:subcat$B$+$i(Bslash$B$KMWAG$,0\$C$F$$$k(B
no.
CPU time = 0.050 sec
20%(program) 0%(pst/const) 13%(string)
_\end{verbatim}
}

\normalskip

\section{$B$*$o$j$K(B}
UNIX$BHG(Bcu-Prolog$B$N<BAu$O(B1989$BG/$+$i(BICOT$B$N%5%]!<%H$K$h$jDEED(B $B9(!&66ED(B $B9@(B
$B0l$K$h$j9T$J$o$l$^$7$?!#(BUNIX$BHG$NCx:n8"$O(BICOT$B$K$"$j$^$9!#(BMacintosh$BHG(B
(MacCUP)$B$*$h$S(BMS-DOS$BHG(Bcu-Prolog$B$O!"(BUNIX$BHG$N;EMM$r85$KCf5~Bg3X$NGr0f1Q(B
$B=S=u65<x$K$h$j3+H/$5$l$^$7$?!#(BJPSG$B%Q!<%6$K$D$$$F$O!"Bg:eBg3X$N74;JN4CK(B
$B<g::$r$O$8$a$H$9$k(BICOT PSG$B%o!<%-%s%0%0%k!<%W0Q0w=t;a$N%3%a%s%H!&6(NO$r(B
$B$$$?$@$-$^$7$?$3$3$K46<UCW$7$^$9!#(B

cu-Prolog$B$*$h$S(BJPSG$B%Q!<%6$K$D$$$F$N;29MJ88%$r0J2<$K>R2p$7$^$9!#(B

cu-Prolog$B$N85$H$J$C$?>r7oIUC10l2=$K$D$$$F$O(B\cite{cs:cu,has:cu}$B!#(B
$B=i4|$NO@J8$H(B
$B$7$F$O(B\cite{tuda:lpc,tuda:sof89}$B$,@)LsO@M}7?8@8l$N4QE@$+$i!"(B
\cite{tuda:acl,tuda:sico}$B$,(BJPSG$B%Q!<%6$N4QE@$+$i$NO@J8$G$9!#(B

$B66ED9@0l;a$O$5$i$K@)LsJQ49$r0lHLE*$J7W;;86M}$H$9$k(BDP(Dependency
Propagation)$BM}O@(B\cite{has:com}$B$rDs0F$7$F$$$^$9$,!"$=$l$H(Bcu$B$H$r$+$i$a$?(B
$BO@J8$K$O(B\cite{tuda:sico,has:iwpt}$B$,$"$j$^$9!#(B
cu-Prolog$B$K(BPST$B$r%G!<%?9=B$$H$7$FF3F~$9$k$3$H$G!"A*8@E*AG@-9=B$$r07$C$?(B
$B$b$N$K$O(B\cite{tuda:sof91,tuda:fgcs}$B$,$"$j$^$9!#(B

JPSG$B$K$D$$$F$O(B\cite{gun:jpsg}$B!"C10l2=J8K!A4HL$K$D$$$F$O(B\cite{shi:ub}$B$r(B
$B;29M$K$7$^$7$?!#(B

\bibliographystyle{jplain}	% {plain, unsrt, alpha, abbrv}
\bibliography{/home/tsuda/bib/lang,/home/tsuda/bib/logic,/home/tsuda/bib/jlang,/home/tsuda/bib/jlogic}

\end{document}
