src/HOL/ATP_Linkup.thy
author wenzelm
Sat Dec 22 14:10:22 2007 +0100 (2007-12-22)
changeset 25741 2d102ddaca8b
parent 25728 71e33d95ac55
child 26729 43a72d892594
permissions -rw-r--r--
use random_word.ML earlier;
     1 (*  Title:      HOL/ATP_Linkup.thy
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson
     4     Author:     Jia Meng, NICTA
     5 *)
     6 
     7 header{* The Isabelle-ATP Linkup *}
     8 
     9 theory ATP_Linkup
    10 imports PreList Hilbert_Choice
    11    (*FIXME It must be a parent or a child of every other theory, to prevent theory-merge errors. FIXME*)
    12 uses
    13   "Tools/polyhash.ML"
    14   "Tools/res_clause.ML"
    15   ("Tools/res_hol_clause.ML")
    16   ("Tools/res_axioms.ML")
    17   ("Tools/res_reconstruct.ML")
    18   ("Tools/watcher.ML")
    19   ("Tools/res_atp.ML")
    20   ("Tools/res_atp_provers.ML")
    21   ("Tools/res_atp_methods.ML")
    22   "~~/src/Tools/Metis/metis.ML"
    23   ("Tools/metis_tools.ML")
    24 begin
    25 
    26 definition COMBI :: "'a => 'a"
    27   where "COMBI P == P"
    28 
    29 definition COMBK :: "'a => 'b => 'a"
    30   where "COMBK P Q == P"
    31 
    32 definition COMBB :: "('b => 'c) => ('a => 'b) => 'a => 'c"
    33   where "COMBB P Q R == P (Q R)"
    34 
    35 definition COMBC :: "('a => 'b => 'c) => 'b => 'a => 'c"
    36   where "COMBC P Q R == P R Q"
    37 
    38 definition COMBS :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c"
    39   where "COMBS P Q R == P R (Q R)"
    40 
    41 definition fequal :: "'a => 'a => bool"
    42   where "fequal X Y == (X=Y)"
    43 
    44 lemma fequal_imp_equal: "fequal X Y ==> X=Y"
    45   by (simp add: fequal_def)
    46 
    47 lemma equal_imp_fequal: "X=Y ==> fequal X Y"
    48   by (simp add: fequal_def)
    49 
    50 text{*These two represent the equivalence between Boolean equality and iff.
    51 They can't be converted to clauses automatically, as the iff would be
    52 expanded...*}
    53 
    54 lemma iff_positive: "P | Q | P=Q"
    55 by blast
    56 
    57 lemma iff_negative: "~P | ~Q | P=Q"
    58 by blast
    59 
    60 text{*Theorems for translation to combinators*}
    61 
    62 lemma abs_S: "(%x. (f x) (g x)) == COMBS f g"
    63 apply (rule eq_reflection)
    64 apply (rule ext) 
    65 apply (simp add: COMBS_def) 
    66 done
    67 
    68 lemma abs_I: "(%x. x) == COMBI"
    69 apply (rule eq_reflection)
    70 apply (rule ext) 
    71 apply (simp add: COMBI_def) 
    72 done
    73 
    74 lemma abs_K: "(%x. y) == COMBK y"
    75 apply (rule eq_reflection)
    76 apply (rule ext) 
    77 apply (simp add: COMBK_def) 
    78 done
    79 
    80 lemma abs_B: "(%x. a (g x)) == COMBB a g"
    81 apply (rule eq_reflection)
    82 apply (rule ext) 
    83 apply (simp add: COMBB_def) 
    84 done
    85 
    86 lemma abs_C: "(%x. (f x) b) == COMBC f b"
    87 apply (rule eq_reflection)
    88 apply (rule ext) 
    89 apply (simp add: COMBC_def) 
    90 done
    91 
    92 
    93 use "Tools/res_axioms.ML"      --{*requires the combinators declared above*}
    94 use "Tools/res_hol_clause.ML"
    95 use "Tools/res_reconstruct.ML"
    96 use "Tools/watcher.ML"
    97 use "Tools/res_atp.ML"
    98 
    99 setup ResAxioms.meson_method_setup
   100 
   101 
   102 subsection {* Setup for Vampire, E prover and SPASS *}
   103 
   104 use "Tools/res_atp_provers.ML"
   105 
   106 oracle vampire_oracle ("string * int") = {* ResAtpProvers.vampire_o *}
   107 oracle eprover_oracle ("string * int") = {* ResAtpProvers.eprover_o *}
   108 oracle spass_oracle ("string * int") = {* ResAtpProvers.spass_o *}
   109 
   110 use "Tools/res_atp_methods.ML"
   111 setup ResAtpMethods.setup      --{*Oracle ATP methods: still useful?*}
   112 setup ResReconstruct.setup     --{*Config parameters*}
   113 setup ResAxioms.setup          --{*Sledgehammer*}
   114 
   115 subsection {* The Metis prover *}
   116 
   117 use "Tools/metis_tools.ML"
   118 setup MetisTools.setup
   119 
   120 setup {*
   121   Theory.at_end ResAxioms.clause_cache_endtheory
   122 *}
   123 
   124 end