src/HOL/Sledgehammer.thy
author blanchet
Fri Mar 19 15:33:18 2010 +0100 (2010-03-19)
changeset 35867 16279c4c7a33
parent 35866 513074557e06
child 35967 b9659daa5b4b
permissions -rw-r--r--
move all ATP setup code into ATP_Wrapper
     1 (*  Title:      HOL/Sledgehammer.thy
     2     Author:     Lawrence C Paulson
     3     Author:     Jia Meng, 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/polyhash.ML"
    14   "~~/src/Tools/Metis/metis.ML"
    15   ("Tools/Sledgehammer/sledgehammer_fol_clause.ML")
    16   ("Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML")
    17   ("Tools/Sledgehammer/sledgehammer_hol_clause.ML")
    18   ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
    19   ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
    20   ("Tools/ATP_Manager/atp_manager.ML")
    21   ("Tools/ATP_Manager/atp_wrapper.ML")
    22   ("Tools/ATP_Manager/atp_minimal.ML")
    23   ("Tools/Sledgehammer/sledgehammer_isar.ML")
    24   ("Tools/Sledgehammer/meson_tactic.ML")
    25   ("Tools/Sledgehammer/metis_tactics.ML")
    26 begin
    27 
    28 definition COMBI :: "'a \<Rightarrow> 'a"
    29   where "COMBI P \<equiv> P"
    30 
    31 definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a"
    32   where "COMBK P Q \<equiv> P"
    33 
    34 definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c"
    35   where "COMBB P Q R \<equiv> P (Q R)"
    36 
    37 definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c"
    38   where "COMBC P Q R \<equiv> P R Q"
    39 
    40 definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c"
    41   where "COMBS P Q R \<equiv> P R (Q R)"
    42 
    43 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
    44   where "fequal X Y \<equiv> (X = Y)"
    45 
    46 lemma fequal_imp_equal: "fequal X Y \<Longrightarrow> X = Y"
    47   by (simp add: fequal_def)
    48 
    49 lemma equal_imp_fequal: "X = Y \<Longrightarrow> fequal X Y"
    50   by (simp add: fequal_def)
    51 
    52 text{*These two represent the equivalence between Boolean equality and iff.
    53 They can't be converted to clauses automatically, as the iff would be
    54 expanded...*}
    55 
    56 lemma iff_positive: "P \<or> Q \<or> P = Q"
    57 by blast
    58 
    59 lemma iff_negative: "\<not> P \<or> \<not> Q \<or> P = Q"
    60 by blast
    61 
    62 text{*Theorems for translation to combinators*}
    63 
    64 lemma abs_S: "\<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: "\<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: "\<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: "\<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: "\<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 
    95 subsection {* Setup of external ATPs *}
    96 
    97 use "Tools/Sledgehammer/sledgehammer_fol_clause.ML"
    98 use "Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML"
    99 setup Sledgehammer_Fact_Preprocessor.setup
   100 use "Tools/Sledgehammer/sledgehammer_hol_clause.ML"
   101 use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
   102 setup Sledgehammer_Proof_Reconstruct.setup
   103 use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
   104 use "Tools/ATP_Manager/atp_manager.ML"
   105 use "Tools/ATP_Manager/atp_wrapper.ML"
   106 setup ATP_Wrapper.setup
   107 use "Tools/ATP_Manager/atp_minimal.ML"
   108 use "Tools/Sledgehammer/sledgehammer_isar.ML"
   109 
   110 
   111 subsection {* The MESON prover *}
   112 
   113 use "Tools/Sledgehammer/meson_tactic.ML"
   114 setup Meson_Tactic.setup
   115 
   116 
   117 subsection {* The Metis prover *}
   118 
   119 use "Tools/Sledgehammer/metis_tactics.ML"
   120 setup Metis_Tactics.setup
   121 
   122 end