X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fcommon%2Fentity.ml;h=de06f2924717613014f29960bc3af294526636de;hb=cf72398627cd1189f42c3fbb9e29fa4b32e723c8;hp=d6314150b935e77fca6d6bedbeb7a58c04548cbb;hpb=0e6bf0ef18e3879a359b2b6f63d600c20102f0ab;p=helm.git diff --git a/helm/software/lambda-delta/common/entity.ml b/helm/software/lambda-delta/common/entity.ml index d6314150b..de06f2924 100644 --- a/helm/software/lambda-delta/common/entity.ml +++ b/helm/software/lambda-delta/common/entity.ml @@ -9,12 +9,15 @@ \ / This software is distributed as is, NO WARRANTY. V_______________________________________________________________ *) +module O = Options + type uri = NUri.uri 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 *) @@ -25,10 +28,7 @@ type 'term bind = Abst of 'term (* declaration: domain *) type 'term entity = attrs * uri * 'term bind (* attrs, name, binder *) -type uri_generator = string -> string - type status = { - g: Hierarchy.graph; (* sort hierarchy parameter *) delta: bool; (* global delta-expansion *) rt: bool; (* reference typing *) si: bool; (* sort inclusion *) @@ -65,6 +65,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 @@ -96,6 +104,10 @@ let xlate f xlate_term = function | _, _, Void -> assert false -let initial_status g expand si = { - g = g; delta = false; rt = false; si = si; expand = expand +let initial_status () = { + delta = false; rt = false; si = !O.si; expand = !O.expand +} + +let refresh_status st = {st with + si = !O.si; expand = !O.expand }