author | wenzelm |
Thu, 30 Nov 2023 20:11:34 +0100 | |
changeset 79096 | 48187f1a615e |
parent 79095 | 3bdd3cf5f5e0 |
permissions | -rw-r--r-- |
78315 | 1 |
(* Title: Tools/profiling.ML |
2 |
Author: Makarius |
|
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
3 |
|
78315 | 4 |
Session profiling based on loaded ML image. |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
5 |
*) |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
6 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
7 |
signature PROFILING = |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
8 |
sig |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
9 |
val locales: theory -> string list |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
10 |
val locale_thms: theory -> string -> thm list |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
11 |
val locales_thms: theory -> thm list |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
12 |
val global_thms: theory -> thm list |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
13 |
val all_thms: theory -> thm list |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
14 |
type session_statistics = |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
15 |
{theories: int, |
78450 | 16 |
garbage_theories: int, |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
17 |
locales: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
18 |
locale_thms: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
19 |
global_thms: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
20 |
sizeof_thys_id: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
21 |
sizeof_thms_id: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
22 |
sizeof_terms: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
23 |
sizeof_types: int, |
79095 | 24 |
sizeof_names: int, |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
25 |
sizeof_spaces: int} |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
26 |
val session_statistics: string list -> session_statistics |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
27 |
val main: unit -> unit |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
28 |
end; |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
29 |
|
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
30 |
structure Profiling: PROFILING = |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
31 |
struct |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
32 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
33 |
(* theory content *) |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
34 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
35 |
fun locales thy = |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
36 |
let |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
37 |
val parent_spaces = map Locale.locale_space (Theory.parents_of thy); |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
38 |
fun add name = |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
39 |
if exists (fn space => Name_Space.declared space name) parent_spaces then I |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
40 |
else cons name; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
41 |
in fold add (Locale.get_locales thy) [] end; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
42 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
43 |
fun proper_thm thm = not (Thm.eq_thm_prop (Drule.dummy_thm, thm)); |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
44 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
45 |
fun locale_thms thy loc = |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
46 |
(Locale.locale_notes thy loc, []) |-> |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
47 |
(fold (#2 #> fold (#2 #> (fold (#1 #> fold (fn thm => proper_thm thm ? cons thm )))))); |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
48 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
49 |
fun locales_thms thy = |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
50 |
maps (locale_thms thy) (locales thy); |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
51 |
|
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
52 |
fun global_thms thy = |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
53 |
Facts.dest_static true |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
54 |
(map Global_Theory.facts_of (Theory.parents_of thy)) (Global_Theory.facts_of thy) |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
55 |
|> maps #2; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
56 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
57 |
fun all_thms thy = locales_thms thy @ global_thms thy; |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
58 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
59 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
60 |
(* session content *) |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
61 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
62 |
fun session_content thys = |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
63 |
let |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
64 |
val thms = maps all_thms thys; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
65 |
val thys_id = map Context.theory_id thys; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
66 |
val thms_id = map Thm.theory_id thms; |
79096 | 67 |
val terms = |
68 |
Termset.dest ((fold o Thm.fold_terms {hyps = true}) Termset.insert thms Termset.empty); |
|
69 |
val types = Typset.dest ((fold o fold_types) Typset.insert terms Typset.empty); |
|
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
70 |
val spaces = |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
71 |
maps (fn f => map f thys) |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
72 |
[Sign.class_space, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
73 |
Sign.type_space, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
74 |
Sign.const_space, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
75 |
Theory.axiom_space, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
76 |
Thm.oracle_space, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
77 |
Global_Theory.fact_space, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
78 |
Locale.locale_space, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
79 |
Attrib.attribute_space o Context.Theory, |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
80 |
Method.method_space o Context.Theory]; |
79096 | 81 |
val names = Symset.dest (Symset.merges (map (Symset.make o Name_Space.get_names) spaces)); |
79095 | 82 |
in |
83 |
{thys_id = thys_id, thms_id = thms_id, terms = terms, |
|
84 |
types = types, names = names, spaces = spaces} |
|
85 |
end; |
|
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
86 |
|
79095 | 87 |
fun sizeof1_diff (a, b) = ML_Heap.sizeof1 a - ML_Heap.sizeof1 b; |
88 |
fun sizeof_list_diff (a, b) = ML_Heap.sizeof_list a - ML_Heap.sizeof_list b; |
|
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
89 |
fun sizeof_diff (a, b) = ML_Heap.sizeof a - ML_Heap.sizeof b; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
90 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
91 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
92 |
(* session statistics *) |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
93 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
94 |
type session_statistics = |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
95 |
{theories: int, |
78450 | 96 |
garbage_theories: int, |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
97 |
locales: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
98 |
locale_thms: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
99 |
global_thms: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
100 |
sizeof_thys_id: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
101 |
sizeof_thms_id: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
102 |
sizeof_terms: int, |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
103 |
sizeof_types: int, |
79095 | 104 |
sizeof_names: int, |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
105 |
sizeof_spaces: int}; |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
106 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
107 |
fun session_statistics theories : session_statistics = |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
108 |
let |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
109 |
val theories_member = Symtab.defined (Symtab.make_set theories) o Context.theory_long_name; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
110 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
111 |
val context_thys = |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
112 |
#contexts (Context.finish_tracing ()) |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
113 |
|> map_filter (fn (Context.Theory thy, _) => SOME thy | _ => NONE); |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
114 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
115 |
val loader_thys = map Thy_Info.get_theory (Thy_Info.get_names ()); |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
116 |
val loaded_thys = filter theories_member loader_thys; |
78450 | 117 |
val loaded_context_thys = filter theories_member context_thys; |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
118 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
119 |
val all_thys = loader_thys @ context_thys; |
78449 | 120 |
val base_thys = filter_out theories_member all_thys; |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
121 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
122 |
val {thys_id = all_thys_id, thms_id = all_thms_id, terms = all_terms, |
79095 | 123 |
types = all_types, names = all_names, spaces = all_spaces} = session_content all_thys; |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
124 |
val {thys_id = base_thys_id, thms_id = base_thms_id, terms = base_terms, |
79095 | 125 |
types = base_types, names = base_names, spaces = base_spaces} = session_content base_thys; |
78450 | 126 |
|
127 |
val n = length loaded_thys; |
|
78452 | 128 |
val m = (case length loaded_context_thys of 0 => 0 | l => l - n); |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
129 |
in |
78450 | 130 |
{theories = n, |
131 |
garbage_theories = m, |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
132 |
locales = Integer.sum (map (length o locales) loaded_thys), |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
133 |
locale_thms = Integer.sum (map (length o locales_thms) loaded_thys), |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
134 |
global_thms = Integer.sum (map (length o global_thms) loaded_thys), |
79095 | 135 |
sizeof_thys_id = |
136 |
sizeof1_diff ((all_thys_id, all_thms_id), (base_thys_id, all_thms_id)) - |
|
137 |
sizeof_list_diff (all_thys_id, base_thys_id), |
|
138 |
sizeof_thms_id = |
|
139 |
sizeof1_diff ((all_thms_id, all_thys_id), (base_thms_id, all_thys_id)) - |
|
140 |
sizeof_list_diff (all_thms_id, base_thms_id), |
|
141 |
sizeof_terms = |
|
142 |
sizeof1_diff ((all_terms, all_types, all_names), (base_terms, all_types, all_names)) - |
|
143 |
sizeof_list_diff (all_terms, base_terms), |
|
144 |
sizeof_types = |
|
145 |
sizeof1_diff ((all_types, all_names), (base_types, all_names)) - |
|
146 |
sizeof_list_diff (all_types, base_types), |
|
147 |
sizeof_spaces = |
|
148 |
sizeof1_diff ((all_spaces, all_names), (base_spaces, all_names)) - |
|
149 |
sizeof_list_diff (all_spaces, base_spaces), |
|
150 |
sizeof_names = sizeof_diff (all_names, base_names)} |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
151 |
end; |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
152 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
153 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
154 |
(* main entry point for external process *) |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
155 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
156 |
local |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
157 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
158 |
val decode_args : string list XML.Decode.T = |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
159 |
let open XML.Decode in list string end; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
160 |
|
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
161 |
val encode_result : session_statistics XML.Encode.T = |
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
162 |
(fn {theories = a, |
78450 | 163 |
garbage_theories = b, |
164 |
locales = c, |
|
165 |
locale_thms = d, |
|
166 |
global_thms = e, |
|
167 |
sizeof_thys_id = f, |
|
168 |
sizeof_thms_id = g, |
|
169 |
sizeof_terms = h, |
|
170 |
sizeof_types = i, |
|
79095 | 171 |
sizeof_names = j, |
172 |
sizeof_spaces = k} => ((a, (b, (c, (d, (e, (f, (g, (h, (i, (j, k)))))))))))) #> |
|
173 |
let open XML.Encode in |
|
174 |
pair int (pair int (pair int (pair int (pair int (pair int (pair int |
|
175 |
(pair int (pair int (pair int int))))))))) |
|
176 |
end; |
|
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
177 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
178 |
in |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
179 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
180 |
fun main () = |
78315 | 181 |
(case getenv "ISABELLE_PROFILING" of |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
182 |
"" => () |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
183 |
| dir_name => |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
184 |
let |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
185 |
val dir = Path.explode dir_name; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
186 |
val args = decode_args (YXML.parse_body (File.read (dir + \<^path>\<open>args.yxml\<close>))); |
78328
007b04dc6f96
clarified session_statistics: removed somewhat pointless per-theory statistics;
wenzelm
parents:
78315
diff
changeset
|
187 |
val result = session_statistics args; |
78314
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
188 |
in File.write (dir + \<^path>\<open>result.yxml\<close>) (YXML.string_of_body (encode_result result)) end); |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
189 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
190 |
end; |
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
191 |
|
1588bec693c2
copy/rename files from private autocorres version e45b9b680d3e;
wenzelm
parents:
diff
changeset
|
192 |
end; |