type id = E.id
type attrs = E.node_attrs
-type bind = Abst of N.layer * term (* layer, type *)
- | Abbr of term (* body *)
- | Void (* *)
-
-and term = TSort of attrs * int (* attrs, hierarchy index *)
- | TLRef of attrs * int (* attrs, position indexe *)
- | TGRef of attrs * uri (* attrs, reference *)
- | TCast of attrs * term * term (* attrs, domain, element *)
- | TAppl of attrs * term * term (* attrs, argument, function *)
- | TBind of attrs * bind * term (* attrs, binder, scope *)
- | TProj of attrs * lenv * term (* attrs, closure, member *)
-
-and lenv = ESort (* top *)
- | EBind of lenv * attrs * bind (* environment, attrs, binder *)
- | EAppl of lenv * attrs * term (* environment, attrs, argument *)
- | EProj of lenv * attrs * lenv (* environment, attrs, closure *)
+type bind = Abst of bool * N.layer * term (* x-reduced?, layer, type *)
+ | Abbr of term (* body *)
+ | Void (* *)
+
+and term = TSort of attrs * int (* attrs, hierarchy index *)
+ | TLRef of attrs * int (* attrs, position indexe *)
+ | TGRef of attrs * uri (* attrs, reference *)
+ | TCast of attrs * term * term (* attrs, domain, element *)
+ | TAppl of attrs * term * term (* attrs, argument, function *)
+ | TBind of attrs * bind * term (* attrs, binder, scope *)
+ | TProj of attrs * lenv * term (* attrs, closure, member *)
+
+and lenv = ESort (* top *)
+ | EBind of lenv * attrs * bind (* environment, attrs, binder *)
+ | EAppl of lenv * attrs * term (* environment, attrs, argument *)
+ | EProj of lenv * attrs * lenv (* environment, attrs, closure *)
type entity = term E.entity
let replace f n0 e =
let rec aux f = function
- | ESort -> f ESort
- | EBind (e, a, Abst (n, w)) -> aux (push_bind f a (Abst (n0, w))) e
- | EBind (e, a, b) -> aux (push_bind f a b) e
- | EAppl (e, a, v) -> aux (push_appl f a v) e
- | EProj (e, a, d) -> let f d = aux (push_proj f a d) e in aux f d
+ | ESort -> f ESort
+ | EBind (e, a, Abst (x, n, w)) -> aux (push_bind f a (Abst (x, n0, w))) e
+ | EBind (e, a, b) -> aux (push_bind f a b) e
+ | EAppl (e, a, v) -> aux (push_appl f a v) e
+ | EProj (e, a, d) -> let f d = aux (push_proj f a d) e in aux f d
in
aux f e