author | blanchet |
Wed, 24 Mar 2010 12:31:37 +0100 | |
changeset 35967 | b9659daa5b4b |
parent 35867 | 16279c4c7a33 |
child 36062 | 194cb6e3c13f |
permissions | -rw-r--r-- |
35827 | 1 |
(* Title: HOL/Sledgehammer.thy |
21254
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 |
35865 | 4 |
Author: Fabian Immler, TU Muenchen |
5 |
Author: Jasmin Blanchette, TU Muenchen |
|
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
6 |
*) |
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
7 |
|
35827 | 8 |
header {* Sledgehammer: Isabelle--ATP Linkup *} |
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
9 |
|
35827 | 10 |
theory Sledgehammer |
33593 | 11 |
imports Plain Hilbert_Choice |
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
12 |
uses |
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
13 |
"Tools/polyhash.ML" |
35865 | 14 |
"~~/src/Tools/Metis/metis.ML" |
35967 | 15 |
"Tools/Sledgehammer/sledgehammer_util.ML" |
35865 | 16 |
("Tools/Sledgehammer/sledgehammer_fol_clause.ML") |
35825
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
17 |
("Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML") |
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
18 |
("Tools/Sledgehammer/sledgehammer_hol_clause.ML") |
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
19 |
("Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML") |
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
20 |
("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
|
21 |
("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
|
22 |
("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
|
23 |
("Tools/ATP_Manager/atp_minimal.ML") |
35866
513074557e06
move the Sledgehammer Isar commands together into one file;
blanchet
parents:
35865
diff
changeset
|
24 |
("Tools/Sledgehammer/sledgehammer_isar.ML") |
35865 | 25 |
("Tools/Sledgehammer/meson_tactic.ML") |
35825
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
26 |
("Tools/Sledgehammer/metis_tactics.ML") |
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
27 |
begin |
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
28 |
|
35865 | 29 |
definition COMBI :: "'a \<Rightarrow> 'a" |
30 |
where "COMBI P \<equiv> P" |
|
24819 | 31 |
|
35865 | 32 |
definition COMBK :: "'a \<Rightarrow> 'b \<Rightarrow> 'a" |
33 |
where "COMBK P Q \<equiv> P" |
|
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
34 |
|
35865 | 35 |
definition COMBB :: "('b => 'c) \<Rightarrow> ('a => 'b) \<Rightarrow> 'a \<Rightarrow> 'c" |
36 |
where "COMBB P Q R \<equiv> P (Q R)" |
|
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
37 |
|
35865 | 38 |
definition COMBC :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" |
39 |
where "COMBC P Q R \<equiv> P R Q" |
|
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
40 |
|
35865 | 41 |
definition COMBS :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" |
42 |
where "COMBS P Q R \<equiv> P R (Q R)" |
|
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
43 |
|
35865 | 44 |
definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" |
45 |
where "fequal X Y \<equiv> (X = Y)" |
|
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
46 |
|
35865 | 47 |
lemma fequal_imp_equal: "fequal X Y \<Longrightarrow> X = Y" |
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
48 |
by (simp add: fequal_def) |
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
49 |
|
35865 | 50 |
lemma equal_imp_fequal: "X = Y \<Longrightarrow> fequal X Y" |
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
51 |
by (simp add: fequal_def) |
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 |
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
|
54 |
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
|
55 |
expanded...*} |
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
56 |
|
35865 | 57 |
lemma iff_positive: "P \<or> Q \<or> P = Q" |
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
58 |
by blast |
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
59 |
|
35865 | 60 |
lemma iff_negative: "\<not> P \<or> \<not> Q \<or> P = Q" |
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
61 |
by blast |
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
62 |
|
24827 | 63 |
text{*Theorems for translation to combinators*} |
64 |
||
35865 | 65 |
lemma abs_S: "\<lambda>x. (f x) (g x) \<equiv> COMBS f g" |
24827 | 66 |
apply (rule eq_reflection) |
67 |
apply (rule ext) |
|
68 |
apply (simp add: COMBS_def) |
|
69 |
done |
|
70 |
||
35865 | 71 |
lemma abs_I: "\<lambda>x. x \<equiv> COMBI" |
24827 | 72 |
apply (rule eq_reflection) |
73 |
apply (rule ext) |
|
74 |
apply (simp add: COMBI_def) |
|
75 |
done |
|
76 |
||
35865 | 77 |
lemma abs_K: "\<lambda>x. y \<equiv> COMBK y" |
24827 | 78 |
apply (rule eq_reflection) |
79 |
apply (rule ext) |
|
80 |
apply (simp add: COMBK_def) |
|
81 |
done |
|
82 |
||
35865 | 83 |
lemma abs_B: "\<lambda>x. a (g x) \<equiv> COMBB a g" |
24827 | 84 |
apply (rule eq_reflection) |
85 |
apply (rule ext) |
|
86 |
apply (simp add: COMBB_def) |
|
87 |
done |
|
88 |
||
35865 | 89 |
lemma abs_C: "\<lambda>x. (f x) b \<equiv> COMBC f b" |
24827 | 90 |
apply (rule eq_reflection) |
91 |
apply (rule ext) |
|
92 |
apply (simp add: COMBC_def) |
|
93 |
done |
|
94 |
||
35866
513074557e06
move the Sledgehammer Isar commands together into one file;
blanchet
parents:
35865
diff
changeset
|
95 |
|
28585 | 96 |
subsection {* Setup of external ATPs *} |
27368 | 97 |
|
35865 | 98 |
use "Tools/Sledgehammer/sledgehammer_fol_clause.ML" |
35825
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
99 |
use "Tools/Sledgehammer/sledgehammer_fact_preprocessor.ML" |
35826 | 100 |
setup Sledgehammer_Fact_Preprocessor.setup |
35825
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
101 |
use "Tools/Sledgehammer/sledgehammer_hol_clause.ML" |
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
102 |
use "Tools/Sledgehammer/sledgehammer_proof_reconstruct.ML" |
35826 | 103 |
setup Sledgehammer_Proof_Reconstruct.setup |
35825
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
104 |
use "Tools/Sledgehammer/sledgehammer_fact_filter.ML" |
35867 | 105 |
use "Tools/ATP_Manager/atp_manager.ML" |
35825
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
106 |
use "Tools/ATP_Manager/atp_wrapper.ML" |
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
107 |
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
|
108 |
use "Tools/ATP_Manager/atp_minimal.ML" |
35866
513074557e06
move the Sledgehammer Isar commands together into one file;
blanchet
parents:
35865
diff
changeset
|
109 |
use "Tools/Sledgehammer/sledgehammer_isar.ML" |
513074557e06
move the Sledgehammer Isar commands together into one file;
blanchet
parents:
35865
diff
changeset
|
110 |
|
35865 | 111 |
|
112 |
subsection {* The MESON prover *} |
|
113 |
||
114 |
use "Tools/Sledgehammer/meson_tactic.ML" |
|
115 |
setup Meson_Tactic.setup |
|
28573 | 116 |
|
23444 | 117 |
|
118 |
subsection {* The Metis prover *} |
|
119 |
||
35825
a6aad5a70ed4
move Sledgehammer files in a directory of their own
blanchet
parents:
33593
diff
changeset
|
120 |
use "Tools/Sledgehammer/metis_tactics.ML" |
35826 | 121 |
setup Metis_Tactics.setup |
23444 | 122 |
|
21254
d53f76357f41
incorporated former theories Reconstruction and ResAtpMethods into ATP_Linkup;
wenzelm
parents:
diff
changeset
|
123 |
end |