src/HOL/Sledgehammer.thy
author blanchet
Thu Sep 02 11:29:02 2010 +0200 (2010-09-02)
changeset 39036 dff91b90d74c
parent 38990 7fba3ccc755a
child 39322 80420a0f2179
permissions -rw-r--r--
use definitional CNFs in Metis rather than plain CNF, following a suggestion by Joe Hurd;
this *really* speeds up things -- HOL now builds 12% faster on my machine
     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_systems.ML")
    15   ("~~/src/Tools/Metis/metis.ML")
    16   ("Tools/Sledgehammer/clausifier.ML")
    17   ("Tools/Sledgehammer/meson_tactic.ML")
    18   ("Tools/Sledgehammer/metis_clauses.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_id :: "'a \<Rightarrow> 'a" where
    33 [no_atp]: "skolem_id = (\<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 text{*Theorems for translation to combinators*}
    63 
    64 lemma abs_S [no_atp]: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g"
    65 apply (rule eq_reflection)
    66 apply (rule ext) 
    67 apply (simp add: COMBS_def) 
    68 done
    69 
    70 lemma abs_I [no_atp]: "\<lambda>x. x \<equiv> COMBI"
    71 apply (rule eq_reflection)
    72 apply (rule ext) 
    73 apply (simp add: COMBI_def) 
    74 done
    75 
    76 lemma abs_K [no_atp]: "\<lambda>x. y \<equiv> COMBK y"
    77 apply (rule eq_reflection)
    78 apply (rule ext) 
    79 apply (simp add: COMBK_def) 
    80 done
    81 
    82 lemma abs_B [no_atp]: "\<lambda>x. a (g x) \<equiv> COMBB a g"
    83 apply (rule eq_reflection)
    84 apply (rule ext) 
    85 apply (simp add: COMBB_def) 
    86 done
    87 
    88 lemma abs_C [no_atp]: "\<lambda>x. (f x) b \<equiv> COMBC f b"
    89 apply (rule eq_reflection)
    90 apply (rule ext) 
    91 apply (simp add: COMBC_def) 
    92 done
    93 
    94 use "Tools/ATP/atp_problem.ML"
    95 use "Tools/ATP/atp_systems.ML"
    96 setup ATP_Systems.setup
    97 
    98 use "~~/src/Tools/Metis/metis.ML"
    99 use "Tools/Sledgehammer/clausifier.ML"
   100 use "Tools/Sledgehammer/meson_tactic.ML"
   101 setup Meson_Tactic.setup
   102 
   103 use "Tools/Sledgehammer/metis_clauses.ML"
   104 use "Tools/Sledgehammer/metis_tactics.ML"
   105 
   106 use "Tools/Sledgehammer/sledgehammer_util.ML"
   107 use "Tools/Sledgehammer/sledgehammer_filter.ML"
   108 use "Tools/Sledgehammer/sledgehammer_translate.ML"
   109 use "Tools/Sledgehammer/sledgehammer_reconstruct.ML"
   110 use "Tools/Sledgehammer/sledgehammer.ML"
   111 setup Sledgehammer.setup
   112 use "Tools/Sledgehammer/sledgehammer_minimize.ML"
   113 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   114 setup Metis_Tactics.setup
   115 
   116 end