Update the |ACL2|::|PF| field of a rflagsbits bit structure.
(!rflagsbits->pf pf x) → new-x
Function:
(defun !rflagsbits->pf$inline (pf x) (declare (xargs :guard (and (bitp pf) (rflagsbits-p x)))) (mbe :logic (b* ((pf (mbe :logic (bfix pf) :exec pf)) (x (rflagsbits-fix x))) (part-install pf x :width 1 :low 2)) :exec (the (unsigned-byte 32) (logior (the (unsigned-byte 32) (logand (the (unsigned-byte 32) x) (the (signed-byte 4) -5))) (the (unsigned-byte 3) (ash (the (unsigned-byte 1) pf) 2))))))
Theorem:
(defthm rflagsbits-p-of-!rflagsbits->pf (b* ((new-x (!rflagsbits->pf$inline pf x))) (rflagsbits-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !rflagsbits->pf$inline-of-bfix-pf (equal (!rflagsbits->pf$inline (bfix pf) x) (!rflagsbits->pf$inline pf x)))
Theorem:
(defthm !rflagsbits->pf$inline-bit-equiv-congruence-on-pf (implies (bit-equiv pf pf-equiv) (equal (!rflagsbits->pf$inline pf x) (!rflagsbits->pf$inline pf-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !rflagsbits->pf$inline-of-rflagsbits-fix-x (equal (!rflagsbits->pf$inline pf (rflagsbits-fix x)) (!rflagsbits->pf$inline pf x)))
Theorem:
(defthm !rflagsbits->pf$inline-rflagsbits-equiv-congruence-on-x (implies (rflagsbits-equiv x x-equiv) (equal (!rflagsbits->pf$inline pf x) (!rflagsbits->pf$inline pf x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !rflagsbits->pf-is-rflagsbits (equal (!rflagsbits->pf pf x) (change-rflagsbits x :pf pf)))
Theorem:
(defthm rflagsbits->pf-of-!rflagsbits->pf (b* ((?new-x (!rflagsbits->pf$inline pf x))) (equal (rflagsbits->pf new-x) (bfix pf))))
Theorem:
(defthm !rflagsbits->pf-equiv-under-mask (b* ((?new-x (!rflagsbits->pf$inline pf x))) (rflagsbits-equiv-under-mask new-x x -5)))