Cause an error if a function has input or output stobjs.
(ensure-function-no-stobjs fn description error-erp error-val ctx state) → (mv erp val state)
The function must not be one whose stobjs-out are invalid.
Function:
(defun ensure-function-no-stobjs (fn description error-erp error-val ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (msgp description) (and (function-namep fn (w state)) (not (member-eq fn *stobjs-out-invalid*)))))) (b* (((unless (no-stobjs-p fn (w state))) (er-soft+ ctx error-erp error-val "~@0 must have no input or output stobjs." description))) (value nil)))
Theorem:
(defthm return-type-of-ensure-function-no-stobjs.erp (b* (((mv ?erp ?val ?state) (ensure-function-no-stobjs fn description error-erp error-val ctx state))) (implies erp (equal erp error-erp))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-ensure-function-no-stobjs.val (b* (((mv ?erp ?val ?state) (ensure-function-no-stobjs fn description error-erp error-val ctx state))) (and (implies erp (equal val error-val)) (implies (and (not erp) error-erp) (not val)))) :rule-classes :rewrite)