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