Fixing function for wellformed-result structures.
(wellformed-result-fix acl2::x) → new-x
Function:
(defun wellformed-result-fix$inline (acl2::x) (declare (xargs :guard (wellformed-resultp acl2::x))) (let ((__function__ 'wellformed-result-fix)) (declare (ignorable __function__)) (mbe :logic (case (wellformed-result-kind acl2::x) (:ok (b* ((get (wellformed-fix acl2::x))) get)) (:err (b* ((get (fty::reserr-fix acl2::x))) get))) :exec acl2::x)))
Theorem:
(defthm wellformed-resultp-of-wellformed-result-fix (b* ((new-x (wellformed-result-fix$inline acl2::x))) (wellformed-resultp new-x)) :rule-classes :rewrite)
Theorem:
(defthm wellformed-result-fix-when-wellformed-resultp (implies (wellformed-resultp acl2::x) (equal (wellformed-result-fix acl2::x) acl2::x)))
Function:
(defun wellformed-result-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (wellformed-resultp acl2::x) (wellformed-resultp acl2::y)))) (equal (wellformed-result-fix acl2::x) (wellformed-result-fix acl2::y)))
Theorem:
(defthm wellformed-result-equiv-is-an-equivalence (and (booleanp (wellformed-result-equiv x y)) (wellformed-result-equiv x x) (implies (wellformed-result-equiv x y) (wellformed-result-equiv y x)) (implies (and (wellformed-result-equiv x y) (wellformed-result-equiv y z)) (wellformed-result-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm wellformed-result-equiv-implies-equal-wellformed-result-fix-1 (implies (wellformed-result-equiv acl2::x x-equiv) (equal (wellformed-result-fix acl2::x) (wellformed-result-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm wellformed-result-fix-under-wellformed-result-equiv (wellformed-result-equiv (wellformed-result-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-wellformed-result-fix-1-forward-to-wellformed-result-equiv (implies (equal (wellformed-result-fix acl2::x) acl2::y) (wellformed-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-wellformed-result-fix-2-forward-to-wellformed-result-equiv (implies (equal acl2::x (wellformed-result-fix acl2::y)) (wellformed-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm wellformed-result-equiv-of-wellformed-result-fix-1-forward (implies (wellformed-result-equiv (wellformed-result-fix acl2::x) acl2::y) (wellformed-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm wellformed-result-equiv-of-wellformed-result-fix-2-forward (implies (wellformed-result-equiv acl2::x (wellformed-result-fix acl2::y)) (wellformed-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm wellformed-result-kind$inline-of-wellformed-result-fix-x (equal (wellformed-result-kind$inline (wellformed-result-fix acl2::x)) (wellformed-result-kind$inline acl2::x)))
Theorem:
(defthm wellformed-result-kind$inline-wellformed-result-equiv-congruence-on-x (implies (wellformed-result-equiv acl2::x x-equiv) (equal (wellformed-result-kind$inline acl2::x) (wellformed-result-kind$inline x-equiv))) :rule-classes :congruence)