X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fsrc%2Fbasic_rg%2Fbrg.ml;h=be4e6f9b97269bfb262229981cdae00c9e167c4e;hb=cb3e2526b3788172cf4a11e4c0082c12e8d233d0;hp=efc5d7556914bc6b8976b0ade53be6a751c042ee;hpb=ab13cfa248f0ee58d239ceeddfb50ec49a6b5c6d;p=helm.git diff --git a/helm/software/lambda-delta/src/basic_rg/brg.ml b/helm/software/lambda-delta/src/basic_rg/brg.ml index efc5d7556..be4e6f9b9 100644 --- a/helm/software/lambda-delta/src/basic_rg/brg.ml +++ b/helm/software/lambda-delta/src/basic_rg/brg.ml @@ -12,13 +12,15 @@ (* kernel version: basic, relative, global *) (* note : ufficial basic lambda-delta *) -type uri = Entity.uri -type id = Entity.id -type attrs = Entity.attrs +module E = Entity +module N = Level -type bind = Void (* *) - | Abst of term (* type *) - | Abbr of term (* body *) +type uri = E.uri +type attrs = E.attrs + +type bind = Void (* *) + | Abst of N.level * term (* level, type *) + | Abbr of term (* body *) and term = Sort of attrs * int (* attrs, hierarchy index *) | LRef of attrs * int (* attrs, position index *) @@ -27,21 +29,15 @@ and term = Sort of attrs * int (* attrs, hierarchy index *) | Appl of attrs * term * term (* attrs, argument, function *) | Bind of attrs * bind * term (* attrs, binder, scope *) -type entity = term Entity.entity (* attrs, uri, binder *) +type entity = term E.entity (* attrs, uri, binder *) type lenv = Null (* Cons: tail, relative local environment, attrs, binder *) | Cons of lenv * lenv * attrs * bind -(* helpers ******************************************************************) - -let mk_uri si root s = - let kernel = if si then "brg-si" else "brg" in - String.concat "/" ["ld:"; kernel; root; s ^ ".ld"] - (* Currified constructors ***************************************************) -let abst w = Abst w +let abst n w = Abst (n, w) let abbr v = Abbr v @@ -53,7 +49,7 @@ let appl a u t = Appl (a, u, t) let bind a b t = Bind (a, b, t) -let bind_abst a u t = Bind (a, Abst u, t) +let bind_abst n a u t = Bind (a, Abst (n, u), t) let bind_abbr a v t = Bind (a, Abbr v, t) @@ -76,8 +72,3 @@ let get e i = get i e let rec fold_right f map e x = match e with | Null -> f x | Cons (e, c, a, b) -> fold_right (map f e c a b) map e x - -(* used in MetaBrg.unwind_to_xlate_term *) -let rec fold_left map x = function - | Null -> x - | Cons (e, _, a, b) -> fold_left map (map x a b) e