Access the |AIGNET|::|LEVEL| field of a gatesimp bit structure.
(gatesimp->level x) → level
Function:
(defun gatesimp->level (x) (declare (xargs :guard (gatesimp-p x))) (mbe :logic (let ((x (gatesimp-fix x))) (part-select x :low 1 :width 3)) :exec (the (unsigned-byte 3) (logand (the (unsigned-byte 3) 7) (the (unsigned-byte 5) (ash (the (unsigned-byte 6) x) -1))))))
Theorem:
(defthm gatesimp-level-p-of-gatesimp->level (b* ((level (gatesimp->level x))) (gatesimp-level-p level)) :rule-classes :rewrite)
Theorem:
(defthm gatesimp->level-of-gatesimp-fix-x (equal (gatesimp->level (gatesimp-fix x)) (gatesimp->level x)))
Theorem:
(defthm gatesimp->level-gatesimp-equiv-congruence-on-x (implies (gatesimp-equiv x x-equiv) (equal (gatesimp->level x) (gatesimp->level x-equiv))) :rule-classes :congruence)
Theorem:
(defthm gatesimp->level-of-gatesimp (equal (gatesimp->level (gatesimp hashp level xor-mode)) (gatesimp-level-fix level)))
Theorem:
(defthm gatesimp->level-of-write-with-mask (implies (and (fty::bitstruct-read-over-write-hyps x gatesimp-equiv-under-mask) (gatesimp-equiv-under-mask x acl2::y fty::mask) (equal (logand (lognot fty::mask) 14) 0)) (equal (gatesimp->level x) (gatesimp->level acl2::y))))