X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fsrc%2Ftoplevel%2FmetaBag.ml;fp=helm%2Fsoftware%2Flambda-delta%2Fsrc%2Ftoplevel%2FmetaBag.ml;h=0000000000000000000000000000000000000000;hb=d145ea48ed0bdb9642ced01283231f3f13d476b8;hp=97148c73719be205eb3a1c18088bcde13a09b675;hpb=e7f64fe2cc67f3514131c8831f87311ff600d005;p=helm.git diff --git a/helm/software/lambda-delta/src/toplevel/metaBag.ml b/helm/software/lambda-delta/src/toplevel/metaBag.ml deleted file mode 100644 index 97148c737..000000000 --- a/helm/software/lambda-delta/src/toplevel/metaBag.ml +++ /dev/null @@ -1,67 +0,0 @@ -(* - ||M|| This file is part of HELM, an Hypertextual, Electronic - ||A|| Library of Mathematics, developed at the Computer Science - ||T|| Department, University of Bologna, Italy. - ||I|| - ||T|| HELM is free software; you can redistribute it and/or - ||A|| modify it under the terms of the GNU General Public License - \ / version 2 or (at your option) any later version. - \ / This software is distributed as is, NO WARRANTY. - V_______________________________________________________________ *) - -module C = Cps -module Z = Bag -module M = Meta - -(* Internal functions *******************************************************) - -let rec xlate_term c f = function - | M.Sort s -> - let f h = f (Z.Sort h) in - if s then f 0 else f 1 - | M.LRef (_, i) -> - let l, _, _ = List.nth c i in - f (Z.LRef l) - | M.GRef (_, uri, vs) -> - let map f t v = f (Z.appl v t) in - let f vs = C.list_fold_left f map (Z.GRef uri) vs in - C.list_map f (xlate_term c) vs - | M.Appl (v, t) -> - let f v t = f (Z.Appl (v, t)) in - let f v = xlate_term c (f v) t in - xlate_term c f v - | M.Abst (id, w, t) -> - let f w = - let l = Z.new_location () in - let f t = f (Z.Bind (l, id, Z.Abst w, t)) in - let f c = xlate_term c f t in - Z.push "meta" f c l id (Z.Abst w) - in - xlate_term c f w - -let xlate_pars f pars = - let map f (id, w) c = - let l = Z.new_location () in - let f w = Z.push "meta" f c l id (Z.Abst w) in - xlate_term c f w - in - C.list_fold_right f map pars Z.empty_lenv - -let unwind_to_xlate_term f c t = - let map f t (l, id, b) = f (Z.bind l id b t) in - let f t = C.list_fold_left f map t c in - xlate_term c f t - -let xlate_entry f = function - | pars, u, None -> - let f c = unwind_to_xlate_term f c u in - xlate_pars f pars - | pars, u, Some t -> - let f u t = f (Z.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 - -(* Interface functions ******************************************************) - -let bag_of_meta = xlate_entry