Update the |COMMON-LISP|::|TYPE| field of a system-segment-descriptorbits bit structure.
(!system-segment-descriptorbits->type type x) → new-x
Function:
(defun !system-segment-descriptorbits->type$inline (type x) (declare (xargs :guard (and (4bits-p type) (system-segment-descriptorbits-p x)))) (mbe :logic (b* ((type (mbe :logic (4bits-fix type) :exec type)) (x (system-segment-descriptorbits-fix x))) (part-install type x :width 4 :low 40)) :exec (the (unsigned-byte 128) (logior (the (unsigned-byte 128) (logand (the (unsigned-byte 128) x) (the (signed-byte 45) -16492674416641))) (the (unsigned-byte 44) (ash (the (unsigned-byte 4) type) 40))))))
Theorem:
(defthm system-segment-descriptorbits-p-of-!system-segment-descriptorbits->type (b* ((new-x (!system-segment-descriptorbits->type$inline type x))) (system-segment-descriptorbits-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !system-segment-descriptorbits->type$inline-of-4bits-fix-type (equal (!system-segment-descriptorbits->type$inline (4bits-fix type) x) (!system-segment-descriptorbits->type$inline type x)))
Theorem:
(defthm !system-segment-descriptorbits->type$inline-4bits-equiv-congruence-on-type (implies (4bits-equiv type type-equiv) (equal (!system-segment-descriptorbits->type$inline type x) (!system-segment-descriptorbits->type$inline type-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !system-segment-descriptorbits->type$inline-of-system-segment-descriptorbits-fix-x (equal (!system-segment-descriptorbits->type$inline type (system-segment-descriptorbits-fix x)) (!system-segment-descriptorbits->type$inline type x)))
Theorem:
(defthm !system-segment-descriptorbits->type$inline-system-segment-descriptorbits-equiv-congruence-on-x (implies (system-segment-descriptorbits-equiv x x-equiv) (equal (!system-segment-descriptorbits->type$inline type x) (!system-segment-descriptorbits->type$inline type x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !system-segment-descriptorbits->type-is-system-segment-descriptorbits (equal (!system-segment-descriptorbits->type type x) (change-system-segment-descriptorbits x :type type)))
Theorem:
(defthm system-segment-descriptorbits->type-of-!system-segment-descriptorbits->type (b* ((?new-x (!system-segment-descriptorbits->type$inline type x))) (equal (system-segment-descriptorbits->type new-x) (4bits-fix type))))
Theorem:
(defthm !system-segment-descriptorbits->type-equiv-under-mask (b* ((?new-x (!system-segment-descriptorbits->type$inline type x))) (system-segment-descriptorbits-equiv-under-mask new-x x -16492674416641)))