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