-and term = Sort of attrs * int (* attrs, hierarchy index *)
- | LRef of attrs * int * int (* attrs, position indexes *)
- | GRef of attrs * uri (* attrs, reference *)
- | Cast of attrs * term * term (* attrs, domain, element *)
- | Appl of attrs * term list * term (* attrs, arguments, function *)
- | Proj of attrs * lenv * term (* attrs, closure, member *)
- | Bind of attrs * bind * term (* attrs, binder, scope *)
-
-and lenv = Null
- | Cons of lenv * attrs * bind (* closure, attrs, binder *)
+and term = TSort of attrs * int (* attrs, hierarchy index *)
+ | TLRef of attrs * int * int (* attrs, position indexes *)
+ | TGRef of attrs * uri (* attrs, reference *)
+ | TCast of attrs * term * term (* attrs, domain, element *)
+ | TAppl of attrs * term list * term (* attrs, arguments, function *)
+ | TProj of attrs * lenv * term (* attrs, closure, member *)
+ | TBind of attrs * bind * term (* attrs, binder, scope *)
+
+and lenv = ESort (* top *)
+ | EProj of lenv * attrs * lenv (* environment, attrs, closure *)
+ | EBind of lenv * attrs * bind (* environment, attrs, binder *)