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