Update the |AIGNET|::|HASHP| field of a gatesimp bit structure.
(!gatesimp->hashp hashp x) → new-x
Function:
(defun !gatesimp->hashp (hashp x) (declare (xargs :guard (and (booleanp hashp) (gatesimp-p x)))) (mbe :logic (b* ((hashp (bool->bit hashp)) (x (gatesimp-fix x))) (part-install hashp x :width 1 :low 0)) :exec (the (unsigned-byte 6) (logior (the (unsigned-byte 6) (logand (the (unsigned-byte 6) x) (the (signed-byte 2) -2))) (the (unsigned-byte 1) (bool->bit hashp))))))
Theorem:
(defthm gatesimp-p-of-!gatesimp->hashp (b* ((new-x (!gatesimp->hashp hashp x))) (gatesimp-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm !gatesimp->hashp-of-bool-fix-hashp (equal (!gatesimp->hashp (acl2::bool-fix hashp) x) (!gatesimp->hashp hashp x)))
Theorem:
(defthm !gatesimp->hashp-iff-congruence-on-hashp (implies (iff hashp hashp-equiv) (equal (!gatesimp->hashp hashp x) (!gatesimp->hashp hashp-equiv x))) :rule-classes :congruence)
Theorem:
(defthm !gatesimp->hashp-of-gatesimp-fix-x (equal (!gatesimp->hashp hashp (gatesimp-fix x)) (!gatesimp->hashp hashp x)))
Theorem:
(defthm !gatesimp->hashp-gatesimp-equiv-congruence-on-x (implies (gatesimp-equiv x x-equiv) (equal (!gatesimp->hashp hashp x) (!gatesimp->hashp hashp x-equiv))) :rule-classes :congruence)
Theorem:
(defthm !gatesimp->hashp-is-gatesimp (equal (!gatesimp->hashp hashp x) (change-gatesimp x :hashp hashp)))
Theorem:
(defthm gatesimp->hashp-of-!gatesimp->hashp (b* ((?new-x (!gatesimp->hashp hashp x))) (equal (gatesimp->hashp new-x) (acl2::bool-fix hashp))))
Theorem:
(defthm !gatesimp->hashp-equiv-under-mask (b* ((?new-x (!gatesimp->hashp hashp x))) (gatesimp-equiv-under-mask new-x x -2)))