X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Ftoplevel%2FmetaBrg.ml;h=cde4daa135c1c915111d175acbd478a37d5767a6;hb=2b1375e4b44e2ef351a6341a5bb0a4823e8daae5;hp=9fe774b8126f3d99986fd91b2affd3f1d30e3eb8;hpb=f983656c56d37a50536e50a319114dbfa592c9a0;p=helm.git diff --git a/helm/software/lambda-delta/toplevel/metaBrg.ml b/helm/software/lambda-delta/toplevel/metaBrg.ml index 9fe774b81..cde4daa13 100644 --- a/helm/software/lambda-delta/toplevel/metaBrg.ml +++ b/helm/software/lambda-delta/toplevel/metaBrg.ml @@ -10,6 +10,7 @@ V_______________________________________________________________ *) module C = Cps +module Y = Entity module B = Brg module M = Meta @@ -31,41 +32,35 @@ let rec xlate_term c f = function xlate_term c f v | M.Abst (id, w, t) -> let f w = - let a = [B.Name (true, id)] in + let a = [Y.Name (id, true)] in let f t = f (B.Bind (a, B.Abst w, t)) in - let f c = xlate_term c f t in - B.push f c a (B.Abst w) + xlate_term (B.push c B.empty a (B.Abst w)) f t in xlate_term c f w let xlate_pars f pars = let map f (id, w) c = - let a = [B.Name (true, id)] in - let f w = B.push f c a (B.Abst w) in + let a = [Y.Name (id, true)] in + let f w = f (B.push c B.empty a (B.Abst w)) in xlate_term c f w in - C.list_fold_right f map pars B.empty_context + C.list_fold_right f map pars B.empty let unwind_to_xlate_term f c t = - let map f t a b = f (B.bind a b t) in - let f t = B.fold_left f map t c in + let map t a b = B.bind a b t in + let f t = f (B.fold_left map t c) in xlate_term c f t let xlate_entry f = function - | e, pars, uri, u, None -> - let f u = f (e, uri, B.Abst u) in + | pars, u, None -> let f c = unwind_to_xlate_term f c u in xlate_pars f pars - | e, pars, uri, u, Some (_, t) -> - let f u t = f (e, uri, B.Abbr (B.Cast ([], u, t))) in + | pars, u, Some t -> + let f u t = f (B.Cast ([], u, t)) in let f c u = unwind_to_xlate_term (f u) c t in let f c = unwind_to_xlate_term (f c) c u in xlate_pars f pars -let xlate_item f = function - | None -> f None - | Some e -> let f e = f (Some e) in xlate_entry f e - (* Interface functions ******************************************************) -let brg_of_meta = xlate_item +let brg_of_meta = xlate_entry