X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2FbrgOutput.ml;h=66c7ed3d87a980350f00e2532ca5992e276fb841;hb=f23388dbd51574725a11b0ab5373f09838a32ab5;hp=4d3eb0ff7f093d6dbd6bdba51ddbef183552c4a7;hpb=41bf338d7e638ebb5d97e525055bff05b1f0f045;p=helm.git diff --git a/helm/software/lambda-delta/basic_rg/brgOutput.ml b/helm/software/lambda-delta/basic_rg/brgOutput.ml index 4d3eb0ff7..66c7ed3d8 100644 --- a/helm/software/lambda-delta/basic_rg/brgOutput.ml +++ b/helm/software/lambda-delta/basic_rg/brgOutput.ml @@ -14,6 +14,7 @@ module F = Format module U = NUri module C = Cps module L = Log +module H = Hierarchy module B = Brg type counters = { @@ -28,6 +29,8 @@ type counters = { tabbrs: int } +let indexes = ref false + let initial_counters = { eabsts = 0; eabbrs = 0; tsorts = 0; tlrefs = 0; tgrefs = 0; tcasts = 0; tappls = 0; tabsts = 0; tabbrs = 0 @@ -98,13 +101,18 @@ let print_counters f c = f () let rec pp_term c frm = function - | B.Sort h -> F.fprintf frm "@[*%u@]" h + | B.Sort h -> + let f = function + | Some s -> F.fprintf frm "@[%s@]" s + | None -> F.fprintf frm "@[*%u@]" h + in + H.get_sort f h | B.LRef i -> let f = function | Some (id, _) -> F.fprintf frm "@[%s@]" id | None -> F.fprintf frm "@[#%u@]" i in - B.get f c i + if !indexes then f None else B.get f c i | B.GRef s -> F.fprintf frm "@[$%s@]" (U.string_of_uri s) | B.Cast (u, t) -> F.fprintf frm "@[{%a}.%a@]" (pp_term c) u (pp_term c) t @@ -125,20 +133,18 @@ let rec pp_term c frm = function B.push f c id B.Void let pp_context frm c = - let pp_entry f = function + let pp_entry frm = function | id, B.Abst w -> - F.fprintf frm "%s : %a\n%!" id (pp_term c) w; f () + F.fprintf frm "@,@[%s : %a@]" id (pp_term c) w | id, B.Abbr v -> - F.fprintf frm "%s = %a\n%!" id (pp_term c) v; f () + F.fprintf frm "@,@[%s = %a@]" id (pp_term c) v | id, B.Void -> - F.fprintf frm "%s\n%!" id; f () + F.fprintf frm "@,%s" id in - let f _ es = C.list_iter C.start pp_entry (List.rev es) in + let iter map frm l = List.iter (map frm) l in + let f _ es = F.fprintf frm "%a" (iter pp_entry) (List.rev es) in B.contents f c -let pp_term frm c t = - F.fprintf frm "%a\n%!" (pp_term c) t - let specs = { L.pp_term = pp_term; L.pp_context = pp_context }