+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), _) ->
+ if !G.cc && not (N.assert_not_zero st n) then error1 err "not a function" m t
+ else begin
+IFDEF TRACE THEN
+ if !G.ct >= level then warn "Asserting convertibility for application"
+ELSE () END;
+ if BR.are_convertible st mw zero w m one v then f () else
+ error2 err mw w m v
+ end
+ | _, B.Sort _ ->