src/HOL/Sledgehammer.thy
author blanchet
Fri Apr 23 18:06:41 2010 +0200 (2010-04-23)
changeset 36376 e83d52a52449
parent 36375 2482446a604c
child 36377 b3dce4c715d0
permissions -rw-r--r--
renamed module "ATP_Wrapper" to "ATP_Systems"
     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   "~~/src/Tools/Metis/metis.ML"
    14   "Tools/Sledgehammer/sledgehammer_util.ML"
    15   ("Tools/Sledgehammer/sledgehammer_fol_clause.ML")
    16   ("Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML")
    17   ("Tools/Sledgehammer/sledgehammer_hol_clause.ML")
    18   ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
    19   ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
    20   ("Tools/ATP_Manager/atp_manager.ML")
    21   ("Tools/ATP_Manager/atp_wrapper.ML")
    22   ("Tools/Sledgehammer/sledgehammer_fact_minimizer.ML")
    23   ("Tools/Sledgehammer/sledgehammer_isar.ML")
    24   ("Tools/Sledgehammer/meson_tactic.ML")
    25   ("Tools/Sledgehammer/metis_tactics.ML")
    26 begin
    27 
    28 definition COMBI :: "'a \<Rightarrow> 'a"
    29   where "COMBI P \<equiv> P"
    30 
    31 definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a"
    32   where "COMBK P Q \<equiv> P"
    33 
    34 definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c"
    35   where "COMBB P Q R \<equiv> P (Q R)"
    36 
    37 definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c"
    38   where "COMBC P Q R \<equiv> P R Q"
    39 
    40 definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c"
    41   where "COMBS P Q R \<equiv> P R (Q R)"
    42 
    43 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
    44   where "fequal X Y \<equiv> (X = Y)"
    45 
    46 lemma fequal_imp_equal: "fequal X Y \<Longrightarrow> X = Y"
    47   by (simp add: fequal_def)
    48 
    49 lemma equal_imp_fequal: "X = Y \<Longrightarrow> fequal X Y"
    50   by (simp add: fequal_def)
    51 
    52 text{*These two represent the equivalence between Boolean equality and iff.
    53 They can't be converted to clauses automatically, as the iff would be
    54 expanded...*}
    55 
    56 lemma iff_positive: "P \<or> Q \<or> P = Q"
    57 by blast
    58 
    59 lemma iff_negative: "\<not> P \<or> \<not> Q \<or> P = Q"
    60 by blast
    61 
    62 text{*Theorems for translation to combinators*}
    63 
    64 lemma abs_S: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
    65 apply (rule eq_reflection)
    66 apply (rule ext) 
    67 apply (simp add: COMBS_def) 
    68 done
    69 
    70 lemma abs_I: "\<lambda>x. x \<equiv> COMBI"
    71 apply (rule eq_reflection)
    72 apply (rule ext) 
    73 apply (simp add: COMBI_def) 
    74 done
    75 
    76 lemma abs_K: "\<lambda>x. y \<equiv> COMBK y"
    77 apply (rule eq_reflection)
    78 apply (rule ext) 
    79 apply (simp add: COMBK_def) 
    80 done
    81 
    82 lemma abs_B: "\<lambda>x. a (g x) \<equiv> COMBB a g"
    83 apply (rule eq_reflection)
    84 apply (rule ext) 
    85 apply (simp add: COMBB_def) 
    86 done
    87 
    88 lemma abs_C: "\<lambda>x. (f x) b \<equiv> COMBC f b"
    89 apply (rule eq_reflection)
    90 apply (rule ext) 
    91 apply (simp add: COMBC_def) 
    92 done
    93 
    94 
    95 subsection {* Setup of external ATPs *}
    96 
    97 use "Tools/Sledgehammer/sledgehammer_fol_clause.ML"
    98 use "Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML"
    99 setup Sledgehammer_Fact_Preprocessor.setup
   100 use "Tools/Sledgehammer/sledgehammer_hol_clause.ML"
   101 use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
   102 use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
   103 use "Tools/ATP_Manager/atp_manager.ML"
   104 use "Tools/ATP_Manager/atp_wrapper.ML"
   105 setup ATP_Systems.setup
   106 use "Tools/Sledgehammer/sledgehammer_fact_minimizer.ML"
   107 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   108 
   109 
   110 subsection {* The MESON prover *}
   111 
   112 use "Tools/Sledgehammer/meson_tactic.ML"
   113 setup Meson_Tactic.setup
   114 
   115 
   116 subsection {* The Metis prover *}
   117 
   118 use "Tools/Sledgehammer/metis_tactics.ML"
   119 setup Metis_Tactics.setup
   120 
   121 end