let-in were always zeta-expanded during delifting. As a result, implicit,
in a context with definitions, were always refined with a type that was well
typed, but only up to (potentially expensive) reduction!
(try
match List.nth context (m-k-1) with
Some (_,C.Def (t,_)) ->
+ (try
+ C.Rel ((position (m-k) l) + k)
+ with
+ NotInTheList ->
(*CSC: Hmmm. This bit of reduction is not in the spirit of *)
(*CSC: first order unification. Does it help or does it harm? *)
(*CSC: ANSWER: it hurts performances since it is possible to *)
(*CSC: have an exponential explosion of the size of the proof.*)
(*CSC: However, without this bit of reduction some "apply" in *)
(*CSC: the library fail (e.g. nat/nth_prime.ma). *)
- deliftaux k (S.lift m t)
+ deliftaux k (S.lift m t))
| Some (_,C.Decl t) ->
C.Rel ((position (m-k) l) + k)
| None -> raise (MetaSubstFailure (lazy "RelToHiddenHypothesis"))