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