

  This theorem prover consists of the following Prolog files:

  basic.pl unify.pl flagops.pl top.pl ip1.pl ip2.pl prop.pl pdtrans.pl

It runs in SICStus and Quintus, and most likely in lots of other Prologs
without changes except for the predicate time/1 in top.pl. The code has
been written to take advantage of the SICStus compiler. With basic.pl
loaded, the rest of the files can be loaded in any order. For reference
purposes, this version is sicstusft1.0.

  You are free to use or modify this code in any way you wish, as long as
any further distribution of the code contains i) a statement that it
originates at SICS, and ii) an indication of which modifications have been
made.

  The algorithm implemented is a stripped-down version of the
algorithm described in "An Intuitionistic Predicate Logic Theorem
Prover" by Sahlin, Franzen, and Haridi (available as a SICS research
report). There is no treatment of identity logic in this version,
which makes it very much simpler than the algorithm described in that
report. Also, there is no implementation of sifting or use checking -
the lack of sifting makes it much less efficient than it should be for
a large class of inputs.  A version in C incorporating sifting and
propositional use checking and some other optimizations is available
from SICS by anonymous ftp. A Prolog version incorporating identity is
also available, or will be available shortly.

  When the above files have been loaded (preferably compiled), the following
main predicates are available:

  ft(F)      Prove the formula F at contraction depth 1 1.

  f(F)       Prove the formula F with initial contraction depth 1 1,
             iteratively increasing the contraction depth by 1 on
             failure. (Thus f(F) never fails.)

  pd(F)      Apply the propositional decision procedure to the propositional
             formula F.

  pdtrans(N,F)  Translate the predicate logic formula F into a propositional
                formula over a domain with N elements, and apply the
                propositional decision procedure.


  A predicate logic formula is written using connectives and, or,
imp, iff, neg and quantifiers a(x,..  and e(x,..  Connectives iff and imp have
priority over the other connectives; or and and have priority over
neg. Atomic formulas are ordinary Prolog ground terms. Universal formulas
may optionally be annotated with a contraction parameter: a(N,x,..), and
similarly for imp and iff: imp(N,P,Q), iff(N,P,Q).

  Contraction depth n1 n2 means that the default contraction depth for
implications and equivalences is n1 and for universal formulas n2.

  The propositional decision procedure is much faster than the general
predicate logic procedure (in its domain of application).

  Another limitation of the present version is that it may or may not
be possible to include Prolog variables as free variables in formulas.
Proving a formula with such free variables means finding substitutions
of predicate logic terms for those free variables such that the result
is a valid formula. In the present version, inputting formulas with free
variables may as likely as not yield garbage. Nor does it attempt any
top-level sifting of answers, or present answers in any readable way.
Still, it sometimes works, e.g. in


| ?- f(a(x,p(x) imp p(f(x))) and p(a) imp p(f(X))).
 1 20
X = v(_389,a) ? ;
9
X = v(_391,a) ? ;
 2 19
X = v(_395,a) ? ;
10
X = v(_397,a) ? ;
9
X = v(_403,a) ? ;
20
X = v(_456,f(v(1,a))) ? ;
19
X = v(_458,f(v(1,a))) ? 

yes


Here the dereferencing of the v-structures is left to the user. Thus
the last answer means X=f(a). A proper presentation of answers and
handling of free variables in problems is contained in Dan Sahlin's
Prolog version, which also includes identity, and in the C version (in
the latter with top-level sifting).

