Access the |ACL2|::|XOR| field of a simpcode bit structure.
(simpcode->xor x) → xor
Function:
(defun simpcode->xor (x) (declare (xargs :guard (simpcode-p x))) (mbe :logic (let ((x (simpcode-fix x))) (part-select x :low 1 :width 1)) :exec (the (unsigned-byte 1) (logand (the (unsigned-byte 1) 1) (the (unsigned-byte 3) (ash (the (unsigned-byte 4) x) -1))))))
Theorem:
(defthm bitp-of-simpcode->xor (b* ((xor (simpcode->xor x))) (bitp xor)) :rule-classes :rewrite)
Theorem:
(defthm simpcode->xor-of-simpcode-fix-x (equal (simpcode->xor (simpcode-fix x)) (simpcode->xor x)))
Theorem:
(defthm simpcode->xor-simpcode-equiv-congruence-on-x (implies (simpcode-equiv x x-equiv) (equal (simpcode->xor x) (simpcode->xor x-equiv))) :rule-classes :congruence)
Theorem:
(defthm simpcode->xor-of-simpcode (equal (simpcode->xor (simpcode neg xor identity choice)) (bfix xor)))
Theorem:
(defthm simpcode->xor-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) 2) 0)) (equal (simpcode->xor x) (simpcode->xor acl2::y))))