Fixing function for ubyte32-option structures.
(ubyte32-option-fix x) → new-x
Function:
(defun ubyte32-option-fix$inline (x) (declare (xargs :guard (ubyte32-optionp x))) (let ((__function__ 'ubyte32-option-fix)) (declare (ignorable __function__)) (mbe :logic (cond ((not x) nil) (t (b* ((fty::val (ubyte32-fix x))) fty::val))) :exec x)))
Theorem:
(defthm ubyte32-optionp-of-ubyte32-option-fix (b* ((new-x (ubyte32-option-fix$inline x))) (ubyte32-optionp new-x)) :rule-classes :rewrite)
Theorem:
(defthm ubyte32-option-fix-when-ubyte32-optionp (implies (ubyte32-optionp x) (equal (ubyte32-option-fix x) x)))
Function:
(defun ubyte32-option-equiv$inline (x y) (declare (xargs :guard (and (ubyte32-optionp x) (ubyte32-optionp y)))) (equal (ubyte32-option-fix x) (ubyte32-option-fix y)))
Theorem:
(defthm ubyte32-option-equiv-is-an-equivalence (and (booleanp (ubyte32-option-equiv x y)) (ubyte32-option-equiv x x) (implies (ubyte32-option-equiv x y) (ubyte32-option-equiv y x)) (implies (and (ubyte32-option-equiv x y) (ubyte32-option-equiv y z)) (ubyte32-option-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm ubyte32-option-equiv-implies-equal-ubyte32-option-fix-1 (implies (ubyte32-option-equiv x x-equiv) (equal (ubyte32-option-fix x) (ubyte32-option-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm ubyte32-option-fix-under-ubyte32-option-equiv (ubyte32-option-equiv (ubyte32-option-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-ubyte32-option-fix-1-forward-to-ubyte32-option-equiv (implies (equal (ubyte32-option-fix x) y) (ubyte32-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-ubyte32-option-fix-2-forward-to-ubyte32-option-equiv (implies (equal x (ubyte32-option-fix y)) (ubyte32-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm ubyte32-option-equiv-of-ubyte32-option-fix-1-forward (implies (ubyte32-option-equiv (ubyte32-option-fix x) y) (ubyte32-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm ubyte32-option-equiv-of-ubyte32-option-fix-2-forward (implies (ubyte32-option-equiv x (ubyte32-option-fix y)) (ubyte32-option-equiv x y)) :rule-classes :forward-chaining)