]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/helena/src/common/entity.ml
- helena: the improved attribute system allows to export the sorts of Pi's
[helm.git] / helm / software / helena / src / common / entity.ml
index f616b780c54bf368f74f8be7d5d80f870d9b0f28..d4bfef5d3e44d826b0f3a30193134a64b5e9372a 100644 (file)
@@ -25,8 +25,9 @@ type meta = Main     (* main object *)
 
 type node_attrs = {
    n_name: name option; (* name *)
-   n_apix: int option;  (* additional position index *)
+   n_apix: int;         (* additional position index *)
    n_degr: int;         (* degree *)
+   n_sort: int;         (* sort *)
 }
 
 type root_attrs = {
@@ -42,8 +43,8 @@ type 'term entity = root_attrs * node_attrs * uri * 'term bind (* attrs, uri, bi
 
 (* helpers ******************************************************************)
 
-let node_attrs ?(real=true) ?apix ?name ?(degr=0) () = {
-   n_apix = apix; n_name = name; n_degr = degr;
+let node_attrs ?(apix=0) ?name ?(degr=0) ?(sort=0) () = {
+   n_apix = apix; n_name = name; n_degr = degr; n_sort = sort
 }
 
 let root_attrs ?(meta=[]) ?info () = {
@@ -60,10 +61,6 @@ let rec name err f a = match a.n_name with
    | Some (n, r) -> f n r
    | None        -> err ()
 
-let rec apix err f a = match a.n_apix with
-   | Some i -> f i
-   | None   -> err ()
-
 let rec info err f a = match a.r_info with
    | Some (lg, tx) -> f lg tx
    | None          -> err ()