# !cr4bits->pse

Update the |X86ISA|::|PSE| field of a cr4bits bit structure.

- Signature
(!cr4bits->pse pse x) → new-x

- Arguments
`pse` — Guard (bitp pse).
`x` — Guard (cr4bits-p x).
- Returns
`new-x` — Type (cr4bits-p new-x).

### Definitions and Theorems

**Function: **!cr4bits->pse$inline

(defun !cr4bits->pse$inline (pse x)
(declare (xargs :guard (and (bitp pse) (cr4bits-p x))))
(mbe
:logic
(b* ((pse (mbe :logic (bfix pse) :exec pse))
(x (cr4bits-fix x)))
(part-install pse x :width 1 :low 4))
:exec (the (unsigned-byte 22)
(logior (the (unsigned-byte 22)
(logand (the (unsigned-byte 22) x)
(the (signed-byte 6) -17)))
(the (unsigned-byte 5)
(ash (the (unsigned-byte 1) pse) 4))))))

**Theorem: **cr4bits-p-of-!cr4bits->pse

(defthm cr4bits-p-of-!cr4bits->pse
(b* ((new-x (!cr4bits->pse$inline pse x)))
(cr4bits-p new-x))
:rule-classes :rewrite)

**Theorem: **!cr4bits->pse$inline-of-bfix-pse

(defthm !cr4bits->pse$inline-of-bfix-pse
(equal (!cr4bits->pse$inline (bfix pse) x)
(!cr4bits->pse$inline pse x)))

**Theorem: **!cr4bits->pse$inline-bit-equiv-congruence-on-pse

(defthm !cr4bits->pse$inline-bit-equiv-congruence-on-pse
(implies (bit-equiv pse pse-equiv)
(equal (!cr4bits->pse$inline pse x)
(!cr4bits->pse$inline pse-equiv x)))
:rule-classes :congruence)

**Theorem: **!cr4bits->pse$inline-of-cr4bits-fix-x

(defthm !cr4bits->pse$inline-of-cr4bits-fix-x
(equal (!cr4bits->pse$inline pse (cr4bits-fix x))
(!cr4bits->pse$inline pse x)))

**Theorem: **!cr4bits->pse$inline-cr4bits-equiv-congruence-on-x

(defthm !cr4bits->pse$inline-cr4bits-equiv-congruence-on-x
(implies (cr4bits-equiv x x-equiv)
(equal (!cr4bits->pse$inline pse x)
(!cr4bits->pse$inline pse x-equiv)))
:rule-classes :congruence)

**Theorem: **!cr4bits->pse-is-cr4bits

(defthm !cr4bits->pse-is-cr4bits
(equal (!cr4bits->pse pse x)
(change-cr4bits x :pse pse)))

**Theorem: **cr4bits->pse-of-!cr4bits->pse

(defthm cr4bits->pse-of-!cr4bits->pse
(b* ((?new-x (!cr4bits->pse$inline pse x)))
(equal (cr4bits->pse new-x)
(bfix pse))))

**Theorem: **!cr4bits->pse-equiv-under-mask

(defthm !cr4bits->pse-equiv-under-mask
(b* ((?new-x (!cr4bits->pse$inline pse x)))
(cr4bits-equiv-under-mask new-x x -17)))