]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/common/entity.ml
- we added a parser for lambda-delta textual syntax (file extension .hln)
[helm.git] / helm / software / lambda-delta / common / entity.ml
index d6314150b935e77fca6d6bedbeb7a58c04548cbb..0fa060321e24d635b488be2f4b235e55c79cb6a3 100644 (file)
@@ -15,6 +15,7 @@ type id = Aut.id
 type attr = Name of id * bool (* name, real? *)
           | Apix of int       (* additional position index *)
          | Mark of int       (* node marker *)
+         | Meta of string    (* metaliguistic annotation *)
          | Priv              (* private global definition *)
 
 type attrs = attr list (* attributes *)
@@ -65,6 +66,14 @@ let rec get_names f = function
    | e :: tl           ->
       let f a = f (e :: a) in get_names f tl
 
+let count_names a =
+   let rec aux k = function
+      | []           -> k
+      | Name _ :: tl -> aux (succ k) tl
+      | _ :: tl      -> aux k tl
+   in
+   aux 0 a
+
 let rec apix err f = function
    | Apix i :: _ -> f i
    | _ :: tl     -> apix err f tl