An 8-bit unsigned bitstruct type.
This is a bitstruct type introduced by defbitstruct, represented as a unsigned 8-bit integer.
Function:
(defun vex3-byte2-p$inline (x) (declare (xargs :guard t)) (mbe :logic (unsigned-byte-p 8 x) :exec (and (natp x) (< x 256))))
Theorem:
(defthm vex3-byte2-p-when-unsigned-byte-p (implies (unsigned-byte-p 8 x) (vex3-byte2-p x)))
Theorem:
(defthm unsigned-byte-p-when-vex3-byte2-p (implies (vex3-byte2-p x) (unsigned-byte-p 8 x)))
Theorem:
(defthm vex3-byte2-p-compound-recognizer (implies (vex3-byte2-p x) (natp x)) :rule-classes :compound-recognizer)
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))
Function:
(defun vex3-byte2$inline (pp l vvvv w) (declare (xargs :guard (and (2bits-p pp) (bitp l) (4bits-p vvvv) (bitp w)))) (b* ((pp (mbe :logic (2bits-fix pp) :exec pp)) (l (mbe :logic (bfix l) :exec l)) (vvvv (mbe :logic (4bits-fix vvvv) :exec vvvv)) (w (mbe :logic (bfix w) :exec w))) (logapp 2 pp (logapp 1 l (logapp 4 vvvv w)))))
Theorem:
(defthm vex3-byte2-p-of-vex3-byte2 (b* ((vex3-byte2 (vex3-byte2$inline pp l vvvv w))) (vex3-byte2-p vex3-byte2)) :rule-classes :rewrite)
Theorem:
(defthm vex3-byte2$inline-of-2bits-fix-pp (equal (vex3-byte2$inline (2bits-fix pp) l vvvv w) (vex3-byte2$inline pp l vvvv w)))
Theorem:
(defthm vex3-byte2$inline-2bits-equiv-congruence-on-pp (implies (2bits-equiv pp pp-equiv) (equal (vex3-byte2$inline pp l vvvv w) (vex3-byte2$inline pp-equiv l vvvv w))) :rule-classes :congruence)
Theorem:
(defthm vex3-byte2$inline-of-bfix-l (equal (vex3-byte2$inline pp (bfix l) vvvv w) (vex3-byte2$inline pp l vvvv w)))
Theorem:
(defthm vex3-byte2$inline-bit-equiv-congruence-on-l (implies (bit-equiv l l-equiv) (equal (vex3-byte2$inline pp l vvvv w) (vex3-byte2$inline pp l-equiv vvvv w))) :rule-classes :congruence)
Theorem:
(defthm vex3-byte2$inline-of-4bits-fix-vvvv (equal (vex3-byte2$inline pp l (4bits-fix vvvv) w) (vex3-byte2$inline pp l vvvv w)))
Theorem:
(defthm vex3-byte2$inline-4bits-equiv-congruence-on-vvvv (implies (4bits-equiv vvvv vvvv-equiv) (equal (vex3-byte2$inline pp l vvvv w) (vex3-byte2$inline pp l vvvv-equiv w))) :rule-classes :congruence)
Theorem:
(defthm vex3-byte2$inline-of-bfix-w (equal (vex3-byte2$inline pp l vvvv (bfix w)) (vex3-byte2$inline pp l vvvv w)))
Theorem:
(defthm vex3-byte2$inline-bit-equiv-congruence-on-w (implies (bit-equiv w w-equiv) (equal (vex3-byte2$inline pp l vvvv w) (vex3-byte2$inline pp l vvvv w-equiv))) :rule-classes :congruence)
Function:
(defun vex3-byte2-equiv-under-mask$inline (x x1 mask) (declare (xargs :guard (and (vex3-byte2-p x) (vex3-byte2-p x1) (integerp mask)))) (fty::int-equiv-under-mask (vex3-byte2-fix x) (vex3-byte2-fix x1) mask))
Function:
(defun vex3-byte2->pp$inline (x) (declare (xargs :guard (vex3-byte2-p x))) (mbe :logic (let ((x (vex3-byte2-fix x))) (part-select x :low 0 :width 2)) :exec (the (unsigned-byte 2) (logand (the (unsigned-byte 2) 3) (the (unsigned-byte 8) x)))))
Theorem:
(defthm 2bits-p-of-vex3-byte2->pp (b* ((pp (vex3-byte2->pp$inline x))) (2bits-p pp)) :rule-classes :rewrite)
Theorem:
(defthm vex3-byte2->pp$inline-of-vex3-byte2-fix-x (equal (vex3-byte2->pp$inline (vex3-byte2-fix x)) (vex3-byte2->pp$inline x)))
Theorem:
(defthm vex3-byte2->pp$inline-vex3-byte2-equiv-congruence-on-x (implies (vex3-byte2-equiv x x-equiv) (equal (vex3-byte2->pp$inline x) (vex3-byte2->pp$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vex3-byte2->pp-of-vex3-byte2 (equal (vex3-byte2->pp (vex3-byte2 pp l vvvv w)) (2bits-fix pp)))
Theorem:
(defthm vex3-byte2->pp-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x vex3-byte2-equiv-under-mask) (vex3-byte2-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 3) 0)) (equal (vex3-byte2->pp x) (vex3-byte2->pp y))))
Function:
(defun vex3-byte2->l$inline (x) (declare (xargs :guard (vex3-byte2-p x))) (mbe :logic (let ((x (vex3-byte2-fix x))) (part-select x :low 2 :width 1)) :exec (the (unsigned-byte 1) (logand (the (unsigned-byte 1) 1) (the (unsigned-byte 6) (ash (the (unsigned-byte 8) x) -2))))))
Theorem:
(defthm bitp-of-vex3-byte2->l (b* ((l (vex3-byte2->l$inline x))) (bitp l)) :rule-classes :rewrite)
Theorem:
(defthm vex3-byte2->l$inline-of-vex3-byte2-fix-x (equal (vex3-byte2->l$inline (vex3-byte2-fix x)) (vex3-byte2->l$inline x)))
Theorem:
(defthm vex3-byte2->l$inline-vex3-byte2-equiv-congruence-on-x (implies (vex3-byte2-equiv x x-equiv) (equal (vex3-byte2->l$inline x) (vex3-byte2->l$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vex3-byte2->l-of-vex3-byte2 (equal (vex3-byte2->l (vex3-byte2 pp l vvvv w)) (bfix l)))
Theorem:
(defthm vex3-byte2->l-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x vex3-byte2-equiv-under-mask) (vex3-byte2-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 4) 0)) (equal (vex3-byte2->l x) (vex3-byte2->l y))))
Function:
(defun vex3-byte2->vvvv$inline (x) (declare (xargs :guard (vex3-byte2-p x))) (mbe :logic (let ((x (vex3-byte2-fix x))) (part-select x :low 3 :width 4)) :exec (the (unsigned-byte 4) (logand (the (unsigned-byte 4) 15) (the (unsigned-byte 5) (ash (the (unsigned-byte 8) x) -3))))))
Theorem:
(defthm 4bits-p-of-vex3-byte2->vvvv (b* ((vvvv (vex3-byte2->vvvv$inline x))) (4bits-p vvvv)) :rule-classes :rewrite)
Theorem:
(defthm vex3-byte2->vvvv$inline-of-vex3-byte2-fix-x (equal (vex3-byte2->vvvv$inline (vex3-byte2-fix x)) (vex3-byte2->vvvv$inline x)))
Theorem:
(defthm vex3-byte2->vvvv$inline-vex3-byte2-equiv-congruence-on-x (implies (vex3-byte2-equiv x x-equiv) (equal (vex3-byte2->vvvv$inline x) (vex3-byte2->vvvv$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vex3-byte2->vvvv-of-vex3-byte2 (equal (vex3-byte2->vvvv (vex3-byte2 pp l vvvv w)) (4bits-fix vvvv)))
Theorem:
(defthm vex3-byte2->vvvv-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x vex3-byte2-equiv-under-mask) (vex3-byte2-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 120) 0)) (equal (vex3-byte2->vvvv x) (vex3-byte2->vvvv y))))
Function:
(defun vex3-byte2->w$inline (x) (declare (xargs :guard (vex3-byte2-p x))) (mbe :logic (let ((x (vex3-byte2-fix x))) (part-select x :low 7 :width 1)) :exec (the (unsigned-byte 1) (logand (the (unsigned-byte 1) 1) (the (unsigned-byte 1) (ash (the (unsigned-byte 8) x) -7))))))
Theorem:
(defthm bitp-of-vex3-byte2->w (b* ((w (vex3-byte2->w$inline x))) (bitp w)) :rule-classes :rewrite)
Theorem:
(defthm vex3-byte2->w$inline-of-vex3-byte2-fix-x (equal (vex3-byte2->w$inline (vex3-byte2-fix x)) (vex3-byte2->w$inline 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 x) (vex3-byte2->w$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vex3-byte2->w-of-vex3-byte2 (equal (vex3-byte2->w (vex3-byte2 pp l vvvv w)) (bfix w)))
Theorem:
(defthm vex3-byte2->w-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x vex3-byte2-equiv-under-mask) (vex3-byte2-equiv-under-mask x y fty::mask) (equal (logand (lognot fty::mask) 128) 0)) (equal (vex3-byte2->w x) (vex3-byte2->w y))))
Theorem:
(defthm vex3-byte2-fix-in-terms-of-vex3-byte2 (equal (vex3-byte2-fix x) (change-vex3-byte2 x)))
Function:
(defun !vex3-byte2->pp$inline (pp x) (declare (xargs :guard (and (2bits-p pp) (vex3-byte2-p x)))) (mbe :logic (b* ((pp (mbe :logic (2bits-fix pp) :exec pp)) (x (vex3-byte2-fix x))) (part-install pp x :width 2 :low 0)) :exec (the (unsigned-byte 8) (logior (the (unsigned-byte 8) (logand (the (unsigned-byte 8) x) (the (signed-byte 3) -4))) (the (unsigned-byte 2) pp)))))
Theorem:
(defthm vex3-byte2-p-of-!vex3-byte2->pp (b* ((new-x (!vex3-byte2->pp$inline pp x))) (vex3-byte2-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !vex3-byte2->pp$inline-of-2bits-fix-pp (equal (!vex3-byte2->pp$inline (2bits-fix pp) x) (!vex3-byte2->pp$inline pp x)))
Theorem:
(defthm !vex3-byte2->pp$inline-2bits-equiv-congruence-on-pp (implies (2bits-equiv pp pp-equiv) (equal (!vex3-byte2->pp$inline pp x) (!vex3-byte2->pp$inline pp-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->pp$inline-of-vex3-byte2-fix-x (equal (!vex3-byte2->pp$inline pp (vex3-byte2-fix x)) (!vex3-byte2->pp$inline pp x)))
Theorem:
(defthm !vex3-byte2->pp$inline-vex3-byte2-equiv-congruence-on-x (implies (vex3-byte2-equiv x x-equiv) (equal (!vex3-byte2->pp$inline pp x) (!vex3-byte2->pp$inline pp x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->pp-is-vex3-byte2 (equal (!vex3-byte2->pp pp x) (change-vex3-byte2 x :pp pp)))
Theorem:
(defthm vex3-byte2->pp-of-!vex3-byte2->pp (b* ((?new-x (!vex3-byte2->pp$inline pp x))) (equal (vex3-byte2->pp new-x) (2bits-fix pp))))
Theorem:
(defthm !vex3-byte2->pp-equiv-under-mask (b* ((?new-x (!vex3-byte2->pp$inline pp x))) (vex3-byte2-equiv-under-mask new-x x -4)))
Function:
(defun !vex3-byte2->l$inline (l x) (declare (xargs :guard (and (bitp l) (vex3-byte2-p x)))) (mbe :logic (b* ((l (mbe :logic (bfix l) :exec l)) (x (vex3-byte2-fix x))) (part-install l x :width 1 :low 2)) :exec (the (unsigned-byte 8) (logior (the (unsigned-byte 8) (logand (the (unsigned-byte 8) x) (the (signed-byte 4) -5))) (the (unsigned-byte 3) (ash (the (unsigned-byte 1) l) 2))))))
Theorem:
(defthm vex3-byte2-p-of-!vex3-byte2->l (b* ((new-x (!vex3-byte2->l$inline l x))) (vex3-byte2-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !vex3-byte2->l$inline-of-bfix-l (equal (!vex3-byte2->l$inline (bfix l) x) (!vex3-byte2->l$inline l x)))
Theorem:
(defthm !vex3-byte2->l$inline-bit-equiv-congruence-on-l (implies (bit-equiv l l-equiv) (equal (!vex3-byte2->l$inline l x) (!vex3-byte2->l$inline l-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->l$inline-of-vex3-byte2-fix-x (equal (!vex3-byte2->l$inline l (vex3-byte2-fix x)) (!vex3-byte2->l$inline l x)))
Theorem:
(defthm !vex3-byte2->l$inline-vex3-byte2-equiv-congruence-on-x (implies (vex3-byte2-equiv x x-equiv) (equal (!vex3-byte2->l$inline l x) (!vex3-byte2->l$inline l x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->l-is-vex3-byte2 (equal (!vex3-byte2->l l x) (change-vex3-byte2 x :l l)))
Theorem:
(defthm vex3-byte2->l-of-!vex3-byte2->l (b* ((?new-x (!vex3-byte2->l$inline l x))) (equal (vex3-byte2->l new-x) (bfix l))))
Theorem:
(defthm !vex3-byte2->l-equiv-under-mask (b* ((?new-x (!vex3-byte2->l$inline l x))) (vex3-byte2-equiv-under-mask new-x x -5)))
Function:
(defun !vex3-byte2->vvvv$inline (vvvv x) (declare (xargs :guard (and (4bits-p vvvv) (vex3-byte2-p x)))) (mbe :logic (b* ((vvvv (mbe :logic (4bits-fix vvvv) :exec vvvv)) (x (vex3-byte2-fix x))) (part-install vvvv x :width 4 :low 3)) :exec (the (unsigned-byte 8) (logior (the (unsigned-byte 8) (logand (the (unsigned-byte 8) x) (the (signed-byte 8) -121))) (the (unsigned-byte 7) (ash (the (unsigned-byte 4) vvvv) 3))))))
Theorem:
(defthm vex3-byte2-p-of-!vex3-byte2->vvvv (b* ((new-x (!vex3-byte2->vvvv$inline vvvv x))) (vex3-byte2-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !vex3-byte2->vvvv$inline-of-4bits-fix-vvvv (equal (!vex3-byte2->vvvv$inline (4bits-fix vvvv) x) (!vex3-byte2->vvvv$inline vvvv x)))
Theorem:
(defthm !vex3-byte2->vvvv$inline-4bits-equiv-congruence-on-vvvv (implies (4bits-equiv vvvv vvvv-equiv) (equal (!vex3-byte2->vvvv$inline vvvv x) (!vex3-byte2->vvvv$inline vvvv-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->vvvv$inline-of-vex3-byte2-fix-x (equal (!vex3-byte2->vvvv$inline vvvv (vex3-byte2-fix x)) (!vex3-byte2->vvvv$inline vvvv x)))
Theorem:
(defthm !vex3-byte2->vvvv$inline-vex3-byte2-equiv-congruence-on-x (implies (vex3-byte2-equiv x x-equiv) (equal (!vex3-byte2->vvvv$inline vvvv x) (!vex3-byte2->vvvv$inline vvvv x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !vex3-byte2->vvvv-is-vex3-byte2 (equal (!vex3-byte2->vvvv vvvv x) (change-vex3-byte2 x :vvvv vvvv)))
Theorem:
(defthm vex3-byte2->vvvv-of-!vex3-byte2->vvvv (b* ((?new-x (!vex3-byte2->vvvv$inline vvvv x))) (equal (vex3-byte2->vvvv new-x) (4bits-fix vvvv))))
Theorem:
(defthm !vex3-byte2->vvvv-equiv-under-mask (b* ((?new-x (!vex3-byte2->vvvv$inline vvvv x))) (vex3-byte2-equiv-under-mask new-x x -121)))
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)))
Function:
(defun vex3-byte2-debug$inline (x) (declare (xargs :guard (vex3-byte2-p x))) (b* (((vex3-byte2 x))) (cons (cons 'pp x.pp) (cons (cons 'l x.l) (cons (cons 'vvvv x.vvvv) (cons (cons 'w x.w) nil))))))