\ / 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 *)
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 *)
| 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
| _, _, 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
}