src/HOL/Sledgehammer.thy
author blanchet
Wed Mar 24 12:31:37 2010 +0100 (2010-03-24)
changeset 35967 b9659daa5b4b
parent 35867 16279c4c7a33
child 36062 194cb6e3c13f
permissions -rw-r--r--
add new file "sledgehammer_util.ML" to setup
     1 (*  Title:      HOL/Sledgehammer.thy
     2     Author:     Lawrence C Paulson
     3     Author:     Jia Meng, NICTA
     4     Author:     Fabian Immler, TU Muenchen
     5     Author:     Jasmin Blanchette, TU Muenchen
     6 *)
     7 
     8 header {* Sledgehammer: Isabelle--ATP Linkup *}
     9 
    10 theory Sledgehammer
    11 imports Plain Hilbert_Choice
    12 uses
    13   "Tools/polyhash.ML"
    14   "~~/src/Tools/Metis/metis.ML"
    15   "Tools/Sledgehammer/sledgehammer_util.ML"
    16   ("Tools/Sledgehammer/sledgehammer_fol_clause.ML")
    17   ("Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML")
    18   ("Tools/Sledgehammer/sledgehammer_hol_clause.ML")
    19   ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
    20   ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
    21   ("Tools/ATP_Manager/atp_manager.ML")
    22   ("Tools/ATP_Manager/atp_wrapper.ML")
    23   ("Tools/ATP_Manager/atp_minimal.ML")
    24   ("Tools/Sledgehammer/sledgehammer_isar.ML")
    25   ("Tools/Sledgehammer/meson_tactic.ML")
    26   ("Tools/Sledgehammer/metis_tactics.ML")
    27 begin
    28 
    29 definition COMBI :: "'a \<Rightarrow> 'a"
    30   where "COMBI P \<equiv> P"
    31 
    32 definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a"
    33   where "COMBK P Q \<equiv> P"
    34 
    35 definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c"
    36   where "COMBB P Q R \<equiv> P (Q R)"
    37 
    38 definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c"
    39   where "COMBC P Q R \<equiv> P R Q"
    40 
    41 definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c"
    42   where "COMBS P Q R \<equiv> P R (Q R)"
    43 
    44 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
    45   where "fequal X Y \<equiv> (X = Y)"
    46 
    47 lemma fequal_imp_equal: "fequal X Y \<Longrightarrow> X = Y"
    48   by (simp add: fequal_def)
    49 
    50 lemma equal_imp_fequal: "X = Y \<Longrightarrow> fequal X Y"
    51   by (simp add: fequal_def)
    52 
    53 text{*These two represent the equivalence between Boolean equality and iff.
    54 They can't be converted to clauses automatically, as the iff would be
    55 expanded...*}
    56 
    57 lemma iff_positive: "P \<or> Q \<or> P = Q"
    58 by blast
    59 
    60 lemma iff_negative: "\<not> P \<or> \<not> Q \<or> P = Q"
    61 by blast
    62 
    63 text{*Theorems for translation to combinators*}
    64 
    65 lemma abs_S: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
    66 apply (rule eq_reflection)
    67 apply (rule ext) 
    68 apply (simp add: COMBS_def) 
    69 done
    70 
    71 lemma abs_I: "\<lambda>x. x \<equiv> COMBI"
    72 apply (rule eq_reflection)
    73 apply (rule ext) 
    74 apply (simp add: COMBI_def) 
    75 done
    76 
    77 lemma abs_K: "\<lambda>x. y \<equiv> COMBK y"
    78 apply (rule eq_reflection)
    79 apply (rule ext) 
    80 apply (simp add: COMBK_def) 
    81 done
    82 
    83 lemma abs_B: "\<lambda>x. a (g x) \<equiv> COMBB a g"
    84 apply (rule eq_reflection)
    85 apply (rule ext) 
    86 apply (simp add: COMBB_def) 
    87 done
    88 
    89 lemma abs_C: "\<lambda>x. (f x) b \<equiv> COMBC f b"
    90 apply (rule eq_reflection)
    91 apply (rule ext) 
    92 apply (simp add: COMBC_def) 
    93 done
    94 
    95 
    96 subsection {* Setup of external ATPs *}
    97 
    98 use "Tools/Sledgehammer/sledgehammer_fol_clause.ML"
    99 use "Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML"
   100 setup Sledgehammer_Fact_Preprocessor.setup
   101 use "Tools/Sledgehammer/sledgehammer_hol_clause.ML"
   102 use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
   103 setup Sledgehammer_Proof_Reconstruct.setup
   104 use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
   105 use "Tools/ATP_Manager/atp_manager.ML"
   106 use "Tools/ATP_Manager/atp_wrapper.ML"
   107 setup ATP_Wrapper.setup
   108 use "Tools/ATP_Manager/atp_minimal.ML"
   109 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   110 
   111 
   112 subsection {* The MESON prover *}
   113 
   114 use "Tools/Sledgehammer/meson_tactic.ML"
   115 setup Meson_Tactic.setup
   116 
   117 
   118 subsection {* The Metis prover *}
   119 
   120 use "Tools/Sledgehammer/metis_tactics.ML"
   121 setup Metis_Tactics.setup
   122 
   123 end