X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_disambiguation%2Fdisambiguate.mli;h=78fe417683e33dd6e03cce852851cfa608cf86cd;hb=3007de3f032ea2349cb2f8fffc76b18d26895f36;hp=4a8f90b00303eeb771c6cb15e5739992e1ca3e78;hpb=6809084b2a99a1a7e64d87ca939118f77c07b8b5;p=helm.git diff --git a/helm/software/components/cic_disambiguation/disambiguate.mli b/helm/software/components/cic_disambiguation/disambiguate.mli index 4a8f90b00..78fe41768 100644 --- a/helm/software/components/cic_disambiguation/disambiguate.mli +++ b/helm/software/components/cic_disambiguation/disambiguate.mli @@ -26,27 +26,74 @@ (** {2 Disambiguation interface} *) (* the integer is an offset to be added to each location *) +(* list of located error messages, each list is a tuple: + * - environment in string form + * - environment patch + * - location + * - error message + * - significancy of the error message, if false the error is likely to be + * useless for the final user ... *) exception NoWellTypedInterpretation of int * - ((Token.flocation list * string * string) list * + ((Stdpp.location list * string * string) list * (DisambiguateTypes.domain_item * DisambiguateTypes.codomain_item) list * - Token.flocation option * string Lazy.t) list + Stdpp.location option * string Lazy.t * bool) list exception PathNotWellFormed val interpretate_path : - context:Cic.name list -> CicNotationPt.term -> - Cic.term + context:Cic.name list -> CicNotationPt.term -> Cic.term type 'a disambiguator_input = string * int * 'a +type domain = domain_tree list +and domain_tree = + Node of Stdpp.location list * DisambiguateTypes.domain_item * domain +type ('a,'m) test_result = + | Ok of 'a * 'm + | Ko of Stdpp.location option * string Lazy.t + | Uncertain of Stdpp.location option * string Lazy.t +exception Try_again of string Lazy.t + +val domain_of_ast_term: context:Cic.name list -> CicNotationPt.term -> domain + module type Disambiguator = sig + val disambiguate_thing: + dbd:HSql.dbd -> + context:'context -> + metasenv:'metasenv -> + initial_ugraph:'ugraph -> + aliases:DisambiguateTypes.codomain_item DisambiguateTypes.Environment.t -> + universe:DisambiguateTypes.codomain_item list + DisambiguateTypes.Environment.t option -> + uri:'uri -> + pp_thing:('ast_thing -> string) -> + domain_of_thing:(context:'context -> 'ast_thing -> domain) -> + interpretate_thing:(context:'context -> + env:DisambiguateTypes.codomain_item + DisambiguateTypes.Environment.t -> + uri:'uri -> + is_path:bool -> + 'ast_thing -> + localization_tbl:'cichash -> 'raw_thing) -> + refine_thing:('metasenv -> + 'context -> + 'uri -> + 'raw_thing -> + 'ugraph -> localization_tbl:'cichash -> ('refined_thing, + 'metasenv) test_result * 'ugraph) -> + localization_tbl:'cichash -> + string * int * 'ast_thing -> + ((DisambiguateTypes.Environment.key * DisambiguateTypes.codomain_item) + list * 'metasenv * 'refined_thing * 'ugraph) + list * bool + (** @param fresh_instances when set to true fresh instances will be generated * for each number _and_ symbol in the disambiguation domain. Instances of the * input AST will be ignored. Defaults to false. *) val disambiguate_term : ?fresh_instances:bool -> - dbd:HMysql.dbd -> + dbd:HSql.dbd -> context:Cic.context -> metasenv:Cic.metasenv -> ?initial_ugraph:CicUniv.universe_graph -> @@ -62,16 +109,17 @@ sig (** @param fresh_instances as per disambiguate_term *) val disambiguate_obj : ?fresh_instances:bool -> - dbd:HMysql.dbd -> + dbd:HSql.dbd -> aliases:DisambiguateTypes.environment ->(* previous interpretation status *) universe:DisambiguateTypes.multiple_environment option -> uri:UriManager.uri option -> (* required only for inductive types *) - CicNotationPt.obj disambiguator_input -> + CicNotationPt.term CicNotationPt.obj disambiguator_input -> ((DisambiguateTypes.domain_item * DisambiguateTypes.codomain_item) list * Cic.metasenv * (* new metasenv *) Cic.obj * CicUniv.universe_graph) list * (* disambiguated obj *) bool (* has interactive_interpretation_choice been invoked? *) + end module Make (C : DisambiguateTypes.Callbacks) : Disambiguator