X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2Fbrg.ml;h=baa83afed3741ca6f94637fec132262d7294a851;hb=f00757144b2cd7e6457fed55dbc1309d11a542dc;hp=6a9f9fd2088b4c260e75d9ffaca19f567748d0a4;hpb=0dc347a7742e40a828fa98acba70078dd2d7cbd5;p=helm.git diff --git a/helm/software/lambda-delta/basic_rg/brg.ml b/helm/software/lambda-delta/basic_rg/brg.ml index 6a9f9fd20..baa83afed 100644 --- a/helm/software/lambda-delta/basic_rg/brg.ml +++ b/helm/software/lambda-delta/basic_rg/brg.ml @@ -12,13 +12,9 @@ (* kernel version: basic, relative, global *) (* note : ufficial basic lambda-delta *) -type uri = Item.uri -type id = Item.id - -type attr = Name of bool * id (* real?, name *) - | Apix of int (* additional position index *) - -type attrs = attr list +type uri = Entity.uri +type id = Entity.id +type attrs = Entity.attrs type bind = Void of attrs (* attrs *) | Abst of attrs * term (* attrs, type *) @@ -31,13 +27,16 @@ and term = Sort of attrs * int (* attrs, hierarchy index *) | Appl of attrs * term * term (* attrs, argument, function *) | Bind of bind * term (* binder, scope *) -type obj = bind Item.obj (* age, uri, binder *) +type entity = term Entity.entity (* attrs, uri, binder *) + +type lenv = Null +(* Cons: tail, relative local environment, binder *) + | Cons of lenv * lenv option * bind -type item = bind Item.item +(* helpers ******************************************************************) -type context = Null -(* Cons: tail, relative context, binder *) - | Cons of context * context option * bind +let mk_uri root s = + String.concat "/" ["ld:"; "brg"; root; s ^ ".ld"] (* Currified constructors ***************************************************) @@ -57,9 +56,9 @@ let bind_abst a u t = Bind (Abst (a, u), t) let bind_abbr a v t = Bind (Abbr (a, v), t) -(* context handling functions ***********************************************) +(* local environment handling functions *************************************) -let empty_context = Null +let empty_lenv = Null let push f es ?c b = let es = Cons (es, c, b) in f es @@ -85,13 +84,3 @@ let rec fold_left f map x = function | Cons (tl, _, b) -> let f x = fold_left f map x tl in map f x b - -let rec name err f = function - | [] -> err () - | Name (r, n) :: _ -> f n r - | _ :: tl -> name err f tl - -let rec apix err f = function - | [] -> err () - | Apix i :: _ -> f i - | _ :: tl -> apix err f tl