Add an AND node to an AIGNET, or find a node already representing the required logical expression.
(aignet-hash-and lit1 lit2 gatesimp strash aignet) → (mv and-lit new-strash new-aignet)
See aignet-construction.
Function:
(defun aignet-hash-and (lit1 lit2 gatesimp strash aignet) (declare (xargs :stobjs (strash aignet))) (declare (type (unsigned-byte 30) lit1) (type (unsigned-byte 30) lit2) (type (unsigned-byte 6) gatesimp)) (declare (xargs :guard (and (litp lit1) (litp lit2) (gatesimp-p gatesimp)))) (declare (xargs :guard (and (fanin-litp lit1 aignet) (fanin-litp lit2 aignet)) :split-types t)) (let ((__function__ 'aignet-hash-and)) (declare (ignorable __function__)) (b* ((lit1 (mbe :logic (non-exec (aignet-lit-fix lit1 aignet)) :exec lit1)) (lit2 (mbe :logic (non-exec (aignet-lit-fix lit2 aignet)) :exec lit2)) ((mv code key lit1 lit2) (aignet-and-gate-simp/strash lit1 lit2 gatesimp strash aignet))) (aignet-install-gate code key lit1 lit2 gatesimp strash aignet))))
Theorem:
(defthm acl2::litp-of-aignet-hash-and.and-lit (b* (((mv ?and-lit ?new-strash ?new-aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet))) (litp and-lit)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm acl2::aignet-extension-p-of-aignet-hash-and (aignet-extension-p (mv-nth 2 (aignet-hash-and lit1 lit2 gatesimp strash aignet)) aignet) :rule-classes :rewrite)
Theorem:
(defthm aignet-litp-of-aignet-hash-and (b* (((mv ?and-lit ?new-strash ?new-aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet))) (aignet-litp and-lit new-aignet)))
Theorem:
(defthm deps-of-aignet-hash-and (b* (((mv ?and-lit ?new-strash ?new-aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet))) (implies (and (not (depends-on (lit->var lit1) ci-id aignet)) (not (depends-on (lit->var lit2) ci-id aignet))) (not (depends-on (lit->var and-lit) ci-id new-aignet)))))
Theorem:
(defthm lit-eval-of-aignet-hash-and (b* (((mv ?and-lit ?new-strash ?new-aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet))) (equal (lit-eval and-lit invals regvals new-aignet) (b-and (lit-eval lit1 invals regvals aignet) (lit-eval lit2 invals regvals aignet)))))
Theorem:
(defthm stype-counts-preserved-of-aignet-hash-and (b* (((mv ?and-lit ?new-strash ?new-aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet))) (implies (and (not (equal (stype-fix stype) (and-stype))) (not (equal (stype-fix stype) (xor-stype)))) (equal (stype-count stype new-aignet) (stype-count stype aignet)))))
Theorem:
(defthm unsigned-byte-p-of-aignet-hash-and (b* (((mv ?and-lit ?new-strash ?new-aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet))) (implies (and (< (fanin-count aignet) 536870911) (natp n) (<= 30 n)) (unsigned-byte-p n and-lit))))
Theorem:
(defthm fanin-count-of-aignet-hash-and (b* (((mv ?and-lit ?new-strash ?new-aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet))) (<= (fanin-count new-aignet) (+ 1 (fanin-count aignet)))) :rule-classes :linear)
Theorem:
(defthm acl2::aignet-hash-and-of-lit-fix-lit1 (equal (aignet-hash-and (lit-fix lit1) lit2 gatesimp strash aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-and-lit-equiv-congruence-on-lit1 (implies (lit-equiv lit1 acl2::lit1-equiv) (equal (aignet-hash-and lit1 lit2 gatesimp strash aignet) (aignet-hash-and acl2::lit1-equiv lit2 gatesimp strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-and-of-lit-fix-lit2 (equal (aignet-hash-and lit1 (lit-fix lit2) gatesimp strash aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-and-lit-equiv-congruence-on-lit2 (implies (lit-equiv lit2 acl2::lit2-equiv) (equal (aignet-hash-and lit1 lit2 gatesimp strash aignet) (aignet-hash-and lit1 acl2::lit2-equiv gatesimp strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-and-of-gatesimp-fix-gatesimp (equal (aignet-hash-and lit1 lit2 (gatesimp-fix gatesimp) strash aignet) (aignet-hash-and lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-and-gatesimp-equiv-congruence-on-gatesimp (implies (gatesimp-equiv gatesimp acl2::gatesimp-equiv) (equal (aignet-hash-and lit1 lit2 gatesimp strash aignet) (aignet-hash-and lit1 lit2 acl2::gatesimp-equiv strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-and-of-node-list-fix-aignet (equal (aignet-hash-and lit1 lit2 gatesimp strash (node-list-fix aignet)) (aignet-hash-and lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-and-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet acl2::aignet-equiv) (equal (aignet-hash-and lit1 lit2 gatesimp strash aignet) (aignet-hash-and lit1 lit2 gatesimp strash acl2::aignet-equiv))) :rule-classes :congruence)