(************************************************************************) (* * 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
(** state-transaction-machine interface *)
(* Flags *)
module AsyncOpts : sig
type cache = Force type async_proofs = APoff
| APonLazy (* Delays proof checking, but does it in master *)
| APon type tac_error_filter = FNone | FOnly ofstringlist | FAll
val default_opts : spawn_args:stringlist -> stm_opt
end
(** The STM document type [stm_doc_type] determines some properties suchaswhatuncompletedproofsareallowedandwhatgetsrecorded
to aux files. *) type stm_doc_type =
| VoDoc ofstring(* file path *)
| VosDoc ofstring(* file path *)
| Interactive of Coqargs.top (* module path *)
(** STM initialization options: *) type stm_init_options =
{ doc_type : stm_doc_type (** The STM does set some internal flags differently depending on thespecified[doc_type].Thisdistinctionshoulddisappearat
some some point. *)
; injections : Coqargs.injection_command list (** Injects Require and Set/Unset commands before the initial
state is ready *)
}
(** The type of a STM document *) type doc
(** [init_process] performs some low-level initialization, call early *) val init_process : AsyncOpts.stm_opt -> unit
(** [init_core] snapshots the initial system state *) val init_core : unit -> unit
(** [new_doc opt] Creates a new document with options [opt] *) val new_doc : stm_init_options -> doc * Stateid.t
(** [parse_sentence sid entry pa] Reads a sentence from [pa] with parsing state [sid]andnonterminal[entry].[entry]receivesininputthecurrentproof mode.[sid]shouldbeassociatedwithavalidparsingstate(whichmaynot
be the case if an error was raised at parsing time). *) val parse_sentence :
doc:doc -> Stateid.t ->
entry:(Pvernac.proof_mode option -> 'a Procq.Entry.t) -> Procq.Parsable.t -> 'a
(* Reminder: A parsable [pa] is constructed using
[Procq.Parsable.t stream], where [stream : char Stream.t]. *)
type add_focus = NewAddTip | Unfocus of Stateid.t
(* [add ~ontop ?newtip verbose cmd] adds a new command [cmd] ontop of thestate[ontop]. The[ontop]parameterjustassertsthattheGUIison sync,butitwilleventuallycalledit_atontheflyifneeded. If[newtip]isprovided,thenthereturnedstateidisguaranteed
to be [newtip] *) val add : doc:doc -> ontop:Stateid.t -> ?newtip:Stateid.t -> bool -> Vernacexpr.vernac_control ->
doc * Stateid.t * add_focus
(* Returns the proof state before the last tactic that was applied at or before thespecifiedstateANDthathasdifferencesintheunderlyingproof(i.e.,
ignoring proofview-only changes). Used to compute proof diffs. *) val get_prev_proof : doc:doc -> Stateid.t -> Proof.t option
val get_proof : doc:doc -> Stateid.t -> Proof.t option
(* [query at ?report_with cmd] Executes [cmd] at a given state [at], throwingawaysideeffectsexceptmessages.Feedbackwill
be sent with [report_with], which defaults to the dummy state id *) val query : doc:doc ->
at:Stateid.t -> route:Feedback.route_id -> Procq.Parsable.t -> unit
(* [edit_at id] is issued to change the editing zone. [NewTip] is returned if therequestedidisthenewdocumenttiphencethedocumentportionfollowing [id]isdroppedbyRocq.[`Focusfo]isreturnedtosaythat[fo.tip]isthe newdocumenttip,thedocumentbetween[id]and[fo.stop]hasbeendropped. Theportionbetween[fo.stop]and[fo.tip]hasbeenkept.[fo.start]is justtotelltheguiwheretheeditingzonestarts,incaseitwantsto graphicallydenoteit.Allsubsequent[add]happenontopof[id]. IfFlags.async_proofs_fullisset,then[id]isnot[observe]d,elseitis.
*) type focus = { start : Stateid.t; stop : Stateid.t; tip : Stateid.t } type edit_focus = NewTip | Focus of focus val edit_at : doc:doc -> Stateid.t -> doc * edit_focus
(* [observe doc sid]] Check / execute span [sid] *) val observe : doc:doc -> Stateid.t -> unit
(* [finish doc] Fully checks a document up to the "current" tip. *) val finish : doc:doc -> Vernacstate.t
(* Internal use (fake_ide) only, do not use *) val wait : doc:doc -> unit
val stop_worker : string -> unit
(* Joins the entire document. Implies finish, but also checks proofs *) val join : doc:doc -> unit
(* Saves on the disk a .vos file. *) val snapshot_vos : doc:doc -> output_native_objects:bool -> DirPath.t -> string -> unit
(* Empties the task queue, can be used only if the worker pool is empty (E.g.
* after having built a .vos in batch mode *) val reset_task_queue : unit -> unit
type document
(* Id of the tip of the current branch *) val get_current_state : doc:doc -> Stateid.t val get_ldir : doc:doc -> Names.DirPath.t
(* This returns the node at that position *) val get_ast : doc:doc -> Stateid.t -> Vernacexpr.vernac_control option
(* Filename *) val set_compilation_hints : string -> unit
(* A proof block delimiter defines a syntactic delimiter for sub proofs that,whencontainanerror,donotimpacttherestoftheproof. Whilecheckingaproof,ifanerroroccursina(valid)blockthen processingcanskiptheentireblockandgoontogivefeedback ontherestoftheproof.
(* From the master (or worker, but beware that to install the hook *intoaworkeronehastobuildtheworkertoplooptodosoand *thealternativetoploopfortheworkercanbeselectedbychanging
* the name of the Task(s) above) *)
val state_computed_hook : (doc:doc -> Stateid.t -> in_cache:bool -> unit) -> unit val unreachable_state_hook : (doc:doc -> Stateid.t -> Exninfo.iexn -> unit) -> unit
(* ready means that master has it at hand *) val state_ready_hook : (doc:doc -> Stateid.t -> unit) -> unit
(* Messages from the workers to the master *) val forward_feedback_hook : (Feedback.feedback -> unit) -> unit
(* *HooksintotheUIforplugins(notforgeneraluse)
*)
(** User adds a sentence to the document (after parsing) *) val document_add_hook : (Vernacexpr.vernac_control -> Stateid.t -> unit) -> unit
(** User edits a sentence in the document *) val document_edit_hook : (Stateid.t -> unit) -> unit
(** User requests evaluation of a sentence *) val sentence_exec_hook : (Stateid.t -> unit) -> unit
val get_doc : Feedback.doc_id -> doc
type state = Valid of Vernacstate.t option | Expired | Error of exn
val state_of_id : doc:doc ->
Stateid.t -> state
(* Queries for backward compatibility *) val current_proof_depth : doc:doc -> int val get_all_proof_names : doc:doc -> Id.t list
(** Enable STM debugging *) val stm_debug : boolref
val backup : unit -> document val restore : document -> unit
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-09-28)
¤
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.