Update the |ACL2|::|W| field of a vex3-byte2 bit structure.
(!vex3-byte2->w w x) → new-x
Function:
(defun !vex3-byte2->w$inline (w x) (declare (xargs :guard (and (bitp w) (vex3-byte2-p x)))) (mbe :logic (b* ((w (mbe :logic (bfix w) :exec w)) (x (vex3-byte2-fix x))) (part-install w x :width 1 :low 7)) :exec (the (unsigned-byte 8) (logior (the (unsigned-byte 8) (logand (the (unsigned-byte 8) x) (the (signed-byte 9) -129))) (the (unsigned-byte 8) (ash (the (unsigned-byte 1) w) 7))))))
Theorem:
(defthm vex3-byte2-p-of-!vex3-byte2->w (b* ((new-x (!vex3-byte2->w$inline w x))) (vex3-byte2-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !vex3-byte2->w$inline-of-bfix-w (equal (!vex3-byte2->w$inline (bfix w) x) (!vex3-byte2->w$inline w x)))
Theorem:
(defthm !vex3-byte2->w$inline-bit-equiv-congruence-on-w (implies (bit-equiv w w-equiv) (equal (!vex3-byte2->w$inline w x) (!vex3-byte2->w$inline w-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->w$inline-of-vex3-byte2-fix-x (equal (!vex3-byte2->w$inline w (vex3-byte2-fix x)) (!vex3-byte2->w$inline w x)))
Theorem:
(defthm !vex3-byte2->w$inline-vex3-byte2-equiv-congruence-on-x (implies (vex3-byte2-equiv x x-equiv) (equal (!vex3-byte2->w$inline w x) (!vex3-byte2->w$inline w x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->w-is-vex3-byte2 (equal (!vex3-byte2->w w x) (change-vex3-byte2 x :w w)))
Theorem:
(defthm vex3-byte2->w-of-!vex3-byte2->w (b* ((?new-x (!vex3-byte2->w$inline w x))) (equal (vex3-byte2->w new-x) (bfix w))))
Theorem:
(defthm !vex3-byte2->w-equiv-under-mask (b* ((?new-x (!vex3-byte2->w$inline w x))) (vex3-byte2-equiv-under-mask new-x x 127)))