src/HOL/ATP_Linkup.thy
author blanchet
Wed, 17 Mar 2010 19:26:05 +0100
changeset 35826 1590abc3d42a
parent 35825 a6aad5a70ed4
permissions -rw-r--r--
renamed Sledgehammer structures
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     1
(*  Title:      HOL/ATP_Linkup.thy
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     2
    Author:     Lawrence C Paulson
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     3
    Author:     Jia Meng, NICTA
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
     4
    Author:     Fabian Immler, TUM
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     5
*)
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     6
28477
9339d4dcec8b version of sledgehammer using threads instead of processes, misc cleanup;
wenzelm
parents: 28476
diff changeset
     7
header {* The Isabelle-ATP Linkup *}
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     8
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
     9
theory ATP_Linkup
33593
ef54e2108b74 tuned imports
haftmann
parents: 33316
diff changeset
    10
imports Plain Hilbert_Choice
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    11
uses
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    12
  "Tools/polyhash.ML"
35825
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    13
  "Tools/Sledgehammer/sledgehammer_fol_clause.ML"
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    14
  ("Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML")
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    15
  ("Tools/Sledgehammer/sledgehammer_hol_clause.ML")
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    16
  ("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML")
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    17
  ("Tools/Sledgehammer/sledgehammer_fact_filter.ML")
32327
0971cc0b6a57 src/HOL/Tools/ATP_Manager as separate component, with (almost) everything in one place;
wenzelm
parents: 31835
diff changeset
    18
  ("Tools/ATP_Manager/atp_manager.ML")
0971cc0b6a57 src/HOL/Tools/ATP_Manager as separate component, with (almost) everything in one place;
wenzelm
parents: 31835
diff changeset
    19
  ("Tools/ATP_Manager/atp_wrapper.ML")
0971cc0b6a57 src/HOL/Tools/ATP_Manager as separate component, with (almost) everything in one place;
wenzelm
parents: 31835
diff changeset
    20
  ("Tools/ATP_Manager/atp_minimal.ML")
23444
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
    21
  "~~/src/Tools/Metis/metis.ML"
35825
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    22
  ("Tools/Sledgehammer/metis_tactics.ML")
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    23
begin
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    24
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    25
definition COMBI :: "'a => 'a"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    26
  where "COMBI P == P"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    27
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    28
definition COMBK :: "'a => 'b => 'a"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    29
  where "COMBK P Q == P"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    30
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    31
definition COMBB :: "('b => 'c) => ('a => 'b) => 'a => 'c"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    32
  where "COMBB P Q R == P (Q R)"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    33
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    34
definition COMBC :: "('a => 'b => 'c) => 'b => 'a => 'c"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    35
  where "COMBC P Q R == P R Q"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    36
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    37
definition COMBS :: "('a => 'b => 'c) => ('a => 'b) => 'a => 'c"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    38
  where "COMBS P Q R == P R (Q R)"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    39
24819
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    40
definition fequal :: "'a => 'a => bool"
7d8e0a47392e modernized definitions;
wenzelm
parents: 24742
diff changeset
    41
  where "fequal X Y == (X=Y)"
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    42
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    43
lemma fequal_imp_equal: "fequal X Y ==> X=Y"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    44
  by (simp add: fequal_def)
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    45
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    46
lemma equal_imp_fequal: "X=Y ==> fequal X Y"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    47
  by (simp add: fequal_def)
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    48
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    49
text{*These two represent the equivalence between Boolean equality and iff.
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    50
They can't be converted to clauses automatically, as the iff would be
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    51
expanded...*}
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    52
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    53
lemma iff_positive: "P | Q | P=Q"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    54
by blast
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    55
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    56
lemma iff_negative: "~P | ~Q | P=Q"
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    57
by blast
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
    58
24827
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    59
text{*Theorems for translation to combinators*}
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    60
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    61
lemma abs_S: "(%x. (f x) (g x)) == COMBS f g"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    62
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    63
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    64
apply (simp add: COMBS_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    65
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    66
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    67
lemma abs_I: "(%x. x) == COMBI"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    68
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    69
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    70
apply (simp add: COMBI_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    71
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    72
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    73
lemma abs_K: "(%x. y) == COMBK y"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    74
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    75
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    76
apply (simp add: COMBK_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    77
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    78
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    79
lemma abs_B: "(%x. a (g x)) == COMBB a g"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    80
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    81
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    82
apply (simp add: COMBB_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    83
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    84
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    85
lemma abs_C: "(%x. (f x) b) == COMBC f b"
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    86
apply (rule eq_reflection)
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    87
apply (rule ext) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    88
apply (simp add: COMBC_def) 
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    89
done
646bdc51eb7d combinator translation
paulson
parents: 24819
diff changeset
    90
27368
9f90ac19e32b established Plain theory and image
haftmann
parents: 27182
diff changeset
    91
28585
be3c44ac3e86 tuned comments;
wenzelm
parents: 28573
diff changeset
    92
subsection {* Setup of external ATPs *}
27368
9f90ac19e32b established Plain theory and image
haftmann
parents: 27182
diff changeset
    93
35825
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    94
use "Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML"
35826
1590abc3d42a renamed Sledgehammer structures
blanchet
parents: 35825
diff changeset
    95
setup Sledgehammer_Fact_Preprocessor.setup
35825
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    96
use "Tools/Sledgehammer/sledgehammer_hol_clause.ML"
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    97
use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML"
35826
1590abc3d42a renamed Sledgehammer structures
blanchet
parents: 35825
diff changeset
    98
setup Sledgehammer_Proof_Reconstruct.setup
35825
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
    99
use "Tools/Sledgehammer/sledgehammer_fact_filter.ML"
28573
6403f0e16269 ** Update from Fabian **
wenzelm
parents: 28483
diff changeset
   100
35825
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
   101
use "Tools/ATP_Manager/atp_wrapper.ML"
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
   102
setup ATP_Wrapper.setup
32327
0971cc0b6a57 src/HOL/Tools/ATP_Manager as separate component, with (almost) everything in one place;
wenzelm
parents: 31835
diff changeset
   103
use "Tools/ATP_Manager/atp_manager.ML"
0971cc0b6a57 src/HOL/Tools/ATP_Manager as separate component, with (almost) everything in one place;
wenzelm
parents: 31835
diff changeset
   104
use "Tools/ATP_Manager/atp_minimal.ML"
31037
ac8669134e7a added Philipp Meyer's implementation of AtpMinimal
immler@in.tum.de
parents: 29654
diff changeset
   105
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   106
text {* basic provers *}
32936
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   107
setup {* ATP_Manager.add_prover ATP_Wrapper.spass *}
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   108
setup {* ATP_Manager.add_prover ATP_Wrapper.vampire *}
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   109
setup {* ATP_Manager.add_prover ATP_Wrapper.eprover *}
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   110
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   111
text {* provers with stuctured output *}
32936
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   112
setup {* ATP_Manager.add_prover ATP_Wrapper.vampire_full *}
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   113
setup {* ATP_Manager.add_prover ATP_Wrapper.eprover_full *}
28483
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   114
9912ab2992f6 perform atp_setups here;
wenzelm
parents: 28477
diff changeset
   115
text {* on some problems better results *}
32936
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   116
setup {* ATP_Manager.add_prover ATP_Wrapper.spass_no_tc *}
27182
9e4475b9d58c tuned setup;
wenzelm
parents: 26729
diff changeset
   117
28573
6403f0e16269 ** Update from Fabian **
wenzelm
parents: 28483
diff changeset
   118
text {* remote provers via SystemOnTPTP *}
32936
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   119
setup {* ATP_Manager.add_prover ATP_Wrapper.remote_vampire *}
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   120
setup {* ATP_Manager.add_prover ATP_Wrapper.remote_spass *}
9491bec20595 modernized structure names;
wenzelm
parents: 32864
diff changeset
   121
setup {* ATP_Manager.add_prover ATP_Wrapper.remote_eprover *}
29587
96599d8d8268 simplified usage of remote-script; added compatible remote-atps
immler@in.tum.de
parents: 28594
diff changeset
   122
  
28573
6403f0e16269 ** Update from Fabian **
wenzelm
parents: 28483
diff changeset
   123
23444
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   124
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   125
subsection {* The Metis prover *}
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   126
35825
a6aad5a70ed4 move Sledgehammer files in a directory of their own
blanchet
parents: 33593
diff changeset
   127
use "Tools/Sledgehammer/metis_tactics.ML"
35826
1590abc3d42a renamed Sledgehammer structures
blanchet
parents: 35825
diff changeset
   128
setup Metis_Tactics.setup
23444
6d4703843f93 added Metis setup (from Metis.thy);
wenzelm
parents: 21999
diff changeset
   129
21254
d53f76357f41 incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff changeset
   130
end