src/HOL/Sledgehammer.thy
author blanchet
Mon Oct 04 21:50:32 2010 +0200 (2010-10-04)
changeset 39942 1ae333bfef14
parent 39894 35ae5cf8c96a
child 39946 78faa9b31202
permissions -rw-r--r--
remove Meson from Sledgehammer
     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/metis_translate.ML")
    18   ("Tools/Sledgehammer/metis_reconstruct.ML")
    19   ("Tools/Sledgehammer/metis_tactics.ML")
    20   ("Tools/Sledgehammer/sledgehammer_util.ML")
    21   ("Tools/Sledgehammer/sledgehammer_filter.ML")
    22   ("Tools/Sledgehammer/sledgehammer_translate.ML")
    23   ("Tools/Sledgehammer/sledgehammer_reconstruct.ML")
    24   ("Tools/Sledgehammer/sledgehammer.ML")
    25   ("Tools/Sledgehammer/sledgehammer_minimize.ML")
    26   ("Tools/Sledgehammer/sledgehammer_isar.ML")
    27 begin
    28 
    29 lemma TruepropI: "P \<equiv> Q \<Longrightarrow> Trueprop P \<equiv> Trueprop Q"
    30 by simp
    31 
    32 definition skolem :: "'a \<Rightarrow> 'a" where
    33 [no_atp]: "skolem = (\<lambda>x. x)"
    34 
    35 definition COMBI :: "'a \<Rightarrow> 'a" where
    36 [no_atp]: "COMBI P = P"
    37 
    38 definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
    39 [no_atp]: "COMBK P Q = P"
    40 
    41 definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
    42 "COMBB P Q R = P (Q R)"
    43 
    44 definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
    45 [no_atp]: "COMBC P Q R = P R Q"
    46 
    47 definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
    48 [no_atp]: "COMBS P Q R = P R (Q R)"
    49 
    50 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
    51 "fequal X Y \<longleftrightarrow> (X = Y)"
    52 
    53 lemma fequal_imp_equal [no_atp]: "\<not> fequal X Y \<or> X = Y"
    54 by (simp add: fequal_def)
    55 
    56 lemma equal_imp_fequal [no_atp]: "\<not> X = Y \<or> fequal X Y"
    57 by (simp add: fequal_def)
    58 
    59 lemma equal_imp_equal [no_atp]: "X = Y ==> X = Y"
    60 by auto
    61 
    62 lemma skolem_COMBK_iff: "P \<longleftrightarrow> skolem (COMBK P (i\<Colon>nat))"
    63 unfolding skolem_def COMBK_def by (rule refl)
    64 
    65 lemmas skolem_COMBK_I = iffD1 [OF skolem_COMBK_iff]
    66 lemmas skolem_COMBK_D = iffD2 [OF skolem_COMBK_iff]
    67 
    68 text{*Theorems for translation to combinators*}
    69 
    70 lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
    71 apply (rule eq_reflection)
    72 apply (rule ext) 
    73 apply (simp add: COMBS_def) 
    74 done
    75 
    76 lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
    77 apply (rule eq_reflection)
    78 apply (rule ext) 
    79 apply (simp add: COMBI_def) 
    80 done
    81 
    82 lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
    83 apply (rule eq_reflection)
    84 apply (rule ext) 
    85 apply (simp add: COMBK_def) 
    86 done
    87 
    88 lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
    89 apply (rule eq_reflection)
    90 apply (rule ext) 
    91 apply (simp add: COMBB_def) 
    92 done
    93 
    94 lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
    95 apply (rule eq_reflection)
    96 apply (rule ext) 
    97 apply (simp add: COMBC_def) 
    98 done
    99 
   100 use "Tools/ATP/atp_problem.ML"
   101 use "Tools/ATP/atp_proof.ML"
   102 use "Tools/ATP/atp_systems.ML"
   103 setup ATP_Systems.setup
   104 
   105 use "~~/src/Tools/Metis/metis.ML"
   106 use "Tools/Sledgehammer/metis_translate.ML"
   107 use "Tools/Sledgehammer/metis_reconstruct.ML"
   108 use "Tools/Sledgehammer/metis_tactics.ML"
   109 setup Metis_Tactics.setup
   110 
   111 use "Tools/Sledgehammer/sledgehammer_util.ML"
   112 use "Tools/Sledgehammer/sledgehammer_filter.ML"
   113 use "Tools/Sledgehammer/sledgehammer_translate.ML"
   114 use "Tools/Sledgehammer/sledgehammer_reconstruct.ML"
   115 use "Tools/Sledgehammer/sledgehammer.ML"
   116 setup Sledgehammer.setup
   117 use "Tools/Sledgehammer/sledgehammer_minimize.ML"
   118 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   119 setup Sledgehammer_Isar.setup
   120 
   121 end