Fixing function for reserr-option structures.
(reserr-option-fix x) → new-x
Function:
(defun reserr-option-fix$inline (x) (declare (xargs :guard (reserr-optionp x))) (let ((__function__ 'reserr-option-fix)) (declare (ignorable __function__)) (mbe :logic (cond ((not x) nil) (t (b* ((val (reserr-fix x))) val))) :exec x)))
Theorem:
(defthm reserr-optionp-of-reserr-option-fix (b* ((new-x (reserr-option-fix$inline x))) (reserr-optionp new-x)) :rule-classes :rewrite)
Theorem:
(defthm reserr-option-fix-when-reserr-optionp (implies (reserr-optionp x) (equal (reserr-option-fix x) x)))
Function:
(defun reserr-option-equiv$inline (x y) (declare (xargs :guard (and (reserr-optionp x) (reserr-optionp y)))) (equal (reserr-option-fix x) (reserr-option-fix y)))
Theorem:
(defthm reserr-option-equiv-is-an-equivalence (and (booleanp (reserr-option-equiv x y)) (reserr-option-equiv x x) (implies (reserr-option-equiv x y) (reserr-option-equiv y x)) (implies (and (reserr-option-equiv x y) (reserr-option-equiv y z)) (reserr-option-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm reserr-option-equiv-implies-equal-reserr-option-fix-1 (implies (reserr-option-equiv x x-equiv) (equal (reserr-option-fix x) (reserr-option-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm reserr-option-fix-under-reserr-option-equiv (reserr-option-equiv (reserr-option-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-reserr-option-fix-1-forward-to-reserr-option-equiv (implies (equal (reserr-option-fix x) y) (reserr-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-reserr-option-fix-2-forward-to-reserr-option-equiv (implies (equal x (reserr-option-fix y)) (reserr-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm reserr-option-equiv-of-reserr-option-fix-1-forward (implies (reserr-option-equiv (reserr-option-fix x) y) (reserr-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm reserr-option-equiv-of-reserr-option-fix-2-forward (implies (reserr-option-equiv x (reserr-option-fix y)) (reserr-option-equiv x y)) :rule-classes :forward-chaining)