Cause an error if a symbol is not the name of an existing function.
(ensure-symbol-function symb description error-erp error-val ctx state) → (mv erp val state)
Function:
(defun ensure-symbol-function (symb description error-erp error-val ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (symbolp symb) (msgp description)))) (b* (((unless (function-symbolp symb (w state))) (er-soft+ ctx error-erp error-val "~@0 must name an existing function." description))) (value nil)))
Theorem:
(defthm return-type-of-ensure-symbol-function.erp (b* (((mv ?erp ?val ?state) (ensure-symbol-function symb description error-erp error-val ctx state))) (implies erp (equal erp error-erp))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-ensure-symbol-function.val (b* (((mv ?erp ?val ?state) (ensure-symbol-function symb 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)