-let assert_applicability err f st m v t =
- if !G.trace >= level then warn "Asserting applicability";
- match BR.xwhd st m None t with
- | _, B.Sort _ ->
- error1 err "not a function" m t
- | mw, B.Bind (_, B.Abst (n, w), _) ->
+let assert_applicability err f st m a v t =
+ let mode, msg = if a.E.a_rest then one, "restricted" else None, "extended" in
+IFDEF TRACE THEN
+ if !G.ct >= level then warn ("Asserting " ^ msg ^ " applicability")
+ELSE () END;
+ match BR.xwhd st m mode t with
+ | mw, B.Bind (_, B.Abst (true, n, w), _) ->