* http://helm.cs.unibo.it/
*)
-open Disambiguate_struct
open Disambiguate_types
-type interpretation_domain = Domain.t
-type domain_and_interpretation = interpretation_domain * interpretation
+ (* TODO move to CicSomething *)
+val term_of_uri: string -> Cic.term
-(*
-val add_symbol_choice:
- string -> string * interpretation_codomain_item -> unit
-val add_symbol_choices:
- string -> (string * interpretation_codomain_item) list -> unit
+(** {2 Choice registration interface} *)
-val add_num_choice: string * interpretation_codomain_item -> unit
-*)
+ (** 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
-module Make (C : Callbacks) :
- sig
- exception NoWellTypedInterpretation
-
- val disambiguate_input :
- MQIConn.handle -> Cic.context -> Cic.metasenv ->
- interpretation_domain -> (* items occuring in parser output *)
- (interpretation -> Cic.term) -> (* parser output *)
- domain_and_interpretation -> (* current interpretation status *)
- domain_and_interpretation * Cic.metasenv * Cic.term
- (* new interpretstaion status, new metasenv, disambiguated term *)
- end
+ (** register a new symbol choice *)
+val add_symbol_choice: string -> codomain_item -> unit
- (* TODO move to CicSomething *)
-val term_of_uri: string -> Cic.term
+ (** register a new number choice *)
+val add_num_choice: codomain_item -> unit
+
+(** {2 Disambiguation interface} *)
-val interpretate:
- context: Cic.name option list -> interp: interpretation -> Ast.term ->
- Cic.term
+exception NoWellTypedInterpretation
+
+module Make (C : Callbacks) :
+ sig
+ val disambiguate_term :
+ MQIConn.handle ->
+ Cic.context ->
+ Cic.metasenv ->
+ Ast.term ->
+ aliases:environment -> (* previous interpretation status *)
+ environment * (* new interpretation status *)
+ Cic.metasenv * (* new metasenv *)
+ Cic.term (* disambiguated term *)
+ end