src/HOL/Sledgehammer.thy
author blanchet
Thu Sep 30 18:59:37 2010 +0200 (2010-09-30)
changeset 39894 35ae5cf8c96a
parent 39890 a1695e2169d0
child 39942 1ae333bfef14
permissions -rw-r--r--
encode number of skolem assumptions in them, for more efficient retrieval later
     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/meson_clausify.ML")
    18   ("Tools/Sledgehammer/metis_translate.ML")
    19   ("Tools/Sledgehammer/metis_reconstruct.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 lemma skolem_COMBK_iff: "P \<longleftrightarrow> skolem (COMBK P (i\<Colon>nat))"
    64 unfolding skolem_def COMBK_def by (rule refl)
    65 
    66 lemmas skolem_COMBK_I = iffD1 [OF skolem_COMBK_iff]
    67 lemmas skolem_COMBK_D = iffD2 [OF skolem_COMBK_iff]
    68 
    69 text{*Theorems for translation to combinators*}
    70 
    71 lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> 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 [no_atp]: "\<lambda>x. x \<equiv> COMBI"
    78 apply (rule eq_reflection)
    79 apply (rule ext) 
    80 apply (simp add: COMBI_def) 
    81 done
    82 
    83 lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
    84 apply (rule eq_reflection)
    85 apply (rule ext) 
    86 apply (simp add: COMBK_def) 
    87 done
    88 
    89 lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> 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 [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
    96 apply (rule eq_reflection)
    97 apply (rule ext) 
    98 apply (simp add: COMBC_def) 
    99 done
   100 
   101 use "Tools/ATP/atp_problem.ML"
   102 use "Tools/ATP/atp_proof.ML"
   103 use "Tools/ATP/atp_systems.ML"
   104 setup ATP_Systems.setup
   105 
   106 use "~~/src/Tools/Metis/metis.ML"
   107 use "Tools/Sledgehammer/meson_clausify.ML"
   108 setup Meson_Clausify.setup
   109 
   110 use "Tools/Sledgehammer/metis_translate.ML"
   111 use "Tools/Sledgehammer/metis_reconstruct.ML"
   112 use "Tools/Sledgehammer/metis_tactics.ML"
   113 setup Metis_Tactics.setup
   114 
   115 use "Tools/Sledgehammer/sledgehammer_util.ML"
   116 use "Tools/Sledgehammer/sledgehammer_filter.ML"
   117 use "Tools/Sledgehammer/sledgehammer_translate.ML"
   118 use "Tools/Sledgehammer/sledgehammer_reconstruct.ML"
   119 use "Tools/Sledgehammer/sledgehammer.ML"
   120 setup Sledgehammer.setup
   121 use "Tools/Sledgehammer/sledgehammer_minimize.ML"
   122 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   123 setup Sledgehammer_Isar.setup
   124 
   125 end