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