diff options
Diffstat (limited to 'toplevel/search.mli')
-rw-r--r-- | toplevel/search.mli | 87 |
1 files changed, 54 insertions, 33 deletions
diff --git a/toplevel/search.mli b/toplevel/search.mli index b6cca47d..f69489c3 100644 --- a/toplevel/search.mli +++ b/toplevel/search.mli @@ -1,6 +1,6 @@ (************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) -(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2014 *) +(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2015 *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) @@ -11,8 +11,7 @@ open Names open Term open Environ open Pattern -open Libnames -open Nametab +open Globnames (** {6 Search facilities. } *) @@ -20,33 +19,55 @@ type glob_search_about_item = | GlobSearchSubPattern of constr_pattern | GlobSearchString of string -val search_by_head : constr -> dir_path list * bool -> unit -val search_rewrite : constr -> dir_path list * bool -> unit -val search_pattern : constr -> dir_path list * bool -> unit -val search_about : - (bool * glob_search_about_item) list -> dir_path list * bool -> unit - -(** The filtering function that is by standard search facilities. - It can be passed as argument to the raw search functions. - It is used in pcoq. *) - -val filter_by_module_from_list : - dir_path list * bool -> global_reference -> env -> 'a -> bool - -val filter_blacklist : global_reference -> env -> constr -> bool - -(** raw search functions can be used for various extensions. - They are also used for pcoq. *) -val gen_filtered_search : (global_reference -> env -> constr -> bool) -> - (global_reference -> env -> constr -> unit) -> unit -val filtered_search : (global_reference -> env -> constr -> bool) -> - (global_reference -> env -> constr -> unit) -> global_reference -> unit -val raw_pattern_search : (global_reference -> env -> constr -> bool) -> - (global_reference -> env -> constr -> unit) -> constr_pattern -> unit -val raw_search_rewrite : (global_reference -> env -> constr -> bool) -> - (global_reference -> env -> constr -> unit) -> constr_pattern -> unit -val raw_search_about : (global_reference -> env -> constr -> bool) -> - (global_reference -> env -> constr -> unit) -> - (bool * glob_search_about_item) list -> unit -val raw_search_by_head : (global_reference -> env -> constr -> bool) -> - (global_reference -> env -> constr -> unit) -> constr_pattern -> unit +type filter_function = global_reference -> env -> constr -> bool +type display_function = global_reference -> env -> constr -> unit + +(** {6 Generic filter functions} *) + +val blacklist_filter : filter_function +(** Check whether a reference is blacklisted. *) + +val module_filter : DirPath.t list * bool -> filter_function +(** Check whether a reference pertains or not to a set of modules *) + +val search_about_filter : glob_search_about_item -> filter_function +(** Check whether a reference matches a SearchAbout query. *) + +(** {6 Specialized search functions} + +[search_xxx gl pattern modinout] searches the hypothesis of the [gl]th +goal and the global environment for things matching [pattern] and +satisfying module exclude/include clauses of [modinout]. *) + +val search_by_head : int option -> constr_pattern -> DirPath.t list * bool -> std_ppcmds +val search_rewrite : int option -> constr_pattern -> DirPath.t list * bool -> std_ppcmds +val search_pattern : int option -> constr_pattern -> DirPath.t list * bool -> std_ppcmds +val search_about : int option -> (bool * glob_search_about_item) list + -> DirPath.t list * bool -> std_ppcmds + +type search_constraint = + (** Whether the name satisfies a regexp (uses Ocaml Str syntax) *) + | Name_Pattern of string + (** Whether the object type satisfies a pattern *) + | Type_Pattern of string + (** Whether some subtype of object type satisfies a pattern *) + | SubType_Pattern of string + (** Whether the object pertains to a module *) + | In_Module of string list + (** Bypass the Search blacklist *) + | Include_Blacklist + +type 'a coq_object = { + coq_object_prefix : string list; + coq_object_qualid : string list; + coq_object_object : 'a; +} + +val interface_search : (search_constraint * bool) list -> + string coq_object list + +(** {6 Generic search function} *) + +val generic_search : int option -> display_function -> unit +(** This function iterates over all hypothesis of the goal numbered + [glnum] (if present) and all known declarations. *) |