Access the |COMMON-LISP|::|IDENTITY| field of a simpcode bit structure.
(simpcode->identity x) → identity
Function:
(defun simpcode->identity (x) (declare (xargs :guard (simpcode-p x))) (mbe :logic (let ((x (simpcode-fix x))) (part-select x :low 2 :width 1)) :exec (the (unsigned-byte 1) (logand (the (unsigned-byte 1) 1) (the (unsigned-byte 2) (ash (the (unsigned-byte 4) x) -2))))))
Theorem:
(defthm bitp-of-simpcode->identity (b* ((identity (simpcode->identity x))) (bitp identity)) :rule-classes :rewrite)
Theorem:
(defthm simpcode->identity-of-simpcode-fix-x (equal (simpcode->identity (simpcode-fix x)) (simpcode->identity x)))
Theorem:
(defthm simpcode->identity-simpcode-equiv-congruence-on-x (implies (simpcode-equiv x x-equiv) (equal (simpcode->identity x) (simpcode->identity x-equiv))) :rule-classes :congruence)
Theorem:
(defthm simpcode->identity-of-simpcode (equal (simpcode->identity (simpcode neg xor identity choice)) (bfix identity)))
Theorem:
(defthm simpcode->identity-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x simpcode-equiv-under-mask) (simpcode-equiv-under-mask x acl2::y fty::mask) (equal (logand (lognot fty::mask) 4) 0)) (equal (simpcode->identity x) (simpcode->identity acl2::y))))