1 (* Copyright (C) 2004, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 (** {2 Disambiguation interface} *)
28 (** raised when ambiguous input is found but not expected (e.g. in the batch
30 exception Ambiguous_input
32 (* the integer is an offset to be added to each location *)
33 (* list of located error messages, each list is a tuple:
34 * - environment in string form
38 * - significancy of the error message, if false the error is likely to be
39 * useless for the final user ... *)
40 exception NoWellTypedInterpretation of
42 ((Stdpp.location list * string * string) list *
43 (DisambiguateTypes.domain_item * string) list *
44 (Stdpp.location * string) Lazy.t *
46 exception PathNotWellFormed
48 type 'a disambiguator_input = string * int * 'a
50 type domain = domain_tree list
52 Node of Stdpp.location list * DisambiguateTypes.domain_item * domain
54 type ('term,'metasenv,'subst,'graph) test_result =
55 | Ok of 'term * 'metasenv * 'subst * 'graph
56 | Ko of (Stdpp.location * string) Lazy.t
57 | Uncertain of (Stdpp.location * string) Lazy.t
59 exception Try_again of string Lazy.t
61 val set_choose_uris_callback:
62 DisambiguateTypes.interactive_user_uri_choice_type -> unit
64 val set_choose_interp_callback:
65 DisambiguateTypes.interactive_interpretation_choice_type -> unit
67 (** @raise Ambiguous_input if called, default value for internal
68 * choose_uris_callback if not set otherwise with set_choose_uris_callback
70 val mono_uris_callback: DisambiguateTypes.interactive_user_uri_choice_type
72 (** @raise Ambiguous_input if called, default value for internal
73 * choose_interp_callback if not set otherwise with set_choose_interp_callback
75 val mono_interp_callback: DisambiguateTypes.interactive_interpretation_choice_type
78 env:'alias DisambiguateTypes.Environment.t ->
79 mk_choice:('alias -> 'term DisambiguateTypes.codomain_item) ->
80 DisambiguateTypes.Environment.key ->
81 [`Num_arg of string | `Args of 'term list] -> 'term
83 val find_in_context: string -> string option list -> int
84 val domain_of_term: context:
85 string option list -> CicNotationPt.term -> domain
87 context:string option list -> CicNotationPt.term CicNotationPt.obj -> domain
89 val disambiguate_thing:
94 string_context_of_context:('context -> string option list) ->
95 initial_ugraph:'ugraph ->
96 expty: 'refined_thing option ->
97 mk_implicit:(bool -> 'alias) ->
98 description_of_alias:('alias -> string) ->
99 fix_instance:(DisambiguateTypes.domain_item -> 'alias list -> 'alias list) ->
100 aliases:'alias DisambiguateTypes.Environment.t ->
101 universe:'alias list DisambiguateTypes.Environment.t option ->
103 DisambiguateTypes.interactive_user_uri_choice_type ->
104 DisambiguateTypes.input_or_locate_uri_type ->
105 DisambiguateTypes.Environment.key ->
108 pp_thing:('ast_thing -> string) ->
109 domain_of_thing:(context: string option list -> 'ast_thing -> domain) ->
112 env:'alias DisambiguateTypes.Environment.t ->
116 localization_tbl:'cichash ->
119 'metasenv -> 'subst -> 'context -> 'uri -> use_coercions:bool ->
120 'raw_thing -> 'refined_thing option -> 'ugraph -> localization_tbl:'cichash ->
121 ('refined_thing, 'metasenv,'subst,'ugraph) test_result) ->
122 mk_localization_tbl:(int -> 'cichash) ->
123 'ast_thing disambiguator_input ->
124 ((DisambiguateTypes.Environment.key * 'alias) list *
125 'metasenv * 'subst * 'refined_thing * 'ugraph)