2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
28 let initial_counters = {
29 eabsts = 0; eabbrs = 0; tsorts = 0; tlrefs = 0; tgrefs = 0;
30 tcasts = 0; tappls = 0; tabsts = 0; tabbrs = 0
33 let count_term_binder f c = function
34 | B.Abst -> f {c with tabsts = succ c.tabsts}
35 | B.Abbr -> f {c with tabbrs = succ c.tabbrs}
37 let rec count_term f c = function
39 f {c with tsorts = succ c.tsorts}
41 f {c with tlrefs = succ c.tlrefs}
43 f {c with tgrefs = succ c.tgrefs}
45 let c = {c with tcasts = succ c.tcasts} in
46 let f c = count_term f c t in
49 let c = {c with tappls = succ c.tappls} in
50 let f c = count_term f c t in
52 | B.Bind (_, b, u, t) ->
53 let f c = count_term_binder f c b in
54 let f c = count_term f c t in
57 let count_obj_binder f c = function
58 | B.Abst -> f {c with eabsts = succ c.eabsts}
59 | B.Abbr -> f {c with eabbrs = succ c.eabbrs}
61 let count_obj f c (_, _, b, t) =
62 let f c = count_obj_binder f c b in
65 let count_item f c = function
66 | Some obj -> count_obj f c obj
69 let print_counters f c =
71 c.tsorts + c.tgrefs + c.tgrefs + c.tcasts + c.tappls + c.tabsts +
74 let items = c.eabsts + c.eabbrs in
75 L.warn (P.sprintf " Kernel representation summary (basic_rg)");
76 L.warn (P.sprintf " Total entry items: %6u" items);
77 L.warn (P.sprintf " Declaration items: %6u" c.eabsts);
78 L.warn (P.sprintf " Definition items: %6u" c.eabbrs);
79 L.warn (P.sprintf " Total term items: %6u" terms);
80 L.warn (P.sprintf " Sort items: %6u" c.tsorts);
81 L.warn (P.sprintf " Local reference items: %6u" c.tlrefs);
82 L.warn (P.sprintf " Global reference items: %6u" c.tgrefs);
83 L.warn (P.sprintf " Explicit Cast items: %6u" c.tcasts);
84 L.warn (P.sprintf " Application items: %6u" c.tappls);
85 L.warn (P.sprintf " Abstraction items: %6u" c.tabsts);
86 L.warn (P.sprintf " Abbreviation items: %6u" c.tabbrs);