(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
open Names open Mod_subst
(** [Libobject] declares persistent objects, given with methods:
(** Both names are passed to objects: a "semantic" [kernel_name], which canbesubstitutedanda"syntactic"[full_path]whichcanbeprinted
*)
type object_name = Libnames.full_path * KerName.t
type open_filter
type ('a,'b,'discharged) object_declaration = {
object_name : string;
object_stage : Summary.Stage.t;
cache_function : 'b -> unit;
load_function : int -> 'b -> unit;
open_function : open_filter -> int -> 'b -> unit;
classify_function : 'a -> substitutivity;
subst_function : substitution * 'a -> 'a;
discharge_function : 'a -> 'discharged option;
rebuild_function : 'discharged -> 'a;
}
val unfiltered : open_filter
val make_filter : finite:bool -> string CAst.t list -> open_filter (** Anomaly when the list is empty. *)
type category
val create_category : string -> category (** Anomaly if called more than once for a given string. *)
val in_filter : cat:category option -> open_filter -> bool (** On [cat:None], returns whether the filter allows opening uncategorizedobjects.
On[cat:(Somecategory)],returnswhetherthefilterallows
opening objects in the given [category]. *)
val filtered_open : ?cat:category -> ('i -> 'a -> unit) ->
open_filter -> 'i -> 'a -> unit (** Combinator for making objects with simple category-based open behaviour.When[cat:None],canbeopenedbyUnfiltered,butalso
by Filtered with a negative set. *)
val simple_open : ?cat:category -> ('a -> unit) ->
open_filter -> int -> 'a -> unit (** Like [filtered_open], and also requires the int to be 1 to
actually open. *)
val filter_eq : open_filter -> open_filter -> bool
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
(** The default object has empty methods. Objectcreatorsareadvisedtousetheconstruction [{(default_object"MY_OBJECT")with cache_function=... }] andspecifyonlythesefunctionswhicharenotempty/meaningless
Theclassify_functionmustbespecified.
*)
val default_object : ?stage:Summary.Stage.t -> string -> ('a,'b,'a) object_declaration
(** the identity substitution function *) val ident_subst_function : substitution * 'a -> 'a
(** {6 ... } *) (** Given an object declaration, the function [declare_object_full] willhandbacktwofunctions,the"injection"and"projection"
functions for dynamically typed library-objects. *)
module Dyn : Dyn.S
type obj = Dyn.t
module ExportObj : sig type t = { mpl : (open_filter * Names.ModPath.t) list } [@@unboxed] end
type ('subs, 'alg, 'keep, 'escape) object_view =
| ModuleObject of Id.t * 'subs
| ModuleTypeObject of Id.t * 'subs
| IncludeObject of'alg
| KeepObject of Id.t * 'keep
| EscapeObject of Id.t * 'escape
| ExportObject of ExportObj.t
| AtomicObject of obj
(* there are some extra invariants we could try to enforce by typing: -substitutive_objectsdonotcontainKeepObjectandEscapeObject -KeepObjectonlycontainsitselfandatoms
- EscapeObject only contains itself and atoms *) type t = (substitutive_objects, algebraic_objects, keep_objects, escape_objects) object_view
and algebraic_objects =
| Objs of t list
| Refof Names.ModPath.t * Mod_subst.substitution
and substitutive_objects = Names.MBId.t list * algebraic_objects
and keep_objects = { keep_objects : t list }
and escape_objects = { escape_objects : t list }
(** Object declaration and names: if you need the current prefix (typicallytointeractwiththenametab),youneedtohaveit passedtoyou.
val declare_named_object :
('a, object_name * 'a, _) object_declaration -> (Id.t -> 'a -> obj)
(** Object prefix morally contains the "prefix" naming of an object to bestoredby[library],where[obj_path]isthe"absolute"pathand [obj_mp]isthecurrent"module"prefix.
val cache_object : object_prefix * obj -> unit val load_object : int -> object_prefix * obj -> unit val open_object : open_filter -> int -> object_prefix * obj -> unit val subst_object : substitution * obj -> obj val classify_object : obj -> substitutivity val object_stage : obj -> Summary.Stage.t
type discharged_obj
val discharge_object : obj -> discharged_obj option val rebuild_object : discharged_obj -> obj
type locality = Local | Export | SuperGlobal
(** Object with semi-static scoping: the scoping depends on the given [locality]nottherestoftheobject.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.