X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fhelena%2Fsrc%2Fbasic_ag%2FbagOutput.ml;h=689423167690dba237ec4d46e605e1bdc94aaae4;hb=88977b2d546e547e23b046792fe2ad8f6ff192a4;hp=4867c7180d53198af018af0853c0157be9f2d06f;hpb=67686e04702688cc822e809e5168f765bf69d7cb;p=helm.git diff --git a/helm/software/helena/src/basic_ag/bagOutput.ml b/helm/software/helena/src/basic_ag/bagOutput.ml index 4867c7180..689423167 100644 --- a/helm/software/helena/src/basic_ag/bagOutput.ml +++ b/helm/software/helena/src/basic_ag/bagOutput.ml @@ -40,6 +40,8 @@ let initial_counters = { tcasts = 0; tappls = 0; tabsts = 0; tabbrs = 0 } +IFDEF SUMMARY THEN + let rec count_term_binder f c = function | Z.Abst w -> let c = {c with tabsts = succ c.tabsts} in @@ -69,13 +71,13 @@ and count_term f c = function count_term f c t let count_entity f c = function - | _, _, _, E.Abst w -> + | _, _, _, E.Abst (_, w) -> let c = {c with eabsts = succ c.eabsts} in count_term f c w - | _, _, _, E.Abbr v -> + | _, _, _, E.Abbr (_, v) -> let c = {c with eabbrs = succ c.eabbrs} in count_term f c v - | _, _, _, E.Void -> assert false + | _, _, _, E.Void -> assert false let print_counters f c = let terms = @@ -99,6 +101,8 @@ let print_counters f c = L.warn level (KP.sprintf " Total binder locations: %7u" locations); f () +END + let name err och a = let f n = function | true -> KP.fprintf och "%s" n @@ -124,28 +128,28 @@ let rec pp_term st c och = function KP.fprintf och "{%a}.%a" (pp_term st c) u (pp_term st c) t | Z.Appl (v, t) -> KP.fprintf och "(%a).%a" (pp_term st c) v (pp_term st c) t - | Z.Bind (a, l, Z.Abst w, t) -> + | Z.Bind (y, l, Z.Abst w, t) -> let f cc = - KP.fprintf och "[%t:%a].%a" (res a l) (pp_term st c) w (pp_term st cc) t + KP.fprintf och "[%t:%a].%a" (res y l) (pp_term st c) w (pp_term st cc) t in - Z.push "output abst" f c a l (Z.Abst w) - | Z.Bind (a, l, Z.Abbr v, t) -> + Z.push "output abst" f c y l (Z.Abst w) + | Z.Bind (y, l, Z.Abbr v, t) -> let f cc = - KP.fprintf och "[%t=%a].%a" (res a l) (pp_term st c) v (pp_term st cc) t + KP.fprintf och "[%t=%a].%a" (res y l) (pp_term st c) v (pp_term st cc) t in - Z.push "output abbr" f c a l (Z.Abbr v) - | Z.Bind (a, l, Z.Void, t) -> - let f cc = KP.fprintf och "[%t].%a" (res a l) (pp_term st cc) t in - Z.push "output void" f c a l Z.Void + Z.push "output abbr" f c y l (Z.Abbr v) + | Z.Bind (y, l, Z.Void, t) -> + let f cc = KP.fprintf och "[%t].%a" (res y l) (pp_term st cc) t in + Z.push "output void" f c y l Z.Void let pp_lenv st och c = let pp_entry och = function - | a, l, Z.Abst w -> - KP.fprintf och "%t : %a\n" (res a l) (pp_term st c) w - | a, l, Z.Abbr v -> - KP.fprintf och "%t = %a\n" (res a l) (pp_term st c) v - | a, l, Z.Void -> - KP.fprintf och "%t\n" (res a l) + | y, l, Z.Abst w -> + KP.fprintf och "%t : %a\n" (res y l) (pp_term st c) w + | y, l, Z.Abbr v -> + KP.fprintf och "%t = %a\n" (res y l) (pp_term st c) v + | y, l, Z.Void -> + KP.fprintf och "%t\n" (res y l) in let iter map och l = List.iter (map och) l in let f es = KP.fprintf och "%a" (iter pp_entry) (List.rev es) in @@ -155,7 +159,11 @@ let specs = { L.pp_term = pp_term; L.pp_lenv = pp_lenv } +IFDEF OBJECTS THEN + (* term xml printing ********************************************************) let export_term st = ZD.crg_of_bag (XD.export_term st) + +END