(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* unit; load_function : int -> object_name * 'a -> unit; open_function : open_filter -> int -> object_name * 'a -> unit; classify_function : 'a -> 'a substitutivity; subst_function : substitution * 'a -> 'a; discharge_function : object_name * 'a -> 'a option; rebuild_function : 'a -> 'a } val simple_open : (int -> object_name * 'a -> unit) -> open_filter -> int -> object_name * 'a -> unit (** Combinator for making objects which are only opened by unfiltered Import *) val filter_and : open_filter -> open_filter -> open_filter option (** Returns [None] when the intersection is empty. *) val filter_or : open_filter -> open_filter -> open_filter val in_filter_ref : Names.GlobRef.t -> open_filter -> bool (** The default object is a "Keep" object with empty methods. Object creators are advised to use the construction [{(default_object "MY_OBJECT") with cache_function = ... }] and specify only these functions which are not empty/meaningless *) val default_object : string -> 'a object_declaration (** the identity substitution function *) val ident_subst_function : substitution * 'a -> 'a (** {6 ... } *) (** Given an object declaration, the function [declare_object_full] will hand back two functions, the "injection" and "projection" functions for dynamically typed library-objects. *) module Dyn : Dyn.S type obj = Dyn.t type algebraic_objects = | Objs of objects | Ref of Names.ModPath.t * Mod_subst.substitution and t = | ModuleObject of substitutive_objects | ModuleTypeObject of substitutive_objects | IncludeObject of algebraic_objects | KeepObject of objects | ExportObject of { mpl : (open_filter * Names.ModPath.t) list } | AtomicObject of obj and objects = (Names.Id.t * t) list and substitutive_objects = Names.MBId.t list * algebraic_objects val declare_object_full : 'a object_declaration -> 'a Dyn.tag val declare_object : 'a object_declaration -> ('a -> obj) val cache_object : object_name * obj -> unit val load_object : int -> object_name * obj -> unit val open_object : open_filter -> int -> object_name * obj -> unit val subst_object : substitution * obj -> obj val classify_object : obj -> obj substitutivity val discharge_object : object_name * obj -> obj option val rebuild_object : obj -> obj (** Higher-level API for objects with fixed scope. - Local means that the object cannot be imported from outside. - Global means that it can be imported (by importing the module that contains the object). - Superglobal means that the object survives to closing a module, and is imported when the file which contains it is Required (even without Import). - With the nodischarge variants, the object does not survive section closing. With the normal variants, it does. We recommend to avoid declaring superglobal objects and using the nodischarge variants. *) val local_object : string -> cache:(object_name * 'a -> unit) -> discharge:(object_name * 'a -> 'a option) -> 'a object_declaration val local_object_nodischarge : string -> cache:(object_name * 'a -> unit) -> 'a object_declaration val global_object : string -> cache:(object_name * 'a -> unit) -> subst:(Mod_subst.substitution * 'a -> 'a) option -> discharge:(object_name * 'a -> 'a option) -> 'a object_declaration val global_object_nodischarge : string -> cache:(object_name * 'a -> unit) -> subst:(Mod_subst.substitution * 'a -> 'a) option -> 'a object_declaration val superglobal_object : string -> cache:(object_name * 'a -> unit) -> subst:(Mod_subst.substitution * 'a -> 'a) option -> discharge:(object_name * 'a -> 'a option) -> 'a object_declaration val superglobal_object_nodischarge : string -> cache:(object_name * 'a -> unit) -> subst:(Mod_subst.substitution * 'a -> 'a) option -> 'a object_declaration (** {6 Debug} *) val dump : unit -> (int * string) list