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