Fixing function for vex3-byte2 bit structures.
(vex3-byte2-fix x) → fty::fixed
Function:
(defun vex3-byte2-fix$inline (x) (declare (xargs :guard (vex3-byte2-p x))) (mbe :logic (loghead 8 x) :exec x))
Theorem:
(defthm vex3-byte2-p-of-vex3-byte2-fix (b* ((fty::fixed (vex3-byte2-fix$inline x))) (vex3-byte2-p fty::fixed)) :rule-classes :rewrite)
Theorem:
(defthm vex3-byte2-fix-when-vex3-byte2-p (implies (vex3-byte2-p x) (equal (vex3-byte2-fix x) x)))
Function:
(defun vex3-byte2-equiv$inline (x y) (declare (xargs :guard (and (vex3-byte2-p x) (vex3-byte2-p y)))) (equal (vex3-byte2-fix x) (vex3-byte2-fix y)))
Theorem:
(defthm vex3-byte2-equiv-is-an-equivalence (and (booleanp (vex3-byte2-equiv x y)) (vex3-byte2-equiv x x) (implies (vex3-byte2-equiv x y) (vex3-byte2-equiv y x)) (implies (and (vex3-byte2-equiv x y) (vex3-byte2-equiv y z)) (vex3-byte2-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vex3-byte2-equiv-implies-equal-vex3-byte2-fix-1 (implies (vex3-byte2-equiv x x-equiv) (equal (vex3-byte2-fix x) (vex3-byte2-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vex3-byte2-fix-under-vex3-byte2-equiv (vex3-byte2-equiv (vex3-byte2-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))