module G = Options
module E = Entity
module H = Hierarchy
+module N = Level
module XD = XmlCrg
module B = Brg
module BD = BrgCrg
}
let rec count_term_binder f c e = function
- | B.Abst w ->
+ | B.Abst (_, w) ->
let c = {c with tabsts = succ c.tabsts; nodes = succ c.nodes} in
count_term f c e w
- | B.Abbr v ->
+ | B.Abbr v ->
let c = {c with tabbrs = succ c.tabbrs; xnodes = succ c.xnodes} in
count_term f c e v
- | B.Void ->
+ | B.Void ->
let c = {c with tvoids = succ c.tvoids; xnodes = succ c.xnodes} in
f c
count_term_binder f c e b
let count_entity f c = function
- | _, u, E.Abst w ->
+ | _, u, E.Abst (_, w) ->
let c = {c with
eabsts = succ c.eabsts; nodes = succ c.nodes; uris = u :: c.uris
} in
count_term f c B.empty w
- | _, _, E.Abbr v ->
+ | _, _, E.Abbr v ->
let c = {c with eabbrs = succ c.eabbrs; xnodes = succ c.xnodes} in
count_term f c B.empty v
- | _, _, E.Void -> assert false
+ | _, _, E.Void -> assert false
let print_counters f c =
let terms =
let name err frm a =
let f n = function
| true -> F.fprintf frm "%s" n
- | false -> F.fprintf frm "^%s" n
+ | false -> F.fprintf frm "-%s" n
in
E.name err f a
+let pp_level frm n =
+ if N.is_infinite n then () else F.fprintf frm "^%s" (N.to_string n)
+
let rec pp_term e frm = function
| B.Sort (_, h) ->
let err _ = F.fprintf frm "@[*%u@]" h in
F.fprintf frm "@[{%a}.%a@]" (pp_term e) u (pp_term e) t
| B.Appl (_, v, t) ->
F.fprintf frm "@[(%a).%a@]" (pp_term e) v (pp_term e) t
- | B.Bind (a, B.Abst w, t) ->
+ | B.Bind (a, B.Abst (n, w), t) ->
let f a =
- let ee = B.push e B.empty a (B.abst w) in
- F.fprintf frm "@[[%a:%a].%a@]" (name C.err) a (pp_term e) w (pp_term ee) t
+ let ee = B.push e B.empty a (B.abst n w) in
+ F.fprintf frm "@[[%a:%a]%a.%a@]" (name C.err) a (pp_term e) w pp_level n (pp_term ee) t
in
rename f e a
| B.Bind (a, B.Abbr v, t) ->