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