blanchet@49249
|
1 |
(* Title: HOL/TPTP/MaSh_Export.thy
|
blanchet@49249
|
2 |
Author: Jasmin Blanchette, TU Muenchen
|
blanchet@49249
|
3 |
*)
|
blanchet@49249
|
4 |
|
blanchet@49249
|
5 |
header {* MaSh Exporter *}
|
blanchet@49249
|
6 |
|
blanchet@49249
|
7 |
theory MaSh_Export
|
blanchet@51365
|
8 |
imports Main
|
blanchet@49249
|
9 |
begin
|
blanchet@49249
|
10 |
|
wenzelm@49906
|
11 |
ML_file "mash_export.ML"
|
wenzelm@49906
|
12 |
|
blanchet@49260
|
13 |
sledgehammer_params
|
blanchet@51534
|
14 |
[provers = spass, max_facts = 32, strict, dont_slice, type_enc = mono_native,
|
blanchet@51940
|
15 |
lam_trans = lifting, timeout = 2, dont_preplay, minimize]
|
blanchet@49254
|
16 |
|
blanchet@51940
|
17 |
declare [[sledgehammer_instantiate_inducts = false]]
|
blanchet@51449
|
18 |
|
blanchet@52209
|
19 |
hide_fact (open) HOL.ext
|
blanchet@52209
|
20 |
|
blanchet@49249
|
21 |
ML {*
|
wenzelm@56059
|
22 |
Multithreading.max_threads_value ()
|
blanchet@51534
|
23 |
*}
|
blanchet@51534
|
24 |
|
blanchet@51534
|
25 |
ML {*
|
blanchet@49249
|
26 |
open MaSh_Export
|
blanchet@49249
|
27 |
*}
|
blanchet@49249
|
28 |
|
blanchet@49249
|
29 |
ML {*
|
blanchet@58464
|
30 |
val do_it = false (* switch to "true" to generate the files *)
|
blanchet@51365
|
31 |
val thys = [@{theory List}]
|
blanchet@56550
|
32 |
val params as {provers, ...} = Sledgehammer_Commands.default_params @{theory} []
|
blanchet@49348
|
33 |
val prover = hd provers
|
blanchet@58464
|
34 |
val range = (1, NONE)
|
blanchet@51969
|
35 |
val step = 1
|
blanchet@51979
|
36 |
val max_suggestions = 1024
|
blanchet@51528
|
37 |
val dir = "List"
|
blanchet@51364
|
38 |
val prefix = "/tmp/" ^ dir ^ "/"
|
blanchet@51352
|
39 |
*}
|
blanchet@51352
|
40 |
|
blanchet@51352
|
41 |
ML {*
|
blanchet@51365
|
42 |
if do_it then
|
blanchet@51365
|
43 |
Isabelle_System.mkdir (Path.explode prefix)
|
blanchet@51365
|
44 |
else
|
blanchet@51365
|
45 |
()
|
blanchet@49261
|
46 |
*}
|
blanchet@49546
|
47 |
|
blanchet@58463
|
48 |
ML {* Options.put_default @{system_option MaSh} "sml_nb" *}
|
blanchet@58462
|
49 |
|
blanchet@49261
|
50 |
ML {*
|
blanchet@49260
|
51 |
if do_it then
|
blanchet@58463
|
52 |
generate_mash_suggestions @{context} params (range, step) thys max_suggestions
|
blanchet@58464
|
53 |
(prefix ^ "mash_sml_nb_suggestions")
|
blanchet@58462
|
54 |
else
|
blanchet@58462
|
55 |
()
|
blanchet@58462
|
56 |
*}
|
blanchet@58462
|
57 |
|
blanchet@58463
|
58 |
ML {* Options.put_default @{system_option MaSh} "sml_knn" *}
|
blanchet@58462
|
59 |
|
blanchet@58462
|
60 |
ML {*
|
blanchet@58462
|
61 |
if do_it then
|
blanchet@58464
|
62 |
generate_mash_suggestions @{context} params (range, step) thys max_suggestions
|
blanchet@58464
|
63 |
(prefix ^ "mash_sml_knn_suggestions")
|
blanchet@58462
|
64 |
else
|
blanchet@58462
|
65 |
()
|
blanchet@58462
|
66 |
*}
|
blanchet@58462
|
67 |
|
blanchet@58462
|
68 |
ML {* Options.put_default @{system_option MaSh} "py" *}
|
blanchet@58462
|
69 |
|
blanchet@58462
|
70 |
ML {*
|
blanchet@58462
|
71 |
if do_it then
|
blanchet@58464
|
72 |
generate_mash_suggestions @{context} params (range, step) thys max_suggestions
|
blanchet@58464
|
73 |
(prefix ^ "mash_py_suggestions")
|
blanchet@58462
|
74 |
else
|
blanchet@58462
|
75 |
()
|
blanchet@58462
|
76 |
*}
|
blanchet@58462
|
77 |
|
blanchet@58462
|
78 |
ML {*
|
blanchet@58462
|
79 |
if do_it then
|
blanchet@58463
|
80 |
generate_accessibility @{context} thys (prefix ^ "mash_accessibility")
|
blanchet@49260
|
81 |
else
|
blanchet@49260
|
82 |
()
|
blanchet@49249
|
83 |
*}
|
blanchet@49249
|
84 |
|
blanchet@49249
|
85 |
ML {*
|
blanchet@49260
|
86 |
if do_it then
|
blanchet@56554
|
87 |
generate_features @{context} thys (prefix ^ "mash_features")
|
blanchet@49260
|
88 |
else
|
blanchet@49260
|
89 |
()
|
blanchet@49249
|
90 |
*}
|
blanchet@49249
|
91 |
|
blanchet@49249
|
92 |
ML {*
|
blanchet@49260
|
93 |
if do_it then
|
blanchet@58463
|
94 |
generate_isar_dependencies @{context} range thys (prefix ^ "mash_dependencies")
|
blanchet@49348
|
95 |
else
|
blanchet@49348
|
96 |
()
|
blanchet@49348
|
97 |
*}
|
blanchet@49348
|
98 |
|
blanchet@49348
|
99 |
ML {*
|
blanchet@49348
|
100 |
if do_it then
|
blanchet@58463
|
101 |
generate_isar_commands @{context} prover (range, step) thys max_suggestions
|
blanchet@58462
|
102 |
(prefix ^ "mash_commands")
|
blanchet@49348
|
103 |
else
|
blanchet@49348
|
104 |
()
|
blanchet@49348
|
105 |
*}
|
blanchet@49348
|
106 |
|
blanchet@49348
|
107 |
ML {*
|
blanchet@51831
|
108 |
if do_it then
|
blanchet@58463
|
109 |
generate_mepo_suggestions @{context} params (range, step) thys max_suggestions
|
blanchet@58462
|
110 |
(prefix ^ "mepo_suggestions")
|
blanchet@51829
|
111 |
else
|
blanchet@51829
|
112 |
()
|
blanchet@51829
|
113 |
*}
|
blanchet@51829
|
114 |
|
blanchet@51829
|
115 |
ML {*
|
blanchet@49348
|
116 |
if do_it then
|
blanchet@51829
|
117 |
generate_mesh_suggestions max_suggestions (prefix ^ "mash_suggestions")
|
blanchet@58462
|
118 |
(prefix ^ "mepo_suggestions") (prefix ^ "mesh_suggestions")
|
blanchet@49260
|
119 |
else
|
blanchet@49260
|
120 |
()
|
blanchet@49249
|
121 |
*}
|
blanchet@49249
|
122 |
|
blanchet@49249
|
123 |
ML {*
|
blanchet@49260
|
124 |
if do_it then
|
blanchet@58463
|
125 |
generate_prover_dependencies @{context} params range thys (prefix ^ "mash_prover_dependencies")
|
blanchet@49260
|
126 |
else
|
blanchet@49260
|
127 |
()
|
blanchet@49260
|
128 |
*}
|
blanchet@49260
|
129 |
|
blanchet@51426
|
130 |
ML {*
|
blanchet@51426
|
131 |
if do_it then
|
blanchet@58463
|
132 |
generate_prover_commands @{context} params (range, step) thys max_suggestions
|
blanchet@58462
|
133 |
(prefix ^ "mash_prover_commands")
|
blanchet@51426
|
134 |
else
|
blanchet@51426
|
135 |
()
|
blanchet@51426
|
136 |
*}
|
blanchet@51426
|
137 |
|
blanchet@51981
|
138 |
ML {*
|
blanchet@51981
|
139 |
if do_it then
|
blanchet@51981
|
140 |
generate_mesh_suggestions max_suggestions (prefix ^ "mash_prover_suggestions")
|
blanchet@58462
|
141 |
(prefix ^ "mepo_suggestions") (prefix ^ "mesh_prover_suggestions")
|
blanchet@51981
|
142 |
else
|
blanchet@51981
|
143 |
()
|
blanchet@51981
|
144 |
*}
|
blanchet@51981
|
145 |
|
blanchet@49249
|
146 |
end
|