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