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