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