-and count_term f c = function
- | B.Sort _ ->
- f {c with tsorts = succ c.tsorts}
- | B.LRef _ ->
- f {c with tlrefs = succ c.tlrefs}
- | B.GRef _ ->
+and count_term f c e = function
+ | B.Sort _ ->
+ f {c with tsorts = succ c.tsorts; nodes = succ c.nodes}
+ | B.LRef (_, i) ->
+ let f _ = function
+ | None
+ | Some (_, B.Abst _) ->
+ f {c with tlrefs = succ c.tlrefs; nodes = succ c.nodes}
+ | Some (_, B.Abbr _)
+ | Some (_, B.Void) ->
+ f {c with tlrefs = succ c.tlrefs; xnodes = succ c.xnodes}
+ in
+ B.get f e i
+ | B.GRef (_, u) ->
+ let c =
+ if Cps.list_mem ~eq:U.eq u c.uris
+ then {c with nodes = succ c.nodes}
+ else {c with xnodes = succ c.xnodes}
+ in