X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2FbrgSubstitution.ml;h=5c9d91a8bdd14009ffb14b0c256ffe2dc480c95b;hb=e17c4da82bd52712f03c112660c52eb8f1783843;hp=4355376e85f26c17011ed29e80a0b15397bb865e;hpb=2e451dca46e509fd7e7772f3d2e438c189ce10a1;p=helm.git diff --git a/helm/software/lambda-delta/basic_rg/brgSubstitution.ml b/helm/software/lambda-delta/basic_rg/brgSubstitution.ml index 4355376e8..5c9d91a8b 100644 --- a/helm/software/lambda-delta/basic_rg/brgSubstitution.ml +++ b/helm/software/lambda-delta/basic_rg/brgSubstitution.ml @@ -10,19 +10,30 @@ V_______________________________________________________________ *) module B = Brg +(* module O = Output *) + +let rec icm a = function + | B.Sort _ + | B.LRef _ + | B.GRef _ -> succ a + | B.Bind (_, B.Void, t) -> icm (succ a) t + | B.Cast (_, u, t) -> icm (icm a u) t + | B.Appl (_, u, t) + | B.Bind (_, B.Abst u, t) + | B.Bind (_, B.Abbr u, t) -> icm (icm (succ a) u) t let iter map d = let rec iter_bind d = function - | B.Void _ as b -> b - | B.Abst (a, w) -> B.Abst (a, iter_term d w) - | B.Abbr (a, v) -> B.Abbr (a, iter_term d v) + | B.Void -> B.Void + | B.Abst w -> B.Abst (iter_term d w) + | B.Abbr v -> B.Abbr (iter_term d v) and iter_term d = function | B.Sort _ as t -> t | B.GRef _ as t -> t | B.LRef (a, i) as t -> if i < d then t else map d a i | B.Cast (a, w, v) -> B.Cast (a, iter_term d w, iter_term d v) | B.Appl (a, w, u) -> B.Appl (a, iter_term d w, iter_term d u) - | B.Bind (b, u) -> B.Bind (iter_bind d b, iter_term (succ d) u) + | B.Bind (a, b, u) -> B.Bind (a, iter_bind d b, iter_term (succ d) u) in iter_term d @@ -30,9 +41,6 @@ let lift_map h _ a i = if i + h >= 0 then B.LRef (a, i + h) else assert false let lift h d t = - if h = 0 then t else iter (lift_map h) d t - -let lift_bind h d = function - | B.Void _ as b -> b - | B.Abst (a, w) -> B.abst a (lift h d w) - | B.Abbr (a, v) -> B.abbr a (lift h d v) + if h = 0 then t else begin +(* O.icm := succ (* icm *) !O.icm (*t*); *) iter (lift_map h) d t + end