X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2FbrgOutput.ml;h=4d3eb0ff7f093d6dbd6bdba51ddbef183552c4a7;hb=41bf338d7e638ebb5d97e525055bff05b1f0f045;hp=4c100375d381e11411312a3f80f7084100a84775;hpb=40b85b6717785a7b24f2bc0680e716655b8faf99;p=helm.git diff --git a/helm/software/lambda-delta/basic_rg/brgOutput.ml b/helm/software/lambda-delta/basic_rg/brgOutput.ml index 4c100375d..4d3eb0ff7 100644 --- a/helm/software/lambda-delta/basic_rg/brgOutput.ml +++ b/helm/software/lambda-delta/basic_rg/brgOutput.ml @@ -15,7 +15,6 @@ module U = NUri module C = Cps module L = Log module B = Brg -module R = BrgReduction type counters = { eabsts: int; @@ -100,29 +99,42 @@ let print_counters f c = let rec pp_term c frm = function | B.Sort h -> F.fprintf frm "@[*%u@]" h - | B.LRef i -> F.fprintf frm "@[#%u@]" i + | 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 | 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 | B.Appl (v, t) -> F.fprintf frm "@[(%a).%a@]" (pp_term c) v (pp_term c) t | B.Bind (id, B.Abst w, t) -> - F.fprintf frm "@[[%s:%a].%a@]" id (pp_term c) w (pp_term c) t + let f cc = + F.fprintf frm "@[[%s:%a].%a@]" id (pp_term c) w (pp_term cc) t + in + B.push f c id (B.Abst w) | B.Bind (id, B.Abbr v, t) -> - F.fprintf frm "@[[%s=%a].%a@]" id (pp_term c) v (pp_term c) t + let f cc = + F.fprintf frm "@[[%s=%a].%a@]" id (pp_term c) v (pp_term cc) t + in + B.push f c id (B.Abbr v) | B.Bind (id, B.Void, t) -> - F.fprintf frm "@[[%s].%a@]" id (pp_term c) t + let f cc = F.fprintf frm "@[[%s].%a@]" id (pp_term cc) t in + B.push f c id B.Void let pp_context frm c = let pp_entry f = function - | B.Abst w -> - F.fprintf frm "%s %a\n%!" "\\decl" (pp_term c) w; f () - | B.Abbr v -> - F.fprintf frm "%s %a\n%!" "\\def " (pp_term c) v; f () - | B.Void -> - F.fprintf frm "%s\n%!" "\\void"; f () + | id, B.Abst w -> + F.fprintf frm "%s : %a\n%!" id (pp_term c) w; f () + | id, B.Abbr v -> + F.fprintf frm "%s = %a\n%!" id (pp_term c) v; f () + | id, B.Void -> + F.fprintf frm "%s\n%!" id; f () in - R.iter C.start pp_entry c + let f _ es = C.list_iter C.start 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