Evaluation semantics of if.
The function if is non-strict in the evaluation semantics.
So we may not need this
Function:
(defun eval-if (x y z) (declare (xargs :guard (and (valuep x) (valuep y) (valuep z)))) (let ((__function__ 'eval-if)) (declare (ignorable __function__)) (if (value-equiv x (value-nil)) (value-fix z) (value-fix y))))
Theorem:
(defthm valuep-of-eval-if (b* ((result (eval-if x y z))) (valuep result)) :rule-classes :rewrite)
Theorem:
(defthm eval-if-of-value-fix-x (equal (eval-if (value-fix x) y z) (eval-if x y z)))
Theorem:
(defthm eval-if-value-equiv-congruence-on-x (implies (value-equiv x x-equiv) (equal (eval-if x y z) (eval-if x-equiv y z))) :rule-classes :congruence)
Theorem:
(defthm eval-if-of-value-fix-y (equal (eval-if x (value-fix y) z) (eval-if x y z)))
Theorem:
(defthm eval-if-value-equiv-congruence-on-y (implies (value-equiv y y-equiv) (equal (eval-if x y z) (eval-if x y-equiv z))) :rule-classes :congruence)
Theorem:
(defthm eval-if-of-value-fix-z (equal (eval-if x y (value-fix z)) (eval-if x y z)))
Theorem:
(defthm eval-if-value-equiv-congruence-on-z (implies (value-equiv z z-equiv) (equal (eval-if x y z) (eval-if x y z-equiv))) :rule-classes :congruence)