src/HOL/ATP_Linkup.thy
author wenzelm
Thu Oct 04 20:29:42 2007 +0200 (2007-10-04)
changeset 24850 0cfd722ab579
parent 24827 646bdc51eb7d
child 24943 5f5679e2ec2f
permissions -rw-r--r--
Name.uu, Name.aT;
     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 Divides Record Hilbert_Choice Presburger Relation_Power SAT Recdef Extraction 
    11    (*It must be a parent or a child of every other theory, to prevent theory-merge errors.*)
    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 COMBB' :: "('a => 'c) => ('b => 'a) => ('d => 'b) => 'd => 'c"
    42   where "COMBB' M P Q R == M (P (Q R))"
    43 
    44 definition COMBC' :: "('a => 'b => 'c) => ('d => 'a) => 'b => 'd => 'c"
    45   where "COMBC' M P Q R == M (P R) Q"
    46 
    47 definition COMBS' :: "('a => 'b => 'c) => ('d => 'a) => ('d => 'b) => 'd => 'c"
    48   where "COMBS' M P Q R == M (P R) (Q R)"
    49 
    50 definition fequal :: "'a => 'a => bool"
    51   where "fequal X Y == (X=Y)"
    52 
    53 lemma fequal_imp_equal: "fequal X Y ==> X=Y"
    54   by (simp add: fequal_def)
    55 
    56 lemma equal_imp_fequal: "X=Y ==> fequal X Y"
    57   by (simp add: fequal_def)
    58 
    59 text{*These two represent the equivalence between Boolean equality and iff.
    60 They can't be converted to clauses automatically, as the iff would be
    61 expanded...*}
    62 
    63 lemma iff_positive: "P | Q | P=Q"
    64 by blast
    65 
    66 lemma iff_negative: "~P | ~Q | P=Q"
    67 by blast
    68 
    69 text{*Theorems for translation to combinators*}
    70 
    71 lemma abs_S: "(%x. (f x) (g x)) == COMBS f g"
    72 apply (rule eq_reflection)
    73 apply (rule ext) 
    74 apply (simp add: COMBS_def) 
    75 done
    76 
    77 lemma abs_I: "(%x. x) == COMBI"
    78 apply (rule eq_reflection)
    79 apply (rule ext) 
    80 apply (simp add: COMBI_def) 
    81 done
    82 
    83 lemma abs_K: "(%x. y) == COMBK y"
    84 apply (rule eq_reflection)
    85 apply (rule ext) 
    86 apply (simp add: COMBK_def) 
    87 done
    88 
    89 lemma abs_B: "(%x. a (g x)) == COMBB a g"
    90 apply (rule eq_reflection)
    91 apply (rule ext) 
    92 apply (simp add: COMBB_def) 
    93 done
    94 
    95 lemma abs_C: "(%x. (f x) b) == COMBC f b"
    96 apply (rule eq_reflection)
    97 apply (rule ext) 
    98 apply (simp add: COMBC_def) 
    99 done
   100 
   101 
   102 use "Tools/res_axioms.ML"      --{*requires the combinators declared above*}
   103 use "Tools/res_hol_clause.ML"
   104 use "Tools/res_reconstruct.ML"
   105 use "Tools/watcher.ML"
   106 use "Tools/res_atp.ML"
   107 
   108 setup ResAxioms.meson_method_setup
   109 
   110 
   111 subsection {* Setup for Vampire, E prover and SPASS *}
   112 
   113 use "Tools/res_atp_provers.ML"
   114 
   115 oracle vampire_oracle ("string * int") = {* ResAtpProvers.vampire_o *}
   116 oracle eprover_oracle ("string * int") = {* ResAtpProvers.eprover_o *}
   117 oracle spass_oracle ("string * int") = {* ResAtpProvers.spass_o *}
   118 
   119 use "Tools/res_atp_methods.ML"
   120 setup ResAtpMethods.setup      --{*Oracle ATP methods: still useful?*}
   121 setup ResAxioms.setup          --{*Sledgehammer*}
   122 
   123 subsection {* The Metis prover *}
   124 
   125 use "Tools/metis_tools.ML"
   126 setup MetisTools.setup
   127 
   128 setup {*
   129   Theory.at_end ResAxioms.clause_cache_endtheory
   130 *}
   131 
   132 end