]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/helena/src/basic_rg/brg.ml
level disambiguation cmpleted! the Grafite file is succesfully generated.
[helm.git] / helm / software / helena / src / basic_rg / brg.ml
index ec32ef83dd773e3938a9aed71dd78ec9a086f8b7..cdfa93c6ef1e15d539ef928cfbc0f48e0d8b2917 100644 (file)
@@ -62,7 +62,7 @@ let empty = Null
 let push e c a b = Cons (e, c, a, b)
 
 let rec get i = function
-   | Null                         -> Null, Null, E.empty_node, Void
+   | Null                         -> empty, empty, E.empty_node, Void
    | Cons (e, c, a, b) when i = 0 -> e, c, a, b
    | Cons (e, _, _, _)            -> get (pred i) e
 
@@ -72,3 +72,8 @@ let get e i = get i e
 let rec fold_right f map e x = match e with   
    | Null              -> f x
    | Cons (e, c, a, b) -> fold_right (map f e c a b) map e x
+
+let rec mem err f e b = match e with
+   | Null              -> err ()
+   | Cons (e, _, a, _) ->
+      if a.E.n_name = b.E.n_name then f () else mem err f e b