src/HOL/Sledgehammer.thy
author blanchet
Mon Aug 09 12:05:48 2010 +0200 (2010-08-09)
changeset 38282 319c59682c51
parent 38047 9033c03cc214
child 38606 3003ddbd46d9
permissions -rw-r--r--
move Sledgehammer's HOL -> FOL translation to separate file (sledgehammer_translate.ML)
     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/async_manager.ML")
    14   ("Tools/ATP/atp_problem.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_clauses.ML")
    20   ("Tools/Sledgehammer/metis_tactics.ML")
    21   ("Tools/Sledgehammer/sledgehammer_util.ML")
    22   ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
    23   ("Tools/Sledgehammer/sledgehammer_translate.ML")
    24   ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
    25   ("Tools/Sledgehammer/sledgehammer.ML")
    26   ("Tools/Sledgehammer/sledgehammer_fact_minimize.ML")
    27   ("Tools/Sledgehammer/sledgehammer_isar.ML")
    28 begin
    29 
    30 definition skolem_id :: "'a \<Rightarrow> 'a" where
    31 [no_atp]: "skolem_id = (\<lambda>x. x)"
    32 
    33 definition COMBI :: "'a \<Rightarrow> 'a" where
    34 [no_atp]: "COMBI P \<equiv> P"
    35 
    36 definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" where
    37 [no_atp]: "COMBK P Q \<equiv> P"
    38 
    39 definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where [no_atp]:
    40 "COMBB P Q R \<equiv> P (Q R)"
    41 
    42 definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
    43 [no_atp]: "COMBC P Q R \<equiv> P R Q"
    44 
    45 definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" where
    46 [no_atp]: "COMBS P Q R \<equiv> P R (Q R)"
    47 
    48 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
    49 "fequal X Y \<equiv> (X = Y)"
    50 
    51 lemma fequal_imp_equal [no_atp]: "fequal X Y \<Longrightarrow> X = Y"
    52   by (simp add: fequal_def)
    53 
    54 lemma equal_imp_fequal [no_atp]: "X = Y \<Longrightarrow> fequal X Y"
    55   by (simp add: fequal_def)
    56 
    57 text{*Theorems for translation to combinators*}
    58 
    59 lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
    60 apply (rule eq_reflection)
    61 apply (rule ext) 
    62 apply (simp add: COMBS_def) 
    63 done
    64 
    65 lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
    66 apply (rule eq_reflection)
    67 apply (rule ext) 
    68 apply (simp add: COMBI_def) 
    69 done
    70 
    71 lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
    72 apply (rule eq_reflection)
    73 apply (rule ext) 
    74 apply (simp add: COMBK_def) 
    75 done
    76 
    77 lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
    78 apply (rule eq_reflection)
    79 apply (rule ext) 
    80 apply (simp add: COMBB_def) 
    81 done
    82 
    83 lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
    84 apply (rule eq_reflection)
    85 apply (rule ext) 
    86 apply (simp add: COMBC_def) 
    87 done
    88 
    89 use "Tools/ATP/async_manager.ML"
    90 use "Tools/ATP/atp_problem.ML"
    91 use "Tools/ATP/atp_systems.ML"
    92 setup ATP_Systems.setup
    93 
    94 use "~~/src/Tools/Metis/metis.ML"
    95 use "Tools/Sledgehammer/clausifier.ML"
    96 use "Tools/Sledgehammer/meson_tactic.ML"
    97 setup Meson_Tactic.setup
    98 
    99 use "Tools/Sledgehammer/metis_clauses.ML"
   100 use "Tools/Sledgehammer/metis_tactics.ML"
   101 
   102 use "Tools/Sledgehammer/sledgehammer_util.ML"
   103 use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
   104 use "Tools/Sledgehammer/sledgehammer_translate.ML"
   105 use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
   106 use "Tools/Sledgehammer/sledgehammer.ML"
   107 setup Sledgehammer.setup
   108 use "Tools/Sledgehammer/sledgehammer_fact_minimize.ML"
   109 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   110 setup Metis_Tactics.setup
   111 
   112 end