+ | NCic.Appl (NCic.Meta (i,_) :: args)->
+ (try
+ let _,_,t,_ = List.assoc i subst in
+ flexible_arg context subst
+ (NCicReduction.head_beta_reduce ~delta:max_int
+ (NCic.Appl (t :: args)))
+ with Not_found -> true)
+ (* this is a cheap whd, it only performs zeta-reduction.
+ *
+ * it works when the **omissis** disambiguation algorithm
+ * is run on `let x := K a b in t`, K is substituted for a
+ * ? and thus in t metavariables have a flexible Rel
+ *)
+ | NCic.Rel i ->
+ (try
+ match List.nth context (i-1)
+ with
+ | _,NCic.Def (bo,_) ->
+ flexible_arg context subst
+ (NCicSubstitution.lift i bo)
+ | _ -> false
+ with
+ | Failure _ ->
+ prerr_endline (Printf.sprintf "Rel %d inside context:\n%s" i
+ (NCicPp.ppcontext ~subst ~metasenv:[] context));
+ assert false
+ | Invalid_argument _ -> assert false)