X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_disambiguation%2Fdisambiguate.mli;h=99c1e45560947209b6982c4046cc51cae64f78d7;hb=1f3e810634367e2ce4b929a935ac6f3553870632;hp=a2cc0d0e7b04489333cadfb33572aa9b60dfbb49;hpb=55b82bd235d82ff7f0a40d980effe1efde1f5073;p=helm.git diff --git a/helm/software/components/cic_disambiguation/disambiguate.mli b/helm/software/components/cic_disambiguation/disambiguate.mli index a2cc0d0e7..99c1e4556 100644 --- a/helm/software/components/cic_disambiguation/disambiguate.mli +++ b/helm/software/components/cic_disambiguation/disambiguate.mli @@ -26,28 +26,77 @@ (** {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 option * string Lazy.t) list + int * + ((Stdpp.location list * string * string) list * + (DisambiguateTypes.domain_item * DisambiguateTypes.codomain_item) 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 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 -> aliases:DisambiguateTypes.environment ->(* previous interpretation status *) universe:DisambiguateTypes.multiple_environment option -> - CicNotationPt.term -> + CicNotationPt.term disambiguator_input -> ((DisambiguateTypes.domain_item * DisambiguateTypes.codomain_item) list * Cic.metasenv * (* new metasenv *) Cic.term * @@ -57,16 +106,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 -> + 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