src/HOL/Sledgehammer.thy
author blanchet
Thu Sep 16 16:12:02 2010 +0200 (2010-09-16)
changeset 39494 bf7dd4902321
parent 39452 70a57e40f795
child 39495 bb4fb9ffe2d1
permissions -rw-r--r--
rename "Metis_Clauses" to "Metis_Translate" for consistency with "Sledgehammer_Translate"
     1 (*  Title:      HOL/Sledgehammer.thy
     2     Author:     Lawrence C. Paulson, Cambridge University Computer Laboratory
     3     Author:     Jia Meng, Cambridge University Computer Laboratory and 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/ATP/atp_problem.ML")
    14   ("Tools/ATP/atp_proof.ML")
    15   ("Tools/ATP/atp_systems.ML")
    16   ("~~/src/Tools/Metis/metis.ML")
    17   ("Tools/Sledgehammer/clausifier.ML")
    18   ("Tools/Sledgehammer/meson_tactic.ML")
    19   ("Tools/Sledgehammer/metis_translate.ML")
    20   ("Tools/Sledgehammer/metis_tactics.ML")
    21   ("Tools/Sledgehammer/sledgehammer_util.ML")
    22   ("Tools/Sledgehammer/sledgehammer_filter.ML")
    23   ("Tools/Sledgehammer/sledgehammer_translate.ML")
    24   ("Tools/Sledgehammer/sledgehammer_reconstruct.ML")
    25   ("Tools/Sledgehammer/sledgehammer.ML")
    26   ("Tools/Sledgehammer/sledgehammer_minimize.ML")
    27   ("Tools/Sledgehammer/sledgehammer_isar.ML")
    28 begin
    29 
    30 lemma TruepropI: "P \<equiv> Q \<Longrightarrow> Trueprop P \<equiv> Trueprop Q"
    31 by simp
    32 
    33 definition skolem :: "'a \<Rightarrow> 'a" where
    34 [no_atp]: "skolem = (\<lambda>x. x)"
    35 
    36 definition COMBI :: "'a \<Rightarrow> 'a" where
    37 [no_atp]: "COMBI P = P"
    38 
    39 definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
    40 [no_atp]: "COMBK P Q = P"
    41 
    42 definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
    43 "COMBB P Q R = P (Q R)"
    44 
    45 definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
    46 [no_atp]: "COMBC P Q R = P R Q"
    47 
    48 definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
    49 [no_atp]: "COMBS P Q R = P R (Q R)"
    50 
    51 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
    52 "fequal X Y \<longleftrightarrow> (X = Y)"
    53 
    54 lemma fequal_imp_equal [no_atp]: "\<not> fequal X Y \<or> X = Y"
    55 by (simp add: fequal_def)
    56 
    57 lemma equal_imp_fequal [no_atp]: "\<not> X = Y \<or> fequal X Y"
    58 by (simp add: fequal_def)
    59 
    60 lemma equal_imp_equal [no_atp]: "X = Y ==> X = Y"
    61 by auto
    62 
    63 text{*Theorems for translation to combinators*}
    64 
    65 lemma abs_S [no_atp]: "\<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 [no_atp]: "\<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 [no_atp]: "\<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 [no_atp]: "\<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 [no_atp]: "\<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 use "Tools/ATP/atp_problem.ML"
    96 use "Tools/ATP/atp_proof.ML"
    97 use "Tools/ATP/atp_systems.ML"
    98 setup ATP_Systems.setup
    99 
   100 use "~~/src/Tools/Metis/metis.ML"
   101 use "Tools/Sledgehammer/clausifier.ML"
   102 use "Tools/Sledgehammer/meson_tactic.ML"
   103 setup Meson_Tactic.setup
   104 
   105 use "Tools/Sledgehammer/metis_translate.ML"
   106 use "Tools/Sledgehammer/metis_tactics.ML"
   107 setup Metis_Tactics.setup
   108 
   109 use "Tools/Sledgehammer/sledgehammer_util.ML"
   110 use "Tools/Sledgehammer/sledgehammer_filter.ML"
   111 use "Tools/Sledgehammer/sledgehammer_translate.ML"
   112 use "Tools/Sledgehammer/sledgehammer_reconstruct.ML"
   113 use "Tools/Sledgehammer/sledgehammer.ML"
   114 setup Sledgehammer.setup
   115 use "Tools/Sledgehammer/sledgehammer_minimize.ML"
   116 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   117 setup Sledgehammer_Isar.setup
   118 
   119 end