]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/helena/src/basic_rg/brgLP.ml
- simpler attribute system
[helm.git] / helm / software / helena / src / basic_rg / brgLP.ml
index 857d5ccacb121efc3f9161066db552292b4a2486..1eb1bae3d3ca318460966533aced18a80525e127 100644 (file)
@@ -78,22 +78,22 @@ let out_name och a =
    E.name err f a
 
 let rec out_term st e och = function
-   | B.Sort (_, h)                   ->
-      let sort = if h = 0 then "k+set" else if h = 1 then "k+prop" else assert false in
+   | B.Sort k                        ->
+      let sort = if k = 0 then "k+set" else if k = 1 then "k+prop" else assert false in
       KP.fprintf och "(sort %s)" sort
    | B.LRef (_, i)                   ->
-      let _, _, a, b = B.get e i in
-      KP.fprintf och "%a" out_name a
+      let _, _, _, y, b = B.get e i in
+      KP.fprintf och "%a" out_name y
    | B.GRef (_, s)                   ->
       KP.fprintf och "%a" out_uri s
-   | B.Cast (_, u, t)                ->
+   | B.Cast (u, t)                   ->
       KP.fprintf och "(cast %a %a)" (out_term st e) u (out_term st e) t 
-   | B.Appl (_, x, v, t)             ->
+   | B.Appl (x, v, t)                ->
       let c = if x then "appx" else "appr" in
       KP.fprintf och "(%s %a %a)" c (out_term st e) v (out_term st e) t
-   | B.Bind (a, B.Abst (r, n, w), t) ->
-      let a = R.alpha B.mem e a in
-      let ee = B.push e B.empty a (B.abst r n w) in
+   | B.Bind (y, B.Abst (r, n, w), t) ->
+      let y = R.alpha B.mem e y in
+      let ee = B.push e B.empty E.empty_node y (B.abst r n w) in
       let c = if r then "prod" else "abst" in
       let l = match N.to_string st n with
          | "1" -> "l+1"
@@ -101,17 +101,13 @@ let rec out_term st e och = function
          | _   -> ok := false; "?"
       in
       KP.fprintf och "(%s %s %a %a\\ %a)"
-         c l (out_term st e) w out_name a (out_term st ee) t
-   | B.Bind (a, B.Abbr v, t)         ->
-      let a = R.alpha B.mem e a in
-      let ee = B.push e B.empty a (B.abbr v) in
+         c l (out_term st e) w out_name y (out_term st ee) t
+   | B.Bind (y, B.Abbr v, t)         ->
+      let y = R.alpha B.mem e y in
+      let ee = B.push e B.empty E.empty_node y (B.abbr v) in
       KP.fprintf och "(abbr %a %a\\ %a)"
-          (out_term st e) v out_name a (out_term st ee) t
-   | B.Bind (a, B.Void, t)   ->
-      let a = R.alpha B.mem e a in
-      let ee = B.push e B.empty a (B.Void) in
-      KP.fprintf och "(void %a\\ %a)"
-          out_name a (out_term st ee) t
+          (out_term st e) v out_name y (out_term st ee) t
+   | B.Bind (_, B.Void, _)           -> C.err ()
 
 (* elpi variant 1 ***********************************************************)