src/HOL/Sledgehammer.thy
author blanchet
Thu Sep 16 16:24:23 2010 +0200 (2010-09-16)
changeset 39495 bb4fb9ffe2d1
parent 39494 bf7dd4902321
child 39720 0b93a954da4f
permissions -rw-r--r--
added new "Metis_Reconstruct" module, temporarily empty
     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_reconstruct.ML")
    21   ("Tools/Sledgehammer/metis_tactics.ML")
    22   ("Tools/Sledgehammer/sledgehammer_util.ML")
    23   ("Tools/Sledgehammer/sledgehammer_filter.ML")
    24   ("Tools/Sledgehammer/sledgehammer_translate.ML")
    25   ("Tools/Sledgehammer/sledgehammer_reconstruct.ML")
    26   ("Tools/Sledgehammer/sledgehammer.ML")
    27   ("Tools/Sledgehammer/sledgehammer_minimize.ML")
    28   ("Tools/Sledgehammer/sledgehammer_isar.ML")
    29 begin
    30 
    31 lemma TruepropI: "P \<equiv> Q \<Longrightarrow> Trueprop P \<equiv> Trueprop Q"
    32 by simp
    33 
    34 definition skolem :: "'a \<Rightarrow> 'a" where
    35 [no_atp]: "skolem = (\<lambda>x. x)"
    36 
    37 definition COMBI :: "'a \<Rightarrow> 'a" where
    38 [no_atp]: "COMBI P = P"
    39 
    40 definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
    41 [no_atp]: "COMBK P Q = P"
    42 
    43 definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
    44 "COMBB P Q R = P (Q R)"
    45 
    46 definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
    47 [no_atp]: "COMBC P Q R = P R Q"
    48 
    49 definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
    50 [no_atp]: "COMBS P Q R = P R (Q R)"
    51 
    52 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
    53 "fequal X Y \<longleftrightarrow> (X = Y)"
    54 
    55 lemma fequal_imp_equal [no_atp]: "\<not> fequal X Y \<or> X = Y"
    56 by (simp add: fequal_def)
    57 
    58 lemma equal_imp_fequal [no_atp]: "\<not> X = Y \<or> fequal X Y"
    59 by (simp add: fequal_def)
    60 
    61 lemma equal_imp_equal [no_atp]: "X = Y ==> X = Y"
    62 by auto
    63 
    64 text{*Theorems for translation to combinators*}
    65 
    66 lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
    67 apply (rule eq_reflection)
    68 apply (rule ext) 
    69 apply (simp add: COMBS_def) 
    70 done
    71 
    72 lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
    73 apply (rule eq_reflection)
    74 apply (rule ext) 
    75 apply (simp add: COMBI_def) 
    76 done
    77 
    78 lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
    79 apply (rule eq_reflection)
    80 apply (rule ext) 
    81 apply (simp add: COMBK_def) 
    82 done
    83 
    84 lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
    85 apply (rule eq_reflection)
    86 apply (rule ext) 
    87 apply (simp add: COMBB_def) 
    88 done
    89 
    90 lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
    91 apply (rule eq_reflection)
    92 apply (rule ext) 
    93 apply (simp add: COMBC_def) 
    94 done
    95 
    96 use "Tools/ATP/atp_problem.ML"
    97 use "Tools/ATP/atp_proof.ML"
    98 use "Tools/ATP/atp_systems.ML"
    99 setup ATP_Systems.setup
   100 
   101 use "~~/src/Tools/Metis/metis.ML"
   102 use "Tools/Sledgehammer/clausifier.ML"
   103 use "Tools/Sledgehammer/meson_tactic.ML"
   104 setup Meson_Tactic.setup
   105 
   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