Debian Codegraph @

lib/stateid.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 type t
12
13 val equal : t -> t -> bool
14 val compare : t -> t -> int
15
16 module Self : Map.OrderedType with type t = t
17 module Set : Set.S with type elt = t and type t = Set.Make(Self).t
18
19 val initial : t
20 val dummy : t
21 val fresh : unit -> t
22 val to_string : t -> string
23 val print : t -> Pp.t
24
25 val of_int : int -> t
26 val to_int : t -> int
27
28 val newer_than : t -> t -> bool
29
30 (* Attaches to an exception the concerned state id, plus an optional
31 * state id that is a valid state id before the error.
32 * Backtracking to the valid id is safe. *)
33 val add : Exninfo.info -> valid:t -> t -> Exninfo.info
34 val get : Exninfo.info -> (t * t) option
35
36 type exn_info = { id : t; valid : t }
37
38 type ('a,'b) request = {
39 exn_info : exn_info;
40 stop : t;
41 document : 'b;
42 loc : Loc.t option;
43 uuid : 'a;
44 name : string
45 }
46
47 (* Asks the document manager if the given state is valid (or belongs to an
48 old version of the document) *)
49 val is_valid : doc:int -> t -> bool
50
51 (* By default [is_valid] always answers true, but a document manager supporting
52 undo operations like the STM can override this. *)
53 val set_is_valid : (doc:int -> t -> bool) -> unit