Cause an error if a term calls any program-mode function.
(ensure-term-logic-mode term description error-erp error-val ctx state) → (mv erp val state)
Function:
(defun ensure-term-logic-mode (term description error-erp error-val ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (pseudo-termp term) (msgp description)))) (b* (((unless (logic-fnsp term (w state))) (er-soft+ ctx error-erp error-val "~@0 must call only logic-mode functions, ~ but it calls the program-mode ~@1." description (let ((fns (all-program-ffn-symbs term nil (w state)))) (if (= (len fns) 1) (msg "function ~x0" (car fns)) (msg "functions ~&0" fns)))))) (value nil)))
Theorem:
(defthm return-type-of-ensure-term-logic-mode.erp (b* (((mv ?erp ?val ?state) (ensure-term-logic-mode term description error-erp error-val ctx state))) (implies erp (equal erp error-erp))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-ensure-term-logic-mode.val (b* (((mv ?erp ?val ?state) (ensure-term-logic-mode term 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)