Test a value logically.
(test-value val) → res
In some contexts (e.g. conditional tests), a value is treated as a logical boolean. The value must be scalar; see test-scalar-value for details.
Function:
(defun test-value (val) (declare (xargs :guard (valuep val))) (let ((__function__ 'test-value)) (declare (ignorable __function__)) (if (value-scalarp val) (test-scalar-value val) (error (list :test-mistype :required :scalar :supplied (value-fix val))))))
Theorem:
(defthm boolean-resultp-of-test-value (b* ((res (test-value val))) (boolean-resultp res)) :rule-classes :rewrite)
Theorem:
(defthm test-value-of-value-fix-val (equal (test-value (value-fix val)) (test-value val)))
Theorem:
(defthm test-value-value-equiv-congruence-on-val (implies (value-equiv val val-equiv) (equal (test-value val) (test-value val-equiv))) :rule-classes :congruence)