* http://helm.cs.unibo.it/
*)
+open Printf
+
open Disambiguate_types
+open UriManager
exception Invalid_choice
exception No_choices of domain_item
let refine metasenv context term =
let metasenv, term = CicMkImplicit.expand_implicits metasenv context term in
+ debug_print (sprintf "TEST_INTERPRETATION: %s" (CicPp.ppterm term));
try
let term', _, _, metasenv' = CicRefine.type_of_aux' metasenv context term in
Ok (term', metasenv')
debug_print ("%%% PRUNED!!! " ^ CicPp.ppterm term) ;
Ko
-open Printf
-
-open UriManager
-
let indtyuri_of_uri uri =
let index_sharp = String.index uri '#' in
let index_num = index_sharp + 3 in
match resolve env (Id indty_ident) () with
| Cic.MutInd (uri, tyno, _) -> uri, tyno
| Cic.Implicit -> raise Try_again
- | _ -> Parser.fail loc ("Not an inductive type: " ^ indty_ident)
+ | _ -> raise Invalid_choice
in
Cic.MutCase (indtype_uri, indtype_no, cic_outtype, cic_term,
(List.map do_branch branches))
let cic_term =
interpretate ~context:disambiguate_context ~env:filled_env term
in
- debug_print
- (sprintf "TEST_INTERPRETATION: %s" (CicPp.ppterm cic_term));
refine metasenv context cic_term
with
| Try_again -> Uncertain