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