1 (* Copyright (C) 2000, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://cs.unibo.it/helm/.
41 let initial_counters = {
42 sections = 0; contexts = 0; blocks = 0; decls = 0; defs = 0;
43 sorts = 0; grefs = 0; appls = 0; absts = 0; pars = 0
46 let rec count_term f c = function
48 f {c with sorts = succ c.sorts}
50 let c = {c with grefs = succ c.grefs} in
51 let c = {c with pars = c.pars + List.length ts} in
52 Cps.list_fold_left f count_term c ts
54 let c = {c with appls = succ c.appls} in
55 let f c = count_term f c t in
58 let c = {c with absts = succ c.absts} in
59 let f c = count_term f c t in
62 let count_item f c = function
64 f {c with sections = succ c.sections}
66 f {c with contexts = succ c.contexts}
68 let c = {c with blocks = succ c.blocks} in
71 let c = {c with decls = succ c.decls} in
73 | A.Def (_, w, _, t) ->
74 let c = {c with defs = succ c.defs} in
75 let f c = count_term f c t in
79 Cps.list_fold_left f count_item c b
81 let print_counters f c =
82 let terms = c.sorts + c.grefs + c.appls + c.absts in
83 let items = c.sections + c.contexts + c.blocks + c.decls + c.defs in
84 Printf.printf " Automath representation summary\n";
85 Printf.printf " Total book items: %6u\n" items;
86 Printf.printf " Section items: %6u\n" c.sections;
87 Printf.printf " Context items: %6u\n" c.contexts;
88 Printf.printf " Block items: %6u\n" c.blocks;
89 Printf.printf " Declaration items: %6u\n" c.decls;
90 Printf.printf " Definition items: %6u\n" c.defs;
91 Printf.printf " Total Parameter items: %6u\n" c.pars;
92 Printf.printf " Application items: %6u\n" c.pars;
93 Printf.printf " Total term items: %6u\n" terms;
94 Printf.printf " Sort items: %6u\n" c.sorts;
95 Printf.printf " Reference items: %6u\n" c.grefs;
96 Printf.printf " Application items: %6u\n" c.appls;
97 Printf.printf " Abstraction items: %6u\n" c.absts;