Equality of expression outcome results modulo errors.
(eoutcome-result-okeq x y) → yes/no
This is the equivalence relation on expression outcomes discussed in dead-code-eliminator-execution.
Function:
(defun eoutcome-result-okeq (x y) (declare (xargs :guard (and (eoutcome-resultp x) (eoutcome-resultp y)))) (let ((__function__ 'eoutcome-result-okeq)) (declare (ignorable __function__)) (b* ((x (eoutcome-result-fix x)) (y (eoutcome-result-fix y))) (cond ((reserrp x) (reserrp y)) ((reserrp y) (reserrp x)) (t (equal x y))))))
Theorem:
(defthm booleanp-of-eoutcome-result-okeq (b* ((yes/no (eoutcome-result-okeq x y))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm eoutcome-result-okeq-is-an-equivalence (and (booleanp (eoutcome-result-okeq x y)) (eoutcome-result-okeq x x) (implies (eoutcome-result-okeq x y) (eoutcome-result-okeq y x)) (implies (and (eoutcome-result-okeq x y) (eoutcome-result-okeq y z)) (eoutcome-result-okeq x z))) :rule-classes (:equivalence))
Theorem:
(defthm eoutcome-result-okeq-of-eoutcome-result-fix-x (equal (eoutcome-result-okeq (eoutcome-result-fix x) y) (eoutcome-result-okeq x y)))
Theorem:
(defthm eoutcome-result-okeq-eoutcome-result-equiv-congruence-on-x (implies (eoutcome-result-equiv x x-equiv) (equal (eoutcome-result-okeq x y) (eoutcome-result-okeq x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm eoutcome-result-okeq-of-eoutcome-result-fix-y (equal (eoutcome-result-okeq x (eoutcome-result-fix y)) (eoutcome-result-okeq x y)))
Theorem:
(defthm eoutcome-result-okeq-eoutcome-result-equiv-congruence-on-y (implies (eoutcome-result-equiv y y-equiv) (equal (eoutcome-result-okeq x y) (eoutcome-result-okeq x y-equiv))) :rule-classes :congruence)