src/HOL/Sledgehammer.thy
author blanchet
Wed Mar 17 19:37:44 2010 +0100 (2010-03-17)
changeset 35827 f552152d7747
parent 35826 src/HOL/ATP_Linkup.thy@1590abc3d42a
child 35865 2f8fb5242799
permissions -rw-r--r--
renamed "ATP_Linkup" theory to "Sledgehammer"
     1 (*  Title:      HOL/Sledgehammer.thy
     2     Author:     Lawrence C Paulson
     3     Author:     Jia Meng, NICTA
     4     Author:     Fabian Immler, TUM
     5 *)
     6 
     7 header {* Sledgehammer: Isabelle--ATP Linkup *}
     8 
     9 theory Sledgehammer
    10 imports Plain Hilbert_Choice
    11 uses
    12   "Tools/polyhash.ML"
    13   "Tools/Sledgehammer/sledgehammer_fol_clause.ML"
    14   ("Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML")
    15   ("Tools/Sledgehammer/sledgehammer_hol_clause.ML")
    16   ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
    17   ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
    18   ("Tools/ATP_Manager/atp_manager.ML")
    19   ("Tools/ATP_Manager/atp_wrapper.ML")
    20   ("Tools/ATP_Manager/atp_minimal.ML")
    21   "~~/src/Tools/Metis/metis.ML"
    22   ("Tools/Sledgehammer/metis_tactics.ML")
    23 begin
    24 
    25 definition COMBI :: "'a => 'a"
    26   where "COMBI P == P"
    27 
    28 definition COMBK :: "'a => 'b => 'a"
    29   where "COMBK P Q == P"
    30 
    31 definition COMBB :: "('b => 'c) => ('a => 'b) => 'a => 'c"
    32   where "COMBB P Q R == P (Q R)"
    33 
    34 definition COMBC :: "('a => 'b => 'c) => 'b => 'a => 'c"
    35   where "COMBC P Q R == P R Q"
    36 
    37 definition COMBS :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c"
    38   where "COMBS P Q R == P R (Q R)"
    39 
    40 definition fequal :: "'a => 'a => bool"
    41   where "fequal X Y == (X=Y)"
    42 
    43 lemma fequal_imp_equal: "fequal X Y ==> X=Y"
    44   by (simp add: fequal_def)
    45 
    46 lemma equal_imp_fequal: "X=Y ==> fequal X Y"
    47   by (simp add: fequal_def)
    48 
    49 text{*These two represent the equivalence between Boolean equality and iff.
    50 They can't be converted to clauses automatically, as the iff would be
    51 expanded...*}
    52 
    53 lemma iff_positive: "P | Q | P=Q"
    54 by blast
    55 
    56 lemma iff_negative: "~P | ~Q | P=Q"
    57 by blast
    58 
    59 text{*Theorems for translation to combinators*}
    60 
    61 lemma abs_S: "(%x. (f x) (g x)) == COMBS f g"
    62 apply (rule eq_reflection)
    63 apply (rule ext) 
    64 apply (simp add: COMBS_def) 
    65 done
    66 
    67 lemma abs_I: "(%x. x) == COMBI"
    68 apply (rule eq_reflection)
    69 apply (rule ext) 
    70 apply (simp add: COMBI_def) 
    71 done
    72 
    73 lemma abs_K: "(%x. y) == COMBK y"
    74 apply (rule eq_reflection)
    75 apply (rule ext) 
    76 apply (simp add: COMBK_def) 
    77 done
    78 
    79 lemma abs_B: "(%x. a (g x)) == COMBB a g"
    80 apply (rule eq_reflection)
    81 apply (rule ext) 
    82 apply (simp add: COMBB_def) 
    83 done
    84 
    85 lemma abs_C: "(%x. (f x) b) == COMBC f b"
    86 apply (rule eq_reflection)
    87 apply (rule ext) 
    88 apply (simp add: COMBC_def) 
    89 done
    90 
    91 
    92 subsection {* Setup of external ATPs *}
    93 
    94 use "Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML"
    95 setup Sledgehammer_Fact_Preprocessor.setup
    96 use "Tools/Sledgehammer/sledgehammer_hol_clause.ML"
    97 use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
    98 setup Sledgehammer_Proof_Reconstruct.setup
    99 use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
   100 
   101 use "Tools/ATP_Manager/atp_wrapper.ML"
   102 setup ATP_Wrapper.setup
   103 use "Tools/ATP_Manager/atp_manager.ML"
   104 use "Tools/ATP_Manager/atp_minimal.ML"
   105 
   106 text {* basic provers *}
   107 setup {* ATP_Manager.add_prover ATP_Wrapper.spass *}
   108 setup {* ATP_Manager.add_prover ATP_Wrapper.vampire *}
   109 setup {* ATP_Manager.add_prover ATP_Wrapper.eprover *}
   110 
   111 text {* provers with stuctured output *}
   112 setup {* ATP_Manager.add_prover ATP_Wrapper.vampire_full *}
   113 setup {* ATP_Manager.add_prover ATP_Wrapper.eprover_full *}
   114 
   115 text {* on some problems better results *}
   116 setup {* ATP_Manager.add_prover ATP_Wrapper.spass_no_tc *}
   117 
   118 text {* remote provers via SystemOnTPTP *}
   119 setup {* ATP_Manager.add_prover ATP_Wrapper.remote_vampire *}
   120 setup {* ATP_Manager.add_prover ATP_Wrapper.remote_spass *}
   121 setup {* ATP_Manager.add_prover ATP_Wrapper.remote_eprover *}
   122   
   123 
   124 
   125 subsection {* The Metis prover *}
   126 
   127 use "Tools/Sledgehammer/metis_tactics.ML"
   128 setup Metis_Tactics.setup
   129 
   130 end