;;
let exists_a_meta l =
- List.exists (function Cic.Meta _ -> true | _ -> false) l
+ List.exists
+ (function
+ | Cic.Meta _
+ | Cic.Appl (Cic.Meta _::_) -> true
+ | _ -> false) l
let rec deref subst t =
let snd (_,a,_) = a in
C.Sort (C.Type u) when not test_equality_only ->
let u' = CicUniv.fresh () in
let s = C.Sort (C.Type u') in
- let ugraph2 =
- CicUniv.add_ge (upper u u') (lower u u') ugraph1
- in
- s,ugraph2
+ (try
+ let ugraph2 =
+ CicUniv.add_ge (upper u u') (lower u u') ugraph1
+ in
+ s,ugraph2
+ with
+ CicUniv.UniverseInconsistency msg ->
+ raise (UnificationFailure msg))
| _ -> t',ugraph1
in
(* Unifying the types may have already instantiated n. Let's check *)
C.Appl (C.MutInd _::_) ->
fo_unif_subst test_equality_only
subst context metasenv t1 t2' ugraph
- | _ -> raise (UnificationFailure (lazy "99")))
+ | _ -> raise
+ (UnificationFailure
+ (lazy ("not a mutind :"^CicMetaSubst.ppterm subst t2 ))))
| _ -> raise exn)))
| (C.MutCase (_,_,outt1,t1',pl1), C.MutCase (_,_,outt2,t2',pl2))->
let subst', metasenv',ugraph1 =