Debian Codegraph @

vernac/classes.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 Environ
13 open Constrexpr
14 open Typeclasses
15
16 (** Instance declaration *)
17
18 val declare_instance : ?warn:bool -> env -> Evd.evar_map ->
19 hint_info option -> Hints.hint_locality -> GlobRef.t -> unit
20 (** Declares the given global reference as an instance of its type.
21 Does nothing — or emit a “not-a-class” warning if the [warn] argument is set —
22 when said type is not a registered type class. *)
23
24 val existing_instance : ?loc:Loc.t -> Hints.hint_locality -> GlobRef.t -> Vernacexpr.hint_info_expr option -> unit
25 (** globality, reference, optional priority and pattern information *)
26
27 val new_instance_interactive
28 : locality:Hints.hint_locality
29 -> poly:PolyFlags.t
30 -> name_decl
31 -> local_binder_expr list
32 -> constr_expr
33 -> ?tac:unit Proofview.tactic
34 -> ?hook:(GlobRef.t -> unit)
35 -> Vernacexpr.hint_info_expr
36 -> (bool * constr_expr) option
37 -> lident * Declare.Proof.t
38
39 val new_instance
40 : locality:Hints.hint_locality
41 -> poly:PolyFlags.t
42 -> name_decl
43 -> local_binder_expr list
44 -> constr_expr
45 -> (bool * constr_expr)
46 -> ?hook:(GlobRef.t -> unit)
47 -> Vernacexpr.hint_info_expr
48 -> lident
49
50 val new_instance_program
51 : locality:Hints.hint_locality
52 -> pm:Declare.OblState.t
53 -> poly:PolyFlags.t
54 -> name_decl
55 -> local_binder_expr list
56 -> constr_expr
57 -> (bool * constr_expr) option
58 -> ?hook:(GlobRef.t -> unit)
59 -> Vernacexpr.hint_info_expr
60 -> Declare.OblState.t * lident
61
62 val declare_new_instance
63 : locality:Hints.hint_locality
64 -> program_mode:bool
65 -> poly:PolyFlags.t
66 -> ident_decl
67 -> local_binder_expr list
68 -> constr_expr
69 -> Vernacexpr.hint_info_expr
70 -> unit
71
72 val add_class : typeclass -> unit
73
74 type instance = {
75 class_name : GlobRef.t;
76 instance : GlobRef.t;
77 info : Typeclasses.hint_info;
78 locality : Hints.hint_locality;
79 }
80
81 module Event : sig
82 type t =
83 | NewClass of typeclass
84 | NewInstance of instance
85 end
86
87 (** Activated observers are called whenever a class or an instance are declared.
88
89 [register_observer] is to be called once per process for a given
90 string, unless [override] is [true]. The registered observer is not activated.
91
92 Activation state is part of the summary. It is up to the caller to
93 use libobject for persistence if desired.
94 *)
95
96 type observer
97
98 val register_observer : name:string -> ?override:bool -> (Event.t -> unit) -> observer
99
100 val activate_observer : observer -> unit
101
102 val deactivate_observer : observer -> unit
103
104 (** Setting opacity *)
105
106 val set_typeclass_transparency
107 : ?typeclasses_db:Hints.hint_db_name ->
108 locality:Hints.hint_locality
109 -> Evaluable.t list
110 -> bool
111 -> unit
112
113 val set_typeclass_transparency_com
114 : locality:Hints.hint_locality
115 -> Libnames.qualid list
116 -> bool
117 -> unit
118
119 val set_typeclass_mode
120 : ?typeclasses_db:string ->
121 locality:Hints.hint_locality
122 -> GlobRef.t
123 -> Hints.hint_mode list
124 -> unit
125
126 (** For generation on names based on classes only *)
127
128 val refine_att : bool Attributes.attribute
129
130 (** {6 Low level interface used by Add Morphism, do not use } *)
131 module Internal :
132 sig
133 val add_instance : typeclass -> hint_info -> Hints.hint_locality -> GlobRef.t -> unit
134 end
135
136
137 (** A configurable warning to output if a default mode is used for a class declaration. *)
138 val warn_default_mode : ?loc:Loc.t -> (GlobRef.t * Hints.hint_mode list) -> unit