Cause an error if a value if not a true list of even length with keywords at its even-numbered positions (counting from 0).
(ensure-keyword-value-list x description error-erp error-val ctx state) → (mv erp val state)
Function:
(defun ensure-keyword-value-list (x description error-erp error-val ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (msgp description))) (b* (((unless (keyword-value-listp x)) (er-soft+ ctx error-erp error-val "~@0 must a true list of even length ~ with keywords at its even-numbered positions ~ (counting from 0)." description))) (value nil)))
Theorem:
(defthm return-type-of-ensure-keyword-value-list.erp (b* (((mv ?erp ?val ?state) (ensure-keyword-value-list x description error-erp error-val ctx state))) (implies erp (equal erp error-erp))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-ensure-keyword-value-list.val (b* (((mv ?erp ?val ?state) (ensure-keyword-value-list x 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)