]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/helena/src/basic_rg/brgGrafite.ml
level disambiguation cmpleted! the Grafite file is succesfully generated.
[helm.git] / helm / software / helena / src / basic_rg / brgGrafite.ml
index c32747e00ce72c0e1fa2b12ebd9963d3c05a3440..13e9ce334aee99802cd3ca0ff7bed2401674baed 100644 (file)
@@ -17,6 +17,7 @@ module C = Cps
 module G = Options
 module N = Level
 module E = Entity
+module R = Alpha
 module B = Brg
 
 (* Internal functions *******************************************************)
@@ -60,8 +61,6 @@ let out_uri och u =
    in
    aux (strip 0 3)
 
-let rename f e a = f a
-
 let out_name och a =
    let f n = function 
       | true  -> P.fprintf och "%s" n
@@ -86,25 +85,21 @@ let rec out_term st p e och = function
       P.fprintf och "%s%a %a%s" op (out_term st pt e) t (out_term st true e) v cp
    | B.Bind (a, B.Abst (n, w), t) ->
       let op, cp = if p then "(", ")" else "", "" in
-      let f a =
-         let ee = B.push e B.empty a (B.abst n w) in
-        let binder = match N.to_string st n with
-            | "1" -> "Π"
-            | "2" -> "λ"
-            | _   -> ok := false; "?"
-         in
-         P.fprintf och "%s%s%a:%a.%a%s"
-            op binder out_name a (out_term st false e) w (out_term st false ee) t cp
+      let a = R.alpha B.mem e a in
+      let ee = B.push e B.empty a (B.abst n w) in
+      let binder = match N.to_string st n with
+         | "1" -> "Π"
+         | "2" -> "λ"
+         | _   -> ok := false; "?"
       in
-      rename f e a
+      P.fprintf och "%s%s%a:%a.%a%s"
+         op binder out_name a (out_term st false e) w (out_term st false ee) t cp
    | B.Bind (a, B.Abbr v, t) ->
       let op, cp = if p then "(", ")" else "", "" in
-      let f a = 
-         let ee = B.push e B.empty a (B.abbr v) in
-        P.fprintf och "%slet %a ≝ %a in %a%s"
-            op out_name a (out_term st false e) v (out_term st false ee) t cp
-      in
-      rename f e a
+      let a = R.alpha B.mem e a in
+      let ee = B.push e B.empty a (B.abbr v) in
+      P.fprintf och "%slet %a ≝ %a in %a%s"
+         op out_name a (out_term st false e) v (out_term st false ee) t cp
    | B.Bind (a, B.Void, t)   -> C.err ()
 
 (* Interface functions ******************************************************)