author | blanchet |
Wed, 11 Jul 2012 09:32:29 +0200 | |
changeset 48240 | 6a8d18798161 |
parent 48239 | 0016290f904c |
child 48242 | 713e32be9845 |
permissions | -rw-r--r-- |
48234 | 1 |
(* Title: HOL/TPTP/mash_export.ML |
2 |
Author: Jasmin Blanchette, TU Muenchen |
|
3 |
Copyright 2012 |
|
4 |
||
5 |
Export Isabelle theory information for MaSh (Machine-learning for Sledgehammer). |
|
6 |
*) |
|
7 |
||
8 |
signature MASH_EXPORT = |
|
9 |
sig |
|
48235 | 10 |
type stature = ATP_Problem_Generate.stature |
11 |
||
12 |
val non_tautological_facts_of : |
|
13 |
theory -> (((unit -> string) * stature) * thm) list |
|
14 |
val theory_ord : theory * theory -> order |
|
15 |
val thm_ord : thm * thm -> order |
|
16 |
val dependencies_of : string list -> thm -> string list |
|
48240 | 17 |
val goal_of_thm : thm -> thm |
48239
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
18 |
val meng_paulson_facts : |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
19 |
Proof.context -> string -> int -> real * real -> thm -> int |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
20 |
-> (((unit -> string) * stature) * thm) list |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
21 |
-> ((string * stature) * thm) list |
48235 | 22 |
val generate_mash_accessibility : theory -> bool -> string -> unit |
23 |
val generate_mash_features : theory -> bool -> string -> unit |
|
24 |
val generate_mash_dependencies : theory -> bool -> string -> unit |
|
25 |
val generate_mash_commands : theory -> string -> unit |
|
48239
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
26 |
val generate_meng_paulson_suggestions : |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
27 |
Proof.context -> theory -> string -> unit |
48234 | 28 |
end; |
29 |
||
30 |
structure MaSh_Export : MASH_EXPORT = |
|
31 |
struct |
|
32 |
||
33 |
open ATP_Problem_Generate |
|
34 |
open ATP_Util |
|
35 |
||
36 |
fun stringN_of_int 0 _ = "" |
|
37 |
| stringN_of_int k n = |
|
38 |
stringN_of_int (k - 1) (n div 10) ^ string_of_int (n mod 10) |
|
39 |
||
40 |
fun escape_meta_char c = |
|
41 |
if Char.isAlphaNum c orelse c = #"_" orelse c = #"." orelse c = #"(" orelse |
|
42 |
c = #")" orelse c = #"," then |
|
43 |
String.str c |
|
44 |
else |
|
45 |
(* fixed width, in case more digits follow *) |
|
46 |
"\\" ^ stringN_of_int 3 (Char.ord c) |
|
47 |
||
48 |
val escape_meta = String.translate escape_meta_char |
|
49 |
||
50 |
val thy_prefix = "y_" |
|
51 |
||
52 |
val fact_name_of = escape_meta |
|
53 |
val thy_name_of = prefix thy_prefix o escape_meta |
|
54 |
val const_name_of = prefix const_prefix o escape_meta |
|
55 |
val type_name_of = prefix type_const_prefix o escape_meta |
|
56 |
val class_name_of = prefix class_prefix o escape_meta |
|
57 |
||
58 |
val thy_name_of_thm = theory_of_thm #> Context.theory_name |
|
59 |
||
60 |
local |
|
61 |
||
62 |
fun has_bool @{typ bool} = true |
|
63 |
| has_bool (Type (_, Ts)) = exists has_bool Ts |
|
64 |
| has_bool _ = false |
|
65 |
||
66 |
fun has_fun (Type (@{type_name fun}, _)) = true |
|
67 |
| has_fun (Type (_, Ts)) = exists has_fun Ts |
|
68 |
| has_fun _ = false |
|
69 |
||
70 |
val is_conn = member (op =) |
|
71 |
[@{const_name Trueprop}, @{const_name HOL.conj}, @{const_name HOL.disj}, |
|
72 |
@{const_name HOL.implies}, @{const_name Not}, |
|
73 |
@{const_name All}, @{const_name Ex}, @{const_name Ball}, @{const_name Bex}, |
|
74 |
@{const_name HOL.eq}] |
|
75 |
||
76 |
val has_bool_arg_const = |
|
77 |
exists_Const (fn (c, T) => |
|
78 |
not (is_conn c) andalso exists has_bool (binder_types T)) |
|
79 |
||
80 |
fun higher_inst_const thy (c, T) = |
|
81 |
case binder_types T of |
|
82 |
[] => false |
|
83 |
| Ts => length (binder_types (Sign.the_const_type thy c)) <> length Ts |
|
84 |
||
85 |
val binders = [@{const_name All}, @{const_name Ex}] |
|
86 |
||
87 |
in |
|
88 |
||
89 |
fun is_fo_term thy t = |
|
90 |
let |
|
91 |
val t = |
|
92 |
t |> Envir.beta_eta_contract |
|
93 |
|> transform_elim_prop |
|
94 |
|> Object_Logic.atomize_term thy |
|
95 |
in |
|
96 |
Term.is_first_order binders t andalso |
|
97 |
not (exists_subterm (fn Var (_, T) => has_bool T orelse has_fun T |
|
98 |
| _ => false) t orelse |
|
99 |
has_bool_arg_const t orelse exists_Const (higher_inst_const thy) t) |
|
100 |
end |
|
101 |
||
102 |
end |
|
103 |
||
104 |
fun interesting_terms_types_and_classes term_max_depth type_max_depth t = |
|
105 |
let |
|
106 |
val bad_types = [@{type_name prop}, @{type_name bool}, @{type_name fun}] |
|
107 |
val bad_consts = atp_widely_irrelevant_consts |
|
108 |
val add_classes = |
|
109 |
subtract (op =) @{sort type} #> map class_name_of #> union (op =) |
|
110 |
fun do_add_type (Type (s, Ts)) = |
|
111 |
(not (member (op =) bad_types s) ? insert (op =) (type_name_of s)) |
|
112 |
#> fold do_add_type Ts |
|
113 |
| do_add_type (TFree (_, S)) = add_classes S |
|
114 |
| do_add_type (TVar (_, S)) = add_classes S |
|
115 |
fun add_type T = type_max_depth >= 0 ? do_add_type T |
|
116 |
fun mk_app s args = |
|
117 |
if member (op <>) args "" then s ^ "(" ^ space_implode "," args ^ ")" |
|
118 |
else s |
|
119 |
fun patternify ~1 _ = "" |
|
120 |
| patternify depth t = |
|
121 |
case strip_comb t of |
|
122 |
(Const (s, _), args) => |
|
123 |
mk_app (const_name_of s) (map (patternify (depth - 1)) args) |
|
124 |
| _ => "" |
|
125 |
fun add_term_patterns ~1 _ = I |
|
126 |
| add_term_patterns depth t = |
|
127 |
insert (op =) (patternify depth t) |
|
128 |
#> add_term_patterns (depth - 1) t |
|
129 |
val add_term = add_term_patterns term_max_depth |
|
130 |
fun add_patterns t = |
|
131 |
let val (head, args) = strip_comb t in |
|
132 |
(case head of |
|
133 |
Const (s, T) => |
|
134 |
not (member (op =) bad_consts s) ? (add_term t #> add_type T) |
|
135 |
| Free (_, T) => add_type T |
|
136 |
| Var (_, T) => add_type T |
|
137 |
| Abs (_, T, body) => add_type T #> add_patterns body |
|
138 |
| _ => I) |
|
139 |
#> fold add_patterns args |
|
140 |
end |
|
141 |
in [] |> add_patterns t |> sort string_ord end |
|
142 |
||
143 |
fun is_likely_tautology th = |
|
144 |
null (interesting_terms_types_and_classes 0 ~1 (prop_of th)) andalso |
|
145 |
not (Thm.eq_thm_prop (@{thm ext}, th)) |
|
146 |
||
147 |
fun is_too_meta thy th = |
|
148 |
fastype_of (Object_Logic.atomize_term thy (prop_of th)) <> @{typ bool} |
|
149 |
||
150 |
fun non_tautological_facts_of thy = |
|
151 |
all_facts_of_theory thy |
|
152 |
|> filter_out ((is_likely_tautology orf is_too_meta thy) o snd) |
|
153 |
||
154 |
fun theory_ord p = |
|
155 |
if Theory.eq_thy p then EQUAL |
|
156 |
else if Theory.subthy p then LESS |
|
157 |
else if Theory.subthy (swap p) then GREATER |
|
158 |
else EQUAL |
|
159 |
||
160 |
val thm_ord = theory_ord o pairself theory_of_thm |
|
161 |
||
162 |
fun thms_by_thy ths = |
|
163 |
ths |> map (snd #> `thy_name_of_thm) |
|
164 |
|> AList.group (op =) |
|
165 |
|> sort (int_ord o pairself (length o Theory.ancestors_of o theory_of_thm |
|
166 |
o hd o snd)) |
|
167 |
|> map (apsnd (sort thm_ord)) |
|
168 |
||
169 |
fun has_thy thy th = (Context.theory_name thy = thy_name_of_thm th) |
|
170 |
||
171 |
fun parent_thms thy_ths thy = |
|
172 |
Theory.parents_of thy |
|
173 |
|> map Context.theory_name |
|
174 |
|> map_filter (AList.lookup (op =) thy_ths) |
|
175 |
|> map List.last |
|
176 |
|> map (fact_name_of o Thm.get_name_hint) |
|
177 |
||
178 |
fun is_exists (s, _) = (s = @{const_name Ex} orelse s = @{const_name Ex1}) |
|
179 |
||
180 |
val max_depth = 1 |
|
181 |
||
182 |
fun features_of thy (status, th) = |
|
183 |
let val t = Thm.prop_of th in |
|
184 |
thy_name_of (thy_name_of_thm th) :: |
|
185 |
interesting_terms_types_and_classes max_depth max_depth t |
|
186 |
|> not (has_no_lambdas t) ? cons "lambdas" |
|
187 |
|> exists_Const is_exists t ? cons "skolems" |
|
188 |
|> not (is_fo_term thy t) ? cons "ho" |
|
189 |
|> (case status of |
|
190 |
General => I |
|
191 |
| Induction => cons "induction" |
|
192 |
| Intro => cons "intro" |
|
193 |
| Inductive => cons "inductive" |
|
194 |
| Elim => cons "elim" |
|
195 |
| Simp => cons "simp" |
|
196 |
| Def => cons "def") |
|
197 |
end |
|
198 |
||
199 |
val dependencies_of = |
|
200 |
map fact_name_of oo theorems_mentioned_in_proof_term o SOME |
|
201 |
||
48239
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
202 |
val freezeT = Type.legacy_freeze_type |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
203 |
|
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
204 |
fun freeze (t $ u) = freeze t $ freeze u |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
205 |
| freeze (Abs (s, T, t)) = Abs (s, freezeT T, freeze t) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
206 |
| freeze (Var ((s, _), T)) = Free (s, freezeT T) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
207 |
| freeze (Const (s, T)) = Const (s, freezeT T) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
208 |
| freeze (Free (s, T)) = Free (s, freezeT T) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
209 |
| freeze t = t |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
210 |
|
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
211 |
val goal_of_thm = prop_of #> freeze #> cterm_of thy #> Goal.init |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
212 |
|
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
213 |
fun meng_paulson_facts ctxt prover_name max_relevant relevance_thresholds |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
214 |
goal i = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
215 |
let |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
216 |
val (_, hyp_ts, concl_t) = ATP_Util.strip_subgoal ctxt goal i |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
217 |
val is_built_in_const = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
218 |
Sledgehammer_Provers.is_built_in_const_for_prover ctxt prover_name |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
219 |
val relevance_fudge = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
220 |
Sledgehammer_Provers.relevance_fudge_for_prover ctxt prover_name |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
221 |
val relevance_override = {add = [], del = [], only = false} |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
222 |
in |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
223 |
Sledgehammer_Filter.relevant_facts ctxt relevance_thresholds |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
224 |
max_relevant is_built_in_const relevance_fudge relevance_override [] |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
225 |
hyp_ts concl_t |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
226 |
end |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
227 |
|
48235 | 228 |
fun generate_mash_accessibility thy include_thy file_name = |
48234 | 229 |
let |
230 |
val path = file_name |> Path.explode |
|
231 |
val _ = File.write path "" |
|
232 |
fun do_thm th prevs = |
|
233 |
let |
|
234 |
val s = th ^ ": " ^ space_implode " " prevs ^ "\n" |
|
235 |
val _ = File.append path s |
|
236 |
in [th] end |
|
237 |
val thy_ths = |
|
238 |
non_tautological_facts_of thy |
|
239 |
|> not include_thy ? filter_out (has_thy thy o snd) |
|
240 |
|> thms_by_thy |
|
241 |
fun do_thy ths = |
|
242 |
let |
|
243 |
val thy = theory_of_thm (hd ths) |
|
244 |
val parents = parent_thms thy_ths thy |
|
245 |
val ths = ths |> map (fact_name_of o Thm.get_name_hint) |
|
48239
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
246 |
in fold do_thm ths parents; () end |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
247 |
in List.app (do_thy o snd) thy_ths end |
48234 | 248 |
|
48235 | 249 |
fun generate_mash_features thy include_thy file_name = |
48234 | 250 |
let |
251 |
val path = file_name |> Path.explode |
|
252 |
val _ = File.write path "" |
|
253 |
val facts = |
|
254 |
non_tautological_facts_of thy |
|
255 |
|> not include_thy ? filter_out (has_thy thy o snd) |
|
256 |
fun do_fact ((_, (_, status)), th) = |
|
257 |
let |
|
258 |
val name = Thm.get_name_hint th |
|
259 |
val feats = features_of thy (status, th) |
|
260 |
val s = fact_name_of name ^ ": " ^ space_implode " " feats ^ "\n" |
|
261 |
in File.append path s end |
|
48239
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
262 |
in List.app do_fact facts end |
48234 | 263 |
|
48235 | 264 |
fun generate_mash_dependencies thy include_thy file_name = |
48234 | 265 |
let |
266 |
val path = file_name |> Path.explode |
|
267 |
val _ = File.write path "" |
|
268 |
val ths = |
|
269 |
non_tautological_facts_of thy |
|
270 |
|> not include_thy ? filter_out (has_thy thy o snd) |
|
271 |
|> map snd |
|
272 |
val all_names = ths |> map Thm.get_name_hint |
|
273 |
fun do_thm th = |
|
274 |
let |
|
275 |
val name = Thm.get_name_hint th |
|
276 |
val deps = dependencies_of all_names th |
|
277 |
val s = fact_name_of name ^ ": " ^ space_implode " " deps ^ "\n" |
|
278 |
in File.append path s end |
|
48239
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
279 |
in List.app do_thm ths end |
48234 | 280 |
|
48235 | 281 |
fun generate_mash_commands thy file_name = |
48234 | 282 |
let |
283 |
val path = file_name |> Path.explode |
|
284 |
val _ = File.write path "" |
|
285 |
val facts = non_tautological_facts_of thy |
|
286 |
val (new_facts, old_facts) = |
|
287 |
facts |> List.partition (has_thy thy o snd) |
|
288 |
|>> sort (thm_ord o pairself snd) |
|
289 |
val ths = facts |> map snd |
|
290 |
val all_names = ths |> map Thm.get_name_hint |
|
291 |
fun do_fact ((_, (_, status)), th) prevs = |
|
292 |
let |
|
293 |
val name = Thm.get_name_hint th |
|
294 |
val feats = features_of thy (status, th) |
|
295 |
val deps = dependencies_of all_names th |
|
296 |
val kind = Thm.legacy_get_kind th |
|
297 |
val name = fact_name_of name |
|
298 |
val core = |
|
299 |
name ^ ": " ^ space_implode " " prevs ^ "; " ^ space_implode " " feats |
|
300 |
val query = if kind <> "" then "? " ^ core ^ "\n" else "" |
|
301 |
val update = "! " ^ core ^ "; " ^ space_implode " " deps ^ "\n" |
|
302 |
val _ = File.append path (query ^ update) |
|
303 |
in [name] end |
|
304 |
val thy_ths = old_facts |> thms_by_thy |
|
305 |
val parents = parent_thms thy_ths thy |
|
48239
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
306 |
in fold do_fact new_facts parents; () end |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
307 |
|
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
308 |
fun generate_meng_paulson_suggestions ctxt thy file_name = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
309 |
let |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
310 |
val {provers, max_relevant, relevance_thresholds, ...} = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
311 |
Sledgehammer_Isar.default_params ctxt [] |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
312 |
val prover_name = hd provers |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
313 |
val path = file_name |> Path.explode |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
314 |
val _ = File.write path "" |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
315 |
val facts = non_tautological_facts_of thy |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
316 |
val (new_facts, old_facts) = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
317 |
facts |> List.partition (has_thy thy o snd) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
318 |
|>> sort (thm_ord o pairself snd) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
319 |
val i = 1 |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
320 |
fun do_fact (fact as (_, th)) old_facts = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
321 |
let |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
322 |
val name = Thm.get_name_hint th |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
323 |
val goal = goal_of_thm th |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
324 |
val kind = Thm.legacy_get_kind th |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
325 |
val _ = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
326 |
if kind <> "" then |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
327 |
let |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
328 |
val suggs = |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
329 |
old_facts |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
330 |
|> meng_paulson_facts ctxt prover_name (the max_relevant) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
331 |
relevance_thresholds goal i |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
332 |
|> map (fact_name_of o Thm.get_name_hint o snd) |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
333 |
val s = fact_name_of name ^ ": " ^ space_implode " " suggs ^ "\n" |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
334 |
in File.append path s end |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
335 |
else |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
336 |
() |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
337 |
in fact :: old_facts end |
0016290f904c
generate Meng--Paulson facts for evaluation purposes
blanchet
parents:
48235
diff
changeset
|
338 |
in fold do_fact new_facts old_facts; () end |
48234 | 339 |
|
340 |
end; |