The Isabelle Reference Manual

rule v x thm maps the premise a ≡ b to the conclusion (λx . a) ≡ (λx . b), abstracting over all occurrences (if any!) of x . Parameter x is supplied as a cterm. It may be an unknown or a free variable (provided it does not occur in the assumptions). In the conclusion, the bound variable is named v . combination thm1 thm2 maps the premises f ≡ g and a ≡ b to the conclusion f (a) ≡ g(b). 5.2.6 Forall introduction rules forall_intr : cterm -> thm -> thm forall_intr_list : cterm list -> thm -> thm forall_intr_frees : thm -> thm forall_intr x thm applies ( ∧ I ), abstracting over all occurrences (if any!) of x . The rule maps the premise φ to the conclusion ∧ x . φ. Parameter x is supplied as a cterm. It may be an unknown or a free variable (provided it does not occur in the assumptions). forall_intr_list xs thm applies ( ∧ I ) repeatedly, on every element of the list xs . forall_intr_frees thm applies ( ∧ I ) repeatedly, generalizing over all the free variables of the premise. CHAPTER 5. THEOREMS AND FORWARD PROOF 46 5.2.7 Forall elimination rules forall_elim : cterm -> thm -> thm forall_elim_list : cterm list -> thm -> thm forall_elim_var : int -> thm -> thm forall_elim_vars : int -> thm -> thm forall_elim ct thm applies ( ∧ E ), mapping the premise ∧ x .φ to the conclusion φ[ct/x ]. The rule checks that ct and x have the same type. forall_elim_list cts thm applies ( ∧ E ) repeatedly, on every element of the list cts . forall_elim_var k thm applies ( ∧ E ), mapping the premise ∧ x . φ to the conclusion φ[?xk/x ]. Thus, it replaces the outermost ∧ -bound variable by an unknown having subscript k . forall_elim_vars ks thm applies forall_elim_var repeatedly, for every element of the list ks . 5.2.8 Instantiation of unknowns instantiate: (indexname * ctyp) list * (cterm * cterm)list -> thm -> thm instantiate (tyinsts, insts) thm simultaneously substitutes types for type unknowns (the tyinsts) and terms for term unknowns (the insts). Instantiations are given as (v , t) pairs, where v is an unknown and t is a term (of the same type as v) or a type (of the same sort as v). All the unknowns must be distinct. The rule normalizes its conclusion. Note that instantiate’ (see §5.1.4) provides a more convenient interface to this rule. 5.2.9 Freezing/thawing type unknowns freezeT: thm -> thm varifyT: thm -> thm freezeT thm converts all the type unknowns in thm to free type variables. varifyT thm converts all the free type variables in thm to type unknowns. 5.3 Derived rules for goal-directed proof Most of these rules have the sole purpose of implementing particular tactics. There are few occasions for applying them directly to a theorem. CHAPTER 5. THEOREMS AND FORWARD PROOF 47 5.3.1 Proof by assumption assumption : int -> thm -> thm Seq.seq eq_assumption : int -> thm -> thm assumption i thm attempts to solve premise i of thm by assumption. eq_assumption is like assumption but does not use unification. 5.3.2 Resolution biresolution : bool -> (bool*thm)list -> int -> thm -> thm Seq.seq biresolution match rules i state performs bi-resolution on subgoal i of state, using the list of (flag , rule) pairs. For each pair, it applies resolution if the flag is false and elim-resolution if the flag is true. If match is true, the state is not instantiated. 5.3.3 Composition: resolution without lifting compose : thm * int * thm -> thm list COMP : thm * thm -> thm bicompose : bool -> bool * thm * int -> int -> thm -> thm Seq.seq In forward proof, a typical use of composition is to regard an assertion of the form φ =⇒ ψ as atomic. Schematic variables are not renamed, so beware of clashes! compose (thm1, i, thm2) uses thm1, regarded as an atomic formula, to solve premise i of thm2. Let thm1 and thm2 be ψ and [[φ1; . . . ;φn ]] =⇒ φ. For each s that unifies ψ and φi , the result list contains the theorem ([[φ1; . . . ;φi−1;φi+1; . . . ;φn ]] =⇒ φ)s . thm1 COMP thm2 calls compose (thm1, 1, thm2) and returns the result, if unique; otherwise, it raises exception THM. It is analogous to RS. For example, suppose that thm1 is a = b =⇒ b = a, a symmetry rule, and that thm2 is [[P =⇒ Q ;¬Q ]] =⇒ ¬P , which is the principle of contrapositives. Then the result would be the derived rule ¬(b = a) =⇒ ¬(a = b). bicompose match (flag, rule, m) i state refines subgoal i of state using rule, without lifting. The rule is taken to have the form [[ψ1; . . . ;ψm ]] =⇒ ψ, where ψ need not be atomic; thusm determines the number of new subgoals. If flag is true then it performs elim-resolution — it solves the first premise of rule by assumption and deletes that assumption. If match is true, the state is not instantiated. CHAPTER 5. THEOREMS AND FORWARD PROOF 48 5.3.4 Other meta-rules trivial : cterm -> thm lift_rule : (thm * int) -> thm -> thm rename_params_rule : string list * int -> thm -> thm flexflex_rule : thm -> thm Seq.seq trivial ct makes the theorem φ =⇒ φ, where φ is the value of ct . This is the initial state for a goal-directed proof of φ. The rule checks that ct has type prop. lift_rule (state, i) rule prepares rule for resolution by lifting it over the parameters and assumptions of subgoal i of state. rename_params_rule (names, i) thm uses the names to rename the parameters of premise i of thm. The names must be distinct. If there are fewer names than parameters, then the rule renames the innermost parameters and may modify the remaining ones to ensure that all the parameters are distinct. flexflex_rule thm removes all flex-flex pairs from thm using the trivial unifier.

[1]  Robert S. Boyer,et al.  A computational logic handbook , 1979, Perspectives in computing.

[2]  José Meseguer,et al.  Principles of OBJ2 , 1985, POPL.

[3]  Richard E. Korf,et al.  Depth-First Iterative-Deepening: An Optimal Admissible Tree Search , 1985, Artif. Intell..

[4]  Eugene Charniak,et al.  Artificial Intelligence Programming , 1987 .

[5]  Bengt Nordström,et al.  Programming in Martin-Lo¨f's type theory: an introduction , 1990 .

[6]  Tobias Nipkow,et al.  Ordered Rewriting and Confluence , 1990, CADE.

[7]  Lawrence C. Paulson,et al.  ML for the working programmer , 1991 .

[8]  Tobias Nipkow,et al.  Functional unification of higher-order patterns , 1993, [1993] Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science.

[9]  T. Nipkom Functional unification of higher-order patterns , 1993, LICS 1993.

[10]  de Ng Dick Bruijn,et al.  Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[11]  Tobias Nipkow,et al.  Type Reconstruction for Type Classes , 1993 .

[12]  Markus Wenzel,et al.  Type Classes and Overloading in Higher-Order Logic , 1997, TPHOLs.

[13]  Florian Kammüller,et al.  Locales - A Sectioning Concept for Isabelle , 1999, TPHOLs.

[14]  Tobias Nipkow,et al.  Proof Terms for Simply Typed Higher Order Logic , 2000, TPHOLs.

[15]  Lawrence Charles Paulson,et al.  Isabelle/HOL: A Proof Assistant for Higher-Order Logic , 2002 .

[16]  Francis Jeffry Pelletier,et al.  Seventy-five problems for testing automatic theorem provers , 1986, Journal of Automated Reasoning.