Debian Codegraph @

vernac/vernactypes.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 (** Interpretation of extended vernac phrases. *)
11
12 module Prog : sig
13 type state = Declare.OblState.t
14 type stack = state NeList.t
15
16 type (_,_) t =
17 | Ignore : (unit, unit) t
18 | Modify : (state, state) t
19 | Read : (state, unit) t
20 | Push : (unit, unit) t
21 | Pop : (state, unit) t
22 end
23
24 module Proof : sig
25 type state = Declare.Proof.t
26
27 type (_,_) t =
28 | Ignore : (unit, unit) t
29 | Modify : (state, state) t
30 | Read : (state, unit) t
31 | ReadOpt : (state option, unit) t
32 | Reject : (unit, unit) t
33 | Close : (state, unit) t
34 | Open : (unit, state) t
35 end
36
37 module OpaqueAccess : sig
38 type _ t =
39 | Ignore : unit t
40 | Access : Global.indirect_accessor t
41 end
42
43 type ('prog,'proof,'opaque_access) state_gen = {
44 prog : 'prog;
45 proof : 'proof;
46 opaque_access : 'opaque_access;
47 }
48
49 type no_state = (unit, unit, unit) state_gen
50 val no_state : no_state
51 (** Useful for patterns like [{ no_state with proof = newproof }] when
52 modifying a subset of the state. *)
53
54 val ignore_state : ((unit, unit) Prog.t, (unit, unit) Proof.t, unit OpaqueAccess.t) state_gen
55
56 type 'r typed_vernac_gen =
57 TypedVernac : {
58 spec : (('inprog, 'outprog) Prog.t,
59 ('inproof, 'outproof) Proof.t,
60 'inaccess OpaqueAccess.t) state_gen;
61 run : ('inprog, 'inproof, 'inaccess) state_gen -> ('outprog, 'outproof, unit) state_gen * 'r;
62 } -> 'r typed_vernac_gen
63
64 type typed_vernac = unit typed_vernac_gen
65
66 val typed_vernac_gen
67 : (('inprog, 'outprog) Prog.t, ('inproof, 'outproof) Proof.t, 'inaccess OpaqueAccess.t) state_gen
68 -> (('inprog, 'inproof, 'inaccess) state_gen -> ('outprog, 'outproof, unit) state_gen * 'r)
69 -> 'r typed_vernac_gen
70
71 val map_typed_vernac : ('a -> 'b) -> 'a typed_vernac_gen -> 'b typed_vernac_gen
72
73 val typed_vernac
74 : (('inprog, 'outprog) Prog.t, ('inproof, 'outproof) Proof.t, 'inaccess OpaqueAccess.t) state_gen
75 -> (('inprog, 'inproof, 'inaccess) state_gen -> ('outprog, 'outproof, unit) state_gen)
76 -> typed_vernac
77
78 type full_state = (Prog.stack, Vernacstate.LemmaStack.t option, unit) state_gen
79
80 val run : 'r typed_vernac_gen -> full_state -> full_state * 'r
81
82 (** Some convenient typed_vernac constructors. Used by coqpp. *)
83
84 val vtdefault : (unit -> unit) -> typed_vernac
85 val vtnoproof : (unit -> unit) -> typed_vernac
86 val vtcloseproof : (lemma:Declare.Proof.t -> pm:Declare.OblState.t -> Declare.OblState.t) -> typed_vernac
87 val vtopenproof : (unit -> Declare.Proof.t) -> typed_vernac
88 val vtmodifyproof : (pstate:Declare.Proof.t -> Declare.Proof.t) -> typed_vernac
89 val vtreadproofopt : (pstate:Declare.Proof.t option -> unit) -> typed_vernac
90 val vtreadproof : (pstate:Declare.Proof.t -> unit) -> typed_vernac
91 val vtreadprogram : (pm:Declare.OblState.t -> unit) -> typed_vernac
92 val vtmodifyprogram : (pm:Declare.OblState.t -> Declare.OblState.t) -> typed_vernac
93 val vtdeclareprogram : (pm:Declare.OblState.t -> Declare.Proof.t) -> typed_vernac
94 val vtopenproofprogram : (pm:Declare.OblState.t -> Declare.OblState.t * Declare.Proof.t) -> typed_vernac
95 val vtopaqueaccess : (opaque_access:Global.indirect_accessor -> unit) -> typed_vernac