module C = Cps
module E = Entity
module J = Marks
+module N = Level
module D = Crg
module B = Brg
| D.TProj (a, e, t) ->
let f tt = f (lenv_fold_left xlate_bind xlate_proj tt e) in
xlate_term f t
- | D.TBind (ab, D.Abst ws, D.TCast (ac, u, t)) ->
- xlate_term f (D.TCast (ac, D.TBind (ab, D.Abst ws, u), D.TBind (ab, D.Abst ws, t)))
+ | D.TBind (ab, D.Abst (n, ws), D.TCast (ac, u, t)) ->
+ xlate_term f (D.TCast (ac, D.TBind (ab, D.Abst (N.pred n, ws), u), D.TBind (ab, D.Abst (n, ws), t)))
| D.TBind (a, b, t) ->
let f tt = f (xlate_bind tt a b) in xlate_term f t
let f a ns = a, ns in
let a, ns = E.get_names f a in
match b with
- | D.Abst ws ->
+ | D.Abst (m, ws) ->
let map x n w =
- let f ww = B.Bind (n :: J.new_mark () :: a, B.Abst ww, x) in
+ let f ww = B.Bind (n :: J.new_mark () :: a, B.Abst (m, ww), x) in
xlate_term f w
in
List.fold_left2 map x ns ws
- | D.Abbr vs ->
+ | D.Abbr vs ->
let map x n v =
let f vv = B.Bind (n :: a, B.Abbr vv, x) in
xlate_term f v
in
List.fold_left2 map x ns vs
- | D.Void _ ->
+ | D.Void _ ->
let map x n = B.Bind (n :: a, B.Void, x) in
List.fold_left map x ns
xlate_bk_bind f b
and xlate_bk_bind f = function
- | B.Abst t ->
- let f tt = f (D.Abst [tt]) in
+ | B.Abst (n, t) ->
+ let f tt = f (D.Abst (n, [tt])) in
xlate_bk_term f t
- | B.Abbr t ->
+ | B.Abbr t ->
let f tt = f (D.Abbr [tt]) in
xlate_bk_term f t
- | B.Void -> f (D.Void 1)
+ | B.Void -> f (D.Void 1)
(* interface functions ******************************************************)