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_______________________________________________________________ *)
26 let initial_counters = {
27 eabsts = 0; eabbrs = 0; tsorts = 0; tlrefs = 0; tgrefs = 0;
28 tcasts = 0; tappls = 0; tabsts = 0; tabbrs = 0
31 let count_term_binder f c = function
32 | B.Abst -> f {c with tabsts = succ c.tabsts}
33 | B.Abbr -> f {c with tabbrs = succ c.tabbrs}
35 let rec count_term f c = function
37 f {c with tsorts = succ c.tsorts}
39 f {c with tlrefs = succ c.tlrefs}
41 f {c with tgrefs = succ c.tgrefs}
43 let c = {c with tcasts = succ c.tcasts} in
44 let f c = count_term f c t in
47 let c = {c with tappls = succ c.tappls} in
48 let f c = count_term f c t in
50 | B.Bind (_, b, u, t) ->
51 let f c = count_term_binder f c b in
52 let f c = count_term f c t in
55 let count_entry_binder f c = function
56 | B.Abst -> f {c with eabsts = succ c.eabsts}
57 | B.Abbr -> f {c with eabbrs = succ c.eabbrs}
59 let count_entry f c (_, b, t) =
60 let f c = count_entry_binder f c b in
63 let count_item f c = function
64 | Some e -> count_entry f c e
67 let print_counters f c =
69 c.tsorts + c.tgrefs + c.tgrefs + c.tcasts + c.tappls + c.tabsts +
72 let items = c.eabsts + c.eabbrs in
73 Printf.printf " Kernel representation summary (basic_rg)\n";
74 Printf.printf " Total entry items: %6u\n" items;
75 Printf.printf " Declaration items: %6u\n" c.eabsts;
76 Printf.printf " Definition items: %6u\n" c.eabbrs;
77 Printf.printf " Total term items: %6u\n" terms;
78 Printf.printf " Sort items: %6u\n" c.tsorts;
79 Printf.printf " Local reference items: %6u\n" c.tlrefs;
80 Printf.printf " Global reference items: %6u\n" c.tgrefs;
81 Printf.printf " Explicit Cast items: %6u\n" c.tcasts;
82 Printf.printf " Application items: %6u\n" c.tappls;
83 Printf.printf " Abstraction items: %6u\n" c.tabsts;
84 Printf.printf " Abbreviation items: %6u\n" c.tabbrs;