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