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