let count_par f c (_, w) = count_term f c w
-let count_item f c = function
+let count_entry f c = function
| _, pars, _, w, None ->
let c = {c with eabsts = succ c.eabsts} in
let c = {c with pabsts = c.pabsts + List.length pars} in
let f c = count_term f c w in
Cps.list_fold_left f count_par c pars
-let count f c b =
- Cps.list_fold_left f count_item c b
+let count_item f c = function
+ | Some e -> count_entry f c e
+ | None -> f c
let print_counters f c =
let terms = c.tsorts + c.tgrefs + c.tgrefs + c.tappls + c.tabsts in
| Some (trans, t) ->
F.fprintf frm "%s%a" (string_of_transparent trans) pp_term t
-let pp_item frm (l, pars, qid, u, body) =
+let pp_entry frm (l, pars, qid, u, body) =
F.fprintf frm "@[%u@@%s%a%a:%a@]@\n%!"
l (string_of_qid qid) pp_pars pars pp_body body pp_term u
-let pp_environment f frm genv =
- List.iter (pp_item frm) genv; f ()
+let pp_item f frm = function
+ | Some entry -> pp_entry frm entry; f ()
+ | None -> f ()