From 2dfe032fd42f2489320936fe1e60c9cf7dafe8cf Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Thu, 3 Mar 2016 18:26:12 +0100 Subject: [search] Don't build intermediate lists in search. This patch converts the `search_*` functions to use an iter-style API. Consequently, the Search Vernac will produce a message for each search result, greatly improving roundtrip time as IDEs can effectively display the results in a streaming way. It also allows different printers to be used. I didn't observe a performance difference (as things seem to be dominated by printing and `Declaremods`). As a minor tweak, we make search with "Output Name Only" more efficient. Motivation: ----------- Currently, the main search API `Search.generic_search` is an effectful, iteration-based function: ```ocaml val generic_search : int option -> display_function -> unit ``` This type is imposed by `Declaremods`, which exposes an effectful, iteration-based API to traverse Coq library objects. The `Search.search_*` functions try to offer a more functional API by returning a list of pretty printing commands. They need to build an internal intermediate list for that purpose. However, this is a waste of time, as the destination of these lists is to be flushed out by the printer right away. --- dev/doc/changes.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dev') diff --git a/dev/doc/changes.txt b/dev/doc/changes.txt index 6dd7cb9707..79a0c6312a 100644 --- a/dev/doc/changes.txt +++ b/dev/doc/changes.txt @@ -256,6 +256,12 @@ define_evar_* mostly used internally in the unification engine. - `Tacexpr.TacDynamic(Loc.dummy_loc, Pretyping.constr_in c)` --> `Tacinterp.Value.of_constr c` +** Search API ** + +The main search functions now take a function iterating over the +results. This allows for clients to use streaming or more economic +printing. + ========================================= = CHANGES BETWEEN COQ V8.4 AND COQ V8.5 = ========================================= -- cgit v1.2.3 From 6b02759513b1ccc7debe87ad9ae6bc6f1341ff6c Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 21 Oct 2016 11:29:05 +0200 Subject: Remove no longer exported debug printer --- dev/top_printers.ml | 1 - 1 file changed, 1 deletion(-) (limited to 'dev') diff --git a/dev/top_printers.ml b/dev/top_printers.ml index e34385e5c3..a3d5cf5c12 100644 --- a/dev/top_printers.ml +++ b/dev/top_printers.ml @@ -215,7 +215,6 @@ let ppuniverse_subst l = pp (Univ.pr_universe_subst l) let ppuniverse_opt_subst l = pp (Universes.pr_universe_opt_subst l) let ppuniverse_level_subst l = pp (Univ.pr_universe_level_subst l) let ppevar_universe_context l = pp (Evd.pr_evar_universe_context l) -let ppconstraints_map c = pp (Universes.pr_constraints_map c) let ppconstraints c = pp (pr_constraints Level.pr c) let ppuniverseconstraints c = pp (Universes.Constraints.pr c) let ppuniverse_context_future c = -- cgit v1.2.3