]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/toplevel/metaBrg.ml
basic_rg: reduction was not tail recursive by mistake
[helm.git] / helm / software / lambda-delta / toplevel / metaBrg.ml
index 4ee25812e9938840409c97241341d8a85a3f000b..ff74f8e7558cb51ce7ac2ea80615f9ec64015bd8 100644 (file)
@@ -34,22 +34,21 @@ let rec xlate_term c f = function
       let f w = 
          let a = [Y.Name (id, true)] in
         let f t = f (B.Bind (B.abst a w, t)) in
-         let f c = xlate_term c f t in
-         B.push f c (B.abst a w)
+         xlate_term (B.push c (B.abst a w)) f t
       in
       xlate_term c f w
 
 let xlate_pars f pars =
    let map f (id, w) c =
       let a = [Y.Name (id, true)] in
-      let f w = B.push f c (B.abst a w) in
+      let f w = f (B.push c (B.abst a w)) in
       xlate_term c f w
    in
    C.list_fold_right f map pars B.empty_lenv
 
 let unwind_to_xlate_term f c t =
-   let map f t b = f (B.bind b t) in
-   let f t = B.fold_left f map t c in
+   let map t b = B.bind b t in
+   let f t = f (B.fold_left map t c) in
    xlate_term c f t
 
 let xlate_entry f = function