231 writeln ("The following children of theory " ^ (quote thy) |
231 writeln ("The following children of theory " ^ (quote thy) |
232 ^ " are now out-of-date: " |
232 ^ " are now out-of-date: " |
233 ^ (quote (space_implode "\",\"" loaded))) |
233 ^ (quote (space_implode "\",\"" loaded))) |
234 else (); |
234 else (); |
235 seq mark_outdated present |
235 seq mark_outdated present |
236 end; |
236 end |
237 |
237 |
238 (*Make sure that loaded_thys contains an entry for tname*) |
238 (*Make sure that loaded_thys contains an entry for tname*) |
239 fun init_thyinfo () = |
239 fun init_thyinfo () = |
240 let val tinfo = {path = "", children = [], parents = [], |
240 let val tinfo = {path = "", children = [], parents = [], |
241 thy_time = None, ml_time = None, |
241 thy_time = None, ml_time = None, |
242 theory = None}; |
242 theory = None}; |
243 in if is_some (get_thyinfo tname) then () |
243 in if is_some (get_thyinfo tname) then () |
244 else loaded_thys := Symtab.update ((tname, tinfo), !loaded_thys) |
244 else loaded_thys := Symtab.update ((tname, tinfo), !loaded_thys) |
245 end; |
245 end |
|
246 fun read_thy_file() = |
|
247 if thy_file = "" then () |
|
248 else |
|
249 (writeln ("Reading \"" ^ name ^ ".thy\""); |
|
250 init_thyinfo (); |
|
251 read_thy tname thy_file; |
|
252 let val old_pt = ! Goals.proof_timing; |
|
253 in (*suppress annoying messages during theory loading*) |
|
254 proof_timing := false; |
|
255 Use.use (out_name tname); |
|
256 proof_timing := old_pt |
|
257 end; |
|
258 if not (!delete_tmpfiles) then () |
|
259 else OS.FileSys.remove (out_name tname); |
|
260 thyfile2html tname abs_path) |
|
261 |
|
262 (*Add theory to list of all loaded theories (for index.html) |
|
263 and it to its parents' sub-charts*) |
|
264 fun add_theory path = |
|
265 if path = "" then (*first time theory has been read*) |
|
266 (mk_html tname abs_path old_parents; |
|
267 mk_graph tname abs_path) (*Add it to graph definition file*) |
|
268 else () |
246 in if thy_uptodate andalso ml_uptodate then () |
269 in if thy_uptodate andalso ml_uptodate then () |
247 else |
270 else |
248 (if thy_file = "" then () |
271 (read_thy_file(); |
249 else |
|
250 (writeln ("Reading \"" ^ name ^ ".thy\""); |
|
251 |
|
252 init_thyinfo (); |
|
253 read_thy tname thy_file; |
|
254 Use.use (out_name tname); |
|
255 |
|
256 if not (!delete_tmpfiles) then () |
|
257 else OS.FileSys.remove (out_name tname); |
|
258 |
|
259 thyfile2html tname abs_path |
|
260 ); |
|
261 |
|
262 set_info tname (Some (file_info thy_file)) None; |
272 set_info tname (Some (file_info thy_file)) None; |
263 (*mark thy_file as successfully loaded*) |
273 (*mark thy_file as successfully loaded*) |
264 |
274 |
265 if ml_file = "" then () |
275 if ml_file = "" then () |
266 else (writeln ("Reading \"" ^ name ^ ".ML\""); |
276 else (writeln ("Reading \"" ^ name ^ ".ML\""); |
267 Use.use ml_file); |
277 Use.use ml_file); |
268 |
278 |
269 (*Store theory again because it could have been redefined*) |
279 (*Store theory again because it could have been redefined*) |
270 use_text false ("val _ = store_theory " ^ tname ^ ".thy;"); |
280 use_text false ("val _ = store_theory " ^ tname ^ ".thy;"); |
271 |
281 |
272 (*Add theory to list of all loaded theories (for index.html) |
282 add_theory (path_of tname); |
273 and add it to its parents' sub-charts*) |
|
274 let val path = path_of tname; |
|
275 in if path = "" then (*first time theory has been read*) |
|
276 ( |
|
277 (*Add theory to list of all loaded theories (for index.html) |
|
278 and add it to its parents' sub-charts*) |
|
279 mk_html tname abs_path old_parents; |
|
280 |
|
281 (*Add theory to graph definition file*) |
|
282 mk_graph tname abs_path |
|
283 ) |
|
284 else () |
|
285 end; |
|
286 |
283 |
287 (*Now set the correct info*) |
284 (*Now set the correct info*) |
288 set_info tname (Some (file_info thy_file)) (Some (file_info ml_file)); |
285 set_info tname (Some (file_info thy_file)) (Some (file_info ml_file)); |
289 set_path (); |
286 set_path (); |
290 |
287 mark_children tname; (*Mark theories that have to be reloaded*) |
291 (*Mark theories that have to be reloaded*) |
288 close_html () ) |
292 mark_children tname; |
|
293 |
|
294 (*Close HTML file*) |
|
295 close_html () |
|
296 ) |
|
297 end; |
289 end; |
298 |
290 |
299 |
291 |
300 val use_thy = use_thy1 false; |
292 val use_thy = use_thy1 false; |
301 |
293 |