Debian Codegraph @

vernac/search.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 Constr
13 open Environ
14 open Pattern
15 open Vernacexpr
16
17 (** {6 Search facilities. } *)
18
19 type glob_search_item =
20 | GlobSearchSubPattern of glob_search_where * bool * constr_pattern
21 | GlobSearchString of string
22 | GlobSearchKind of Decls.logical_kind
23 | GlobSearchFilter of (GlobRef.t -> bool)
24
25 type glob_search_request =
26 | GlobSearchLiteral of glob_search_item
27 | GlobSearchDisjConj of (bool * glob_search_request) list list
28
29 type filter_function =
30 GlobRef.t -> Decls.logical_kind option -> env -> Evd.evar_map -> constr -> bool
31 type display_function =
32 GlobRef.t -> Decls.logical_kind option -> env -> Evd.evar_map -> constr -> unit
33
34 (** {6 Generic filter functions} *)
35
36 val blacklist_filter : filter_function
37 (** Check whether a reference is blacklisted. *)
38
39 val module_filter : Libnames.full_path list search_restriction -> filter_function
40 (** Check whether a reference pertains or not to a set of modules *)
41
42 val search_filter : glob_search_item -> filter_function
43
44 (** {6 Specialized search functions}
45
46 [search_xxx gl pattern modinout] searches the hypothesis of the [gl]th
47 goal and the global environment for things matching [pattern] and
48 satisfying module exclude/include clauses of [modinout]. *)
49
50 val search_rewrite : env -> Evd.evar_map -> constr_pattern -> Libnames.full_path list search_restriction
51 -> display_function -> unit
52 val search_pattern : env -> Evd.evar_map -> constr_pattern -> Libnames.full_path list search_restriction
53 -> display_function -> unit
54 val search : env -> Evd.evar_map -> (bool * glob_search_request) list
55 -> Libnames.full_path list search_restriction -> display_function -> unit
56
57 type search_constraint =
58 | Name_Pattern of Str.regexp
59 (** Whether the name satisfies a regexp (uses Ocaml Str syntax) *)
60 | Type_Pattern of Pattern.constr_pattern
61 (** Whether the object type satisfies a pattern *)
62 | SubType_Pattern of Pattern.constr_pattern
63 (** Whether some subtype of object type satisfies a pattern *)
64 | In_Module of Libnames.full_path
65 (** Whether the object pertains to a module *)
66 | Include_Blacklist
67 (** Bypass the Search blacklist *)
68
69 type 'a coq_object = {
70 coq_object_prefix : string list;
71 coq_object_qualid : string list;
72 coq_object_object : 'a;
73 }
74
75 val interface_search : env -> Evd.evar_map -> (search_constraint * bool) list -> constr coq_object list
76
77 (** {6 Generic search function} *)
78
79 val generic_search : env -> Evd.evar_map -> display_function -> unit
80 (** This function iterates over all hypothesis of the goal numbered
81 [glnum] (if present) and all known declarations. *)
82
83 (** {6 Search function modifiers} *)
84
85 val prioritize_search : (display_function -> unit) -> display_function -> unit
86 (** [prioritize_search iter] iterates over the values of [iter] (seen
87 as a sequence of declarations), in a relevance order. This requires to
88 perform the entire iteration of [iter] before starting streaming. So
89 [prioritize_search] should not be used for low-latency streaming. *)