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