 
 
 
 
 
 
 
  
In purpose of this chapter is to explain:
A proof of a statement  is conclusive mathematical
evidence of why
is conclusive mathematical
evidence of why  is true. A proof is usually thought of as a
sequence of formulas
is true. A proof is usually thought of as a
sequence of formulas 
 such that
such that 
 and every
and every  is either:
is either:
 is related to these formulas by a relation
called an inference.
is related to these formulas by a relation
called an inference.
In the traditional presentation of proofs in textbooks and journals, the deductive process appears as an inexorable progression from known facts to unknown ones. In contrast, the deductive process in IMPS begins with a conjecture and usually proceeds with a large amount of trial and error. This view of the deductive process leads naturally to the idea of a proof as a graph.
Proofs in  IMPS are represented by a data structure called a deduction graph, which is a directed graph with two kinds of nodes:
inference nodes and sequent nodes. A sequent node consists
of a single formula called the assertion together with a context.  The context is logically a set of assumptions, although the
implementation caches various kinds of derived information with a
context.  An inference node i consists of a unique conclusion
node c, a (possibly empty) set of hypothesis nodes 
 and the mathematical justification for asserting the
relationship between c and
and the mathematical justification for asserting the
relationship between c and 
 This justification is
called an inference rule.
This justification is
called an inference rule.
As an interactive process, a proof consists of a series of reductions of unproven sequent nodes of the graph (which we think of as goals) to new subgoals. Each reduction is created by a procedure called a primitive inference procedure, which takes a sequent node and possibly other arguments, returns an inference node inf and, as a side-effect, changes the deduction graph. These changes include:
There are about 25 primitive inference procedures. Primitive inference procedures are the only means by which inference nodes can be added to a deduction graph. As a user of IMPS, however, you will never apply primitive inference procedures directly; you will only apply them indirectly by applying proof commands--convenient procedures which add sequent nodes and inference nodes to a deduction graph by calling primitive inferences. Proof commands are documented in Chapter 18.
There are two modes of proving theorems in IMPS: interactive mode and script mode. Interactive mode is used for proof discovery and interactive experimentation with new proof techniques. Script mode is used primarily for proving theorems whose proofs are similar to previously constructed proofs or for checking a large number of proofs.
To begin an interactive proof, select the Start dg option in the menu or use the Emacs command M-x imps-start-deduction. IMPS will then prompt you in the minibuffer with the text Formula or reference number: which you can supply by clicking the right mouse button on the formula you want to prove (provided it is enclosed between double quotes) or by typing the reference number of the formula (provided it has already been built). All the proof commands and node-movement commands given during the course of a single proof are recorded as a component of the deduction graph. These commands can be inserted as text into a buffer (provided the major mode of the buffer is scheme mode) by selecting the option Insert proof script or by entering C-c i. The text that is inserted in the buffer is a script of proof commands which can be edited and used in other proofs. To run a command script, select the option Execute region or enter C-c r. This will run the commands in the current region. Note that an interactive proof can be combined with one or more proof segments run in script mode. This is especially useful for redoing similar arguments.
$IMPS/../bin/run_test testfile logfilewhere testfile is a text file which may contain any def-form. Typically, it will consist of a series of include-files and load-section forms. The file logfile will contain the output of the process.
For example, entering on a machine called veraguas the shell command
$IMPS/../bin/run_test testy loggywhere testy contains
(load-section abstract-calculus)will produce a logfile
loggy which will look something like:
HOST veraguas starting IMPS test.
File tested = testy
Executable = /imps/sys/executables/foundation
Mon May  3 18:21:56 EDT 1993
INITIAL THEORY NETWORK INFORMATION:
THEORIES = 12
THEORY-INTERPRETATIONS = 1
THEOREMS = 277
MACETES = 360
EXPRESSIONS = 3428
1. THEOREM-NAME: ANONYMOUS
forall(a,c:uu,
  forsome(b:uu,b prec a and c prec b) implies c prec a);
THEORY: PARTIAL-ORDER
SEQUENT NODES: 10
PROOF STEPS: 3
GROUNDED?: YES
CONTEXTS=4
ASSUMPTIONS/CONTEXT=1.0
virtual time = 0.16 seconds
   .
   .
   .
219. THEOREM-NAME: LOCALITY-OF-INTEGRALS
forall(phi,psi:[ii,uu],a,b:ii,
  a<b
   and 
  integrable(phi)
   and 
  integrable(psi)
   and 
  forall(x:ii,a<=x and x<b implies phi(x)=psi(x))
   implies 
  forall(x:ii,
    a<=x and x<b implies 
    integral(a,x,phi)=integral(a,x,psi)));
THEORY: MAPPINGS-FROM-AN-INTERVAL-TO-A-NORMED-SPACE
SEQUENT NODES: 54
PROOF STEPS: 33
GROUNDED?: YES
CONTEXTS=29
ASSUMPTIONS/CONTEXT=5.551724137931035
virtual time = 25.05 seconds
0 errors during test.
0 failed proofs during test.
FINAL THEORY NETWORK INFORMATION:
THEORIES = 32
THEORY-INTERPRETATIONS = 110
THEOREMS = 915
MACETES = 1108
EXPRESSIONS = 89274
Mon May  3 21:06:38 EDT 1993
IMPS test completed.
Informally, a script is a sequence of proof commands and control statements. Essentially, the script facility in IMPS allows users to build programs to prove theorems. Scripts are a useful way to package and reuse common patterns of reasoning. The paper [8] presents some practical methods for exploiting the IMPS proof script mechanism.
A script is a kind of s-expression, that is, a symbol, a string, an integer, or a nested-list of such objects. To describe how IMPS interprets scripts to modify the state of the deduction graph, we first establish some terminology to designate certain classes of script components. Each script component is itself an s-expression.
%, *, ~*.
![[*]](cross_ref_motif.gif) on the  IMPS micro exercises. The script
consists of a number of forms, each of which is applied to a unique node of 
the deduction graph called the current node. In interactive mode, 
the current node is the one which is displayed in the sequent node buffer.
 on the  IMPS micro exercises. The script
consists of a number of forms, each of which is applied to a unique node of 
the deduction graph called the current node. In interactive mode, 
the current node is the one which is displayed in the sequent node buffer.
 and
and  and the assertion
and the assertion  
%, *, ~*) then that
operator is applied to the values of the arguments as follows:
(% 
 ).
The first argument must be a string with exactly n occurrences
of the characters
).
The first argument must be a string with exactly n occurrences
of the characters ~A. The remaining arguments 
 are plugged in 
succession for each occurrence of
are plugged in 
succession for each occurrence of ~A.
(%sym 
 ). 
The first argument must be a string with exactly n occurrences of
the characters
). 
The first argument must be a string with exactly n occurrences of
the characters ~A. The remaining arguments 
 are plugged in succession for each occurrence of
are plugged in succession for each occurrence of ~A and the
resulting string is read in as a symbol.
(* 
 ).
The set of assumptions (regarded as strings) of the current sequent
node which match any argument.
).
The set of assumptions (regarded as strings) of the current sequent
node which match any argument.
(~* 
 ).
The set of assumptions (regarded as strings) of the current sequent
node which match no argument.
).
The set of assumptions (regarded as strings) of the current sequent
node which match no argument.
A script is a list 
(
 of script expressions.  The interpreter executes
each form in the script in left-to-right order12.1.  Once a form is executed by the script interpreter at a
sequent node S, execution of the script continues at a new sequent
node S1 called the natural continuation node of the script.
This node is usually the first ungrounded relative of S after the form is executed. The only exception is when the form is a
node motion keyword form.
of script expressions.  The interpreter executes
each form in the script in left-to-right order12.1.  Once a form is executed by the script interpreter at a
sequent node S, execution of the script continues at a new sequent
node S1 called the natural continuation node of the script.
This node is usually the first ungrounded relative of S after the form is executed. The only exception is when the form is a
node motion keyword form.
The rules for script interpreter execution are given below.
Interpreting a script expression 
 usually causes
side effects on the current deduction graph and other structures
associated to the current proof. The side-effects depend on the kind
of form being handled by the interpreter.
usually causes
side effects on the current deduction graph and other structures
associated to the current proof. The side-effects depend on the kind
of form being handled by the interpreter.
 )). 
This causes execution to proceed at the specified descendent node.
Each li is an integer or a dotted pair
)). 
This causes execution to proceed at the specified descendent node.
Each li is an integer or a dotted pair 
 of integers.
of integers. 
 
 
 
 ), where 
assertion and
), where 
assertion and 
 are script expressions.
The condition is true if the value of assertion matches the
assertion of the current sequent node and every formula in the value
of assumption-list matches an assumption of the current sequent
node.
are script expressions.
The condition is true if the value of assertion matches the
assertion of the current sequent node and every formula in the value
of assumption-list matches an assumption of the current sequent
node.
 ). 
True if all
). 
True if all 
 are true. May cause side effects
on the deduction graph.
are true. May cause side effects
on the deduction graph.
 ). 
True if at least one
). 
True if at least one 
 is true. May cause side
effects on the deduction graph.
is true. May cause side
effects on the deduction graph.
 ).  A block form merely provides a grouping for a
list of script forms.
).  A block form merely provides a grouping for a
list of script forms.
The following are possible arguments to a command:
  (def-theorem MIN-LEMMA
     "forall(a,b,c:rr, 
               a<b and a<c 
                implies 
               forsome(d:rr, a<d and d<=b and d<=c))"
     (theory h-o-real-arithmetic)
     (proof
      (
       direct-and-antecedent-inference-strategy
       (instantiate-existential ("min(b,c)"))
       (unfold-single-defined-constant-globally min)
       (case-split ("b<=c"))
       simplify
       simplify
       (apply-macete-with-minor-premises minimum-1st-arg)
       (apply-macete-with-minor-premises minimum-2nd-arg)
       )))
To get a valid proof for an analogous theorem where the arguments to < and  are 
interchanged, one can edit the previous script replacing min by max
everywhere in the proof:
are 
interchanged, one can edit the previous script replacing min by max
everywhere in the proof:
   (def-theorem MAX-LEMMA
     "forall(a,b,c:rr, 
                b<a and c<a 
                 implies 
                forsome(d:rr, d<a and b<=d and c<=d))"
     (theory h-o-real-arithmetic)
     (proof
      (
       direct-and-antecedent-inference-strategy
       (instantiate-existential ("max(b,c)"))
       (unfold-single-defined-constant-globally max)
       (case-split ("b<=c"))
       simplify
       simplify
       (apply-macete-with-minor-premises maximum-1st-arg)
       (apply-macete-with-minor-premises maximum-2nd-arg)
       )))
 
 
 
 
 
 
