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