_______________________________________________________________________________
ADMINISTRIVIA

Welcome to the Don Theorem Prover (DTP), version 2.00

The Common Lisp (CLtL2) source code is available by anonymous FTP from
	meta.stanford.edu:/pub/dtp/
The code has been tested under the following implementations of Common Lisp:
	Franz Allegro CL 4.2.beta.0 (on a Sun Sparc)
	Lucid HP Common Lisp Rev. A.04.01 (on an HP-9000 Series 300/400)
	MCL 2.0p2 (on an Apple Macintosh)

Please send comments to Don Geddis at
	Geddis@CS.Stanford.EDU
or
	Computer Science Department
	Stanford University
	Stanford, California 94305
_______________________________________________________________________________
USER OVERVIEW

Is DTP for you?  The intended audience is those who need a reliable black box
inference engine.  DTP knows more about inference than most other theorem
provers.  An ideal application, for example, would be as the back end to a
machine learning program or mobile robot.  Such systems have a hard enough time
just discovering true things about their worlds, much less figuring out how to
arrange that knowledge in a computationally tractable way.  The philosophy in
DTP is that the user need only be concerned about writing down true axioms, and
all search control knowledge will be embedded in the inference engine.

This style is not appropriate if the knowledge base constructor is also an
expert in inference.  For example, if the real intention in using the logic is
to write a program, then perhaps Prolog would be more appropriate.  Similarly
so if the user is willing to manipulate all their knowledge so that it may be
expressed in a restricted form, e.g. as horn clauses.  In that case, a much
more efficient algorithm can be used which takes advantage of this metalevel
constraint.  Some examples of such systems are the aforementioned Prolog, as
well as OTTER (Argonne National Laboratory), the Boyer-Moore Theorem Prover,
and the suite of algorithms in Epikit (Epistemics).
_______________________________________________________________________________
TECHNICAL OVERVIEW

DTP uses subgoaling inference with model elimination for completeness.  The
subgoaling inference is general resolution between a given subgoal literal and
a clause in the database.  This is equivalent (in a pure resolution framework)
to ordered resolution but with all contrapositives of each database sentence
also stored.  Model elimination is resolution between a subgoal and an ancestor
of that subgoal, and it serves the function of factoring in pure resolution
systems.  The inference is sound and complete.

In addition, recursion control via caching and slaving (sometimes called
"memoing") is implemented, so many axiom sets that appear to have infinite
paths (e.g. a transitive closure rule) still result in a finite search space.
A description of the technique can be found in

	David S. Warren, "Memoing for Logic Programs", in Communications
	of the ACM, Vol 35 No 3, pp 93-111, March 1992.

Unification is done by the auxiliary files (match, symbols, bindings,
binding-dag, cnf) which I "stole" from Matt Ginsberg's MVL prover.

Although function symbols are allowed, at the present time DTP performs neither
term reasoning (with rewrite rules), nor does it have equality built in.
There is a hook in the code to add such capability.  If the function
"rewrite-ground-term" is defined in the DTP package, it will be called on all
ground terms in literals just prior to making new subgoals from them.
_______________________________________________________________________________
INSTALLATION

Loading dtp.lisp (compiles and) loads all the other files.  You may reload
the system by evaluating
	(load-dtp-system)
which expands to
	(compile-system :dtp)
	(load-system :dtp)

Customization is available by editing the dtp.lisp file.  In particular,
logical pathnames for the system are defined there.
_______________________________________________________________________________
DEMO

For a demo of the theorem prover, start lisp and then evaluate:
	(load "dtp")
	(in-package "DTP")
	(test-dtp)

To run examples by hand, try (for example):
	(push :proofs *trace*)
	(setq *default-theory* 'dtp-2.00)
	(show-contents)
	(prove '(a ?i ?j))	; (a 0 9)
	(setq p (fourth /))	; The proof object from the last function
	(show-proof-graph p)
	(prove-next-answer p)	; (a 1 2)
	(show-proof-graph p)
	(prove-next-answer p)	; (a 6 5)
	(show-proof-graph p)
	(prove-next-answer p)	; nil
	(show-proof-graph p)

An example that demonstrates recursion control is available with the query
"(outrun lion ?prey)" in the theory "animal".
_______________________________________________________________________________
GLOBAL USER VARIABLES

*default-theory*

	Root theory for sentences to be used in proofs, if not specified in the
	(prove ...) function call.  The set of sentences will be those in the
	transitive closure of the theory DAG beginning at this root.

*display-logic-as-lists*

	Output form preference.  Whether literals should be printed with
	relation names before (e.g. Father(Don,Jim)) or after (e.g.
	(father don jim)) the parentheses.

*show-renamed-variables*

	When sentences are retrieved from the database, variables must all be
	renamed.  It is often easier to read output with the original names,
	and the possible confusion of similar-printing but distinct variables
	rarely occurs.  This variable controls whether the unique integer
	suffix is printed when the variables are output.

*trace*

	A list of keywords, each of which controls the output of trace output
	printed as DTP runs.  The possible options are in *trace-keywords*,
	and resetting DTP returns it to *trace-defaults*.
_______________________________________________________________________________
USER FUNCTIONS
These are exported from the DTP package.

[bindings.lisp]
	plug

[internals.lisp]
	reset-dtp

[database.lisp]
	empty-theory
	make-theory-from-sentences
	save-sentence-in-theory
	drop-sentence-from-theory

[file.lisp]
	dtp-load

[hierarchy.lisp]
	includes
	unincludes
	includees
	decludes
	included-active-theory-names
	show-theory-dag
	all-theories

[output.lisp]
	show-proof-graph
	show-contents

[prover.lisp]
	prove
	prove-next-answer
	prove-all-remaining-answers

[test.lisp]
	test-dtp

_______________________________________________________________________________
FILES
[in logical directory "dtp:"]

	README			This file
	TODO			Thoughts for the future

	dtp.lisp		Define DTP package, load other files
	defsystem.lisp		Common Lisp implementation of DEFSYSTEM

	types.lisp		Data types
	structures.lisp		DEFSTRUCTs
	classes.lisp		DEFCLASSes
	variables.lisp		Global parameters/variables, special variables

	internals.lisp		Small common lisp extensions	

	symbols.lisp		Logic variables	[Stolen from MVL]
	bindings.lisp		Binding lists	[Stolen from MVL]
	binding-dag.lisp	Binding lists	[Stolen from MVL]
	match.lisp		Logic variables	[Stolen from MVL]
	cnf.lisp		Database	[Stolen from MVL]

	literals.lisp		Logic literals
	clauses.lisp		Logic clauses
	labels.lisp		Logic sentence labels
	database.lisp		Theories and sentences

	inference-internals.lisp
				Generic functions
	subgoals.lisp		Subgoal computations
	conjunctions.lisp	Conjunction and conjunct computations
	memoing.lisp		Recursion control and subgoal caching
	ordering.lisp		Search control
	prover			Theorem prover driver

	hierarchy.lisp		Theory DAG
	output.lisp		User output
	file.lisp		File loading of logic theories
	test.lisp		Functions to test all the code

	logic;dtp.test		Sample queries and answers for tests.dtp
	logic;tests.dtp		Sample logic theories
_______________________________________________________________________________
