Debian Codegraph @

vernac/vernacstate.mli

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 (** Synterp State, includes parser state, etc... ; as of today the
12 parsing state has no functional components. *)
13 module Synterp : sig
14
15 type t
16
17 val init : unit -> t
18 val freeze : unit -> t
19 val unfreeze : t -> unit
20 val parsing : t -> Procq.frozen_t
21 end
22
23 module System : sig
24 (** [protect f x] runs [f x] and discards changes in the system state
25 (both [Synterp.t] and [Interp.System.t]). It doesn't touch the
26 proof functional state in [Interp.t] *)
27 val protect : ('a -> 'b) -> 'a -> 'b
28 end
29
30 module LemmaStack : sig
31
32 type t
33
34 val pop : t -> Declare.Proof.t * t option
35 val push : t option -> Declare.Proof.t -> t
36
37 val map : f:(Declare.Proof.t -> Declare.Proof.t) -> t -> t
38 val map_top : f:(Declare.Proof.t -> Declare.Proof.t) -> t -> t
39 val with_top : t -> f:(Declare.Proof.t -> 'a ) -> 'a
40 val get_top : t -> Declare.Proof.t
41 val get_all_proof_names : t -> Names.Id.t list
42
43 end
44
45 module Interp : sig
46
47 module System : sig
48 type t
49 end
50
51 type t =
52 { system : System.t
53 (** summary + libstack *)
54 ; lemmas : LemmaStack.t option
55 (** proofs of lemmas currently opened *)
56 ; program : Declare.OblState.t NeList.t
57 (** program mode table. One per open module/section including the toplevel module. *)
58 ; opaques : Opaques.Summary.t
59 (** qed-terminated proofs *)
60 }
61
62 val freeze_interp_state : unit -> t
63 val unfreeze_interp_state : t -> unit
64
65 (* WARNING: Do not use, it will go away in future releases *)
66 val invalidate_cache : unit -> unit
67
68 end
69
70 type t =
71 { synterp: Synterp.t
72 ; interp: Interp.t
73 }
74
75 val freeze_full_state : unit -> t
76 val unfreeze_full_state : t -> unit
77
78 (** STM-specific state handling *)
79 module Stm : sig
80
81 (** Proof state + meta/evar counters *)
82 type pstate
83
84 val pstate : t -> pstate
85 val set_pstate : t -> pstate -> t
86
87 (** Rest of the state, unfortunately this is used in low-level so we need to expose it *)
88 type non_pstate = Summary.Synterp.frozen * Lib.Synterp.frozen * Summary.Interp.frozen * Lib.Interp.frozen
89 val non_pstate : t -> non_pstate
90
91 (** Checks if two states have the same Environ.env (physical eq) *)
92 val same_env : t -> t -> bool
93
94 (** Call [Lib.drop_objects] on the state *)
95 val make_shallow : t -> t
96 end
97
98 (* Compatibility module: Do Not Use *)
99 module Declare : sig
100
101 exception NoCurrentProof
102
103 val there_are_pending_proofs : unit -> bool
104 val get_open_goals : unit -> int
105
106 val give_me_the_proof : unit -> Proof.t
107 val give_me_the_proof_opt : unit -> Proof.t option
108 val get_current_proof_name : unit -> Names.Id.t
109
110 val map_proof : (Proof.t -> Proof.t) -> unit
111 val with_current_proof : (Proof.t -> Proof.t * 'a) -> 'a
112
113 val return_proof : unit -> Declare.Proof.closed_proof_output
114
115 val close_future_proof
116 : feedback_id:Stateid.t
117 -> Declare.Proof.closed_proof_output Future.computation
118 -> Declare.Proof.proof_object
119
120 val close_proof
121 : opaque:Vernacexpr.opacity_flag
122 -> keep_body_ucst_separate:bool
123 -> Declare.Proof.proof_object
124
125 val discard_all : unit -> unit
126 val update_sigma_univs : UGraph.t -> unit
127
128 val get_current_context : unit -> Evd.evar_map * Environ.env
129
130 val get_all_proof_names : unit -> Names.Id.t list
131
132 val copy_terminators : src:LemmaStack.t option -> tgt:LemmaStack.t option -> LemmaStack.t option
133
134 (* Low-level stuff *)
135 val get_program : unit -> Declare.OblState.t NeList.t
136 val set : LemmaStack.t option * Declare.OblState.t NeList.t -> unit
137
138 val get_pstate : unit -> Declare.Proof.t option
139
140 val unfreeze : LemmaStack.t -> unit
141
142 end
143 [@@ocaml.deprecated "(8.11) This module is internal and should not be used, instead, thread the proof state"]