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