Fixing function for reserr structures.
Function:
(defun reserr-fix$inline (x) (declare (xargs :guard (reserrp x))) (let ((__function__ 'reserr-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((info (identity (cdr (std::da-nth 0 (cdr x)))))) (cons :error (list (cons 'info info)))) :exec x)))
Theorem:
(defthm reserrp-of-reserr-fix (b* ((new-x (reserr-fix$inline x))) (reserrp new-x)) :rule-classes :rewrite)
Theorem:
(defthm reserr-fix-when-reserrp (implies (reserrp x) (equal (reserr-fix x) x)))
Function:
(defun reserr-equiv$inline (x y) (declare (xargs :guard (and (reserrp x) (reserrp y)))) (equal (reserr-fix x) (reserr-fix y)))
Theorem:
(defthm reserr-equiv-is-an-equivalence (and (booleanp (reserr-equiv x y)) (reserr-equiv x x) (implies (reserr-equiv x y) (reserr-equiv y x)) (implies (and (reserr-equiv x y) (reserr-equiv y z)) (reserr-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm reserr-equiv-implies-equal-reserr-fix-1 (implies (reserr-equiv x x-equiv) (equal (reserr-fix x) (reserr-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm reserr-fix-under-reserr-equiv (reserr-equiv (reserr-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-reserr-fix-1-forward-to-reserr-equiv (implies (equal (reserr-fix x) y) (reserr-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-reserr-fix-2-forward-to-reserr-equiv (implies (equal x (reserr-fix y)) (reserr-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm reserr-equiv-of-reserr-fix-1-forward (implies (reserr-equiv (reserr-fix x) y) (reserr-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm reserr-equiv-of-reserr-fix-2-forward (implies (reserr-equiv x (reserr-fix y)) (reserr-equiv x y)) :rule-classes :forward-chaining)