Debian Codegraph @

interp/abbreviation.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 open Names
12 open Notationextern
13
14 (** Abbreviations *)
15
16 (** Representation of the data associated to an abbreviation. *)
17 type data
18
19 (** [interp a] gives the interpretation of abbreviation [a]. *)
20 val interp : data -> Notation_term.interpretation
21
22 (** [full_path a] gives the full path of abbreviation [a]. *)
23 val full_path : data -> Libnames.full_path
24
25 (** [enabled a] indicates whether the abbreviation [a] is enabled. *)
26 val enabled : data -> bool
27
28 (** [only_parsing a] indicates whether the abbreviation [a] is only used for
29 parsing, and not for printing. *)
30 val only_parsing : data -> bool
31
32 (** [fold f acc] folds function [f] over the current abbreviation map, using
33 [acc] as the initial accumulator value. *)
34 val fold : (Globnames.abbreviation -> data -> 'a -> 'a) -> 'a -> 'a
35
36 (** [find_opt k] gives the abbreviation associated with the key [k] in the
37 abbreviation map, if there is one. *)
38 val find_opt : Globnames.abbreviation -> data option
39
40 (** [find_interp k] gives the interpretation of the abbreviation associated
41 with the key [k] in the abbreviation map. The [Not_found] exception is
42 raised if [k] is not mapped. *)
43 val find_interp : Globnames.abbreviation -> Notation_term.interpretation
44
45 (** [toggle ~on ~use key] actives (if [on]) or deactivates (if [not on]) the
46 abbreviation with the given [key]. An abbreviation associated with [key]
47 should exist, otherwise [Not_found] is raised. *)
48 val toggle : on:bool -> use:notation_use -> Globnames.abbreviation -> unit
49
50 (** [toggle_if ~on ~use pred] is equivalent to running [toggle ~on ~use] on
51 all abbreviations satisfying the given predicate [pred]. *)
52 val toggle_if : on:bool -> use:notation_use ->
53 (Globnames.abbreviation -> data -> bool) -> unit
54
55 val declare : local:Libobject.locality ->
56 Globnames.extended_global_reference UserWarn.with_qf option -> Id.t ->
57 onlyparsing:bool -> Notation_term.interpretation -> unit
58
59 val import : int -> Libnames.full_path -> Globnames.abbreviation -> unit