<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\section{Introduction}

Prolog, like most logic programming languages, offers backward
chaining as the only reasoning scheme.  It is well known that sound
and complete reasoning systems can be built using either exclusive
backward chaining or exclusive forward chaining \cite{Nilsson80}.
Thus, this is not a theoretical problem.  It is also well understood
how to ``implement'' forward reasoning using an exclusively backward
chaining system and vice versa.  Thus, this need not be a practical
problem.  In fact, many of the logic-based languages developed for AI
applications \cite{DUCK,MRS,Petrie88,Fritzson88a} allow one to build
systems with both forward and backward chaining rules.

There are, however, some interesting and important issues which need
to be addresses in order to provide the Prolog programmer with a
practical, efficient, and well integrated facility for forward
chaining.  This paper describes such a facility, \pfc\ , which we have
implemented in standard Prolog.

The \pfc\ system is a package that provides a forward reasoning
capability to be used together with conventional Prolog programs.  The
\pfc\ inference rules are Prolog terms which are asserted as facts
into the regular Prolog database.  For example, Figure
\ref{fig:pfcrules} shows a file of \pfc\ rules and facts which are
appropriate for the ubiquitous kinship domain.

\begin{figure}[bhp]
\figline
\small
\begin{verbatim}
spouse(X,Y) &lt;=&gt; spouse(Y,X).
spouse(X,Y),gender(X,G1),{otherGender(G1,G2)}
     =&gt;gender(Y,G2).
gender(P,male) &lt;=&gt; male(P).
gender(P,female) &lt;=&gt; female(P).
parent(X,Y),female(X) &lt;=&gt; mother(X,Y).
parent(X,Y),parent(Y,Z) =&gt; grandparent(X,Z).
grandparent(X,Y),male(X) &lt;=&gt; grandfather(X,Y).
grandparent(X,Y),female(X) &lt;=&gt; grandmother(X,Y).
mother(Ma,Kid),parent(Kid,GrandKid)
      =&gt;grandmother(Ma,GrandKid).
grandparent(X,Y),female(X) &lt;=&gt; grandmother(X,Y).
parent(X,Y),male(X) &lt;=&gt; father(X,Y).
mother(Ma,X),mother(Ma,Y),{X\==Y}
     =&gt;sibling(X,Y).
\end{verbatim}
\caption[Pfc Rules]{{\bf Examples of \pfc\ rules which represent common kinship relations}}
\label{fig:pfcrules}
\figline
\end{figure}



The rest of this manual is structured as follows.  The next section
provides an informal introduction to the \pfc\ language.  Section
three describes the predicates through which the user calls \pfc\.
The final section gives several longer examples of the use of \pfc\

\subsection*{Getting and installing \pfc\ }

Look for \pfc\ on ftp.cs.umbc.edu in /pub/pfc/.

</pre></body></html>