open DisambiguateTypes
-(** {2 Choice registration interface} *)
+(** {2 Disambiguation interface} *)
- (** to be raised when a choice is invalid due to some given parameter (e.g.
- * wrong number of Cic.term arguments received) *)
-exception Invalid_choice
+exception NoWellTypedInterpretation
- (** register a new symbol choice *)
-val add_symbol_choice: string -> codomain_item -> unit
+module type Disambiguator =
+sig
+ val disambiguate_term :
+ dbd:Mysql.dbd ->
+ context:Cic.context ->
+ metasenv:Cic.metasenv ->
+ ?initial_ugraph:CicUniv.universe_graph ->
+ aliases:environment -> (* previous interpretation status *)
+ CicAst.term ->
+ (environment * (* new interpretation status *)
+ Cic.metasenv * (* new metasenv *)
+ Cic.term*
+ CicUniv.universe_graph) list (* disambiguated term *)
+end
- (** register a new number choice *)
-val add_num_choice: codomain_item -> unit
+module Make (C : Callbacks) : Disambiguator
-(** {2 Disambiguation interface} *)
-
-exception NoWellTypedInterpretation
+module Trivial:
+sig
+ exception Ambiguous_term of string
-module Make (C : Callbacks) :
- sig
- val disambiguate_term :
- MQIConn.handle ->
- Cic.context ->
- Cic.metasenv ->
- CicTextualParser2Ast.term ->
- aliases:environment -> (* previous interpretation status *)
- environment * (* new interpretation status *)
- Cic.metasenv * (* new metasenv *)
- Cic.term (* disambiguated term *)
- end
+ (** disambiguate an _unanmbiguous_ term using dummy callbacks which fail if a
+ * choice from the user is needed to disambiguate the term
+ * @raise Ambiguous_term for ambiguous term *)
+ val disambiguate_string:
+ dbd:Mysql.dbd ->
+ ?context:Cic.context ->
+ ?metasenv:Cic.metasenv ->
+ ?initial_ugraph:CicUniv.universe_graph ->
+ ?aliases:environment -> (* previous interpretation status *)
+ string ->
+ (environment * (* new interpretation status *)
+ Cic.metasenv * (* new metasenv *)
+ Cic.term *
+ CicUniv.universe_graph) list (* disambiguated term *)
+end