+ =====================================================================	+
|									|
| LIBRARY	: taut							|
|									|
| DESCRIPTION   : A tautology checker.					|
|									|
| AUTHOR	: R.J.Boulton						|
| DATE		: 9th July 1991						|
|									|
+ =====================================================================	+


+ --------------------------------------------------------------------- +
|									|
| FILES:								|
|									|
+ --------------------------------------------------------------------- +

    taut_check.ml            contains the tautology checker functions

+ --------------------------------------------------------------------- +
|									|
| TO REBUILD THE LIBRARY:						|
|									|
+ --------------------------------------------------------------------- +

   1) edit the pathnames in the Makefile (if necessary)

   2) type "make clean"

   3) type "make all"


+ --------------------------------------------------------------------- +
|									|
| DOCUMENTATION:							|
|									|
+ --------------------------------------------------------------------- +

Tautology checking by Boolean case analysis.

Method suggested by Tom Melham.

Simplification done after each variable instantiation.

Optimised for terms with more than two variables by eliminating some
duplicated sub-calls.

Optimised for cases when the body simplifies to true or false before all the
variables have been analysed.

Simplification optimised to avoid rebuilding subterms that are not changed.

Experiments have been performed with special code for cases when the first
argument of AND, OR, IMP and COND simplifies to a value that makes
simplification of certain other arguments unnecessary. The results suggested
that in general slightly fewer intermediate theorems are generated, but that
due to the overhead of testing, the execution times are slightly longer.


PTAUT_CONV : conv

   Given a propositional term with all variables universally quantified,
   e.g. "!x1 ... xn. f[x1,...,xn]", this conversion proves the term to be
   either true or false, i.e. it returns one of:

      |- (!x1 ... xn. f[x1,...,xn]) = T
      |- (!x1 ... xn. f[x1,...,xn]) = F

   This conversion also accepts propositional terms that are not fully
   universally quantified. However, for such a term, the conversion will fail
   if it is not true. Consider the term "!x2 ... xn. f[x1,...,xn]". The
   conversion first proves one of:

      |- (!x1 ... xn. f[x1,...,xn]) = T
      |- (!x1 ... xn. f[x1,...,xn]) = F

   The former can be manipulated as follows:

      |- (!x1 ... xn. f[x1,...,xn]) = T
      |- !x1 ... xn. f[x1,...,xn]
      |- !x2 ... xn. f[x1,...,xn]
      |- (!x2 ... xn. f[x1,...,xn]) = T

   However when the fully quantified term is false, we have:

      |- (!x1 ... xn. f[x1,...,xn]) = F
      |- ~(!x1 ... xn. f[x1,...,xn])
      |- ?x1. ~(!x2 ... xn. f[x1,...,xn])
      |- ?x1. ((!x2 ... xn. f[x1,...,xn]) = F)

   whereas we want:

      |- !x1. ((!x2 ... xn. f[x1,...,xn]) = F)

   i.e.

      |- (!x2 ... xn. f[x1,...,xn]) = F

   The conversions given here are not capable of proving the latter theorem
   since it is not purely propositional.


PTAUT_TAC : tactic

   Tactic for solving propositional terms. If the current goal is a tautology
   then PTAUT_TAC will prove it.


PTAUT_PROVE : conv

   Given a propositional term "t", this conversion returns the theorem |- t
   if "t" is a tautology. Otherwise it fails.


TAUT_CONV : conv

   Given a term, "t", that is a valid propositional formula or valid instance
   of a propositional formula, this conversion returns the theorem |- t = T.
   The variables in "t" do not have to be universally quantified.

   Example:

      TAUT_CONV "!x n y z. x \/ ~(n < 0) \/ y \/ z \/ (n < 0)"  --->
      |- (!x n y z. x \/ ~n < 0 \/ y \/ z \/ n < 0) = T


TAUT_TAC : tactic

   Tactic for solving propositional formulae and instances of propositional
   formulae.


TAUT_PROVE : conv

   Given a valid propositional formula, or a valid instance of a
   propositional formula, "t", this conversion returns the theorem |- t.
