Implement an OR of two literals node in an AIGNET, or find a node already representing the required logical expression.
(aignet-hash-or lit1 lit2 gatesimp strash aignet) → (mv result new-strash new-aignet)
See aignet-construction.
Function:
(defun aignet-hash-or (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-or)) (declare (ignorable __function__)) (b* (((mv lit strash aignet) (aignet-hash-and (lit-negate^ lit1) (lit-negate^ lit2) gatesimp strash aignet))) (mv (lit-negate^ lit) strash aignet))))
Theorem:
(defthm acl2::litp-of-aignet-hash-or.result (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet))) (litp result)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm acl2::aignet-extension-p-of-aignet-hash-or (aignet-extension-p (mv-nth 2 (aignet-hash-or lit1 lit2 gatesimp strash aignet)) aignet) :rule-classes :rewrite)
Theorem:
(defthm aignet-litp-of-aignet-hash-or (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet))) (implies (and (aignet-litp lit1 aignet) (aignet-litp lit2 aignet)) (aignet-litp result new-aignet))))
Theorem:
(defthm deps-of-aignet-hash-or (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-or 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 result) ci-id new-aignet)))))
Theorem:
(defthm lit-eval-of-aignet-hash-or (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet))) (equal (lit-eval result invals regvals new-aignet) (b-ior (lit-eval lit1 invals regvals aignet) (lit-eval lit2 invals regvals aignet)))))
Theorem:
(defthm stype-counts-preserved-of-aignet-hash-or (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-or 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-or (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet))) (implies (and (< (fanin-count aignet) 536870911) (natp n) (<= 30 n)) (unsigned-byte-p n result))))
Theorem:
(defthm fanin-count-of-aignet-hash-or (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet))) (<= (fanin-count new-aignet) (+ 1 (fanin-count aignet)))) :rule-classes :linear)
Theorem:
(defthm acl2::aignet-hash-or-of-lit-fix-lit1 (equal (aignet-hash-or (lit-fix lit1) lit2 gatesimp strash aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-or-lit-equiv-congruence-on-lit1 (implies (lit-equiv lit1 acl2::lit1-equiv) (equal (aignet-hash-or lit1 lit2 gatesimp strash aignet) (aignet-hash-or acl2::lit1-equiv lit2 gatesimp strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-or-of-lit-fix-lit2 (equal (aignet-hash-or lit1 (lit-fix lit2) gatesimp strash aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-or-lit-equiv-congruence-on-lit2 (implies (lit-equiv lit2 acl2::lit2-equiv) (equal (aignet-hash-or lit1 lit2 gatesimp strash aignet) (aignet-hash-or lit1 acl2::lit2-equiv gatesimp strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-or-of-gatesimp-fix-gatesimp (equal (aignet-hash-or lit1 lit2 (gatesimp-fix gatesimp) strash aignet) (aignet-hash-or lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-or-gatesimp-equiv-congruence-on-gatesimp (implies (gatesimp-equiv gatesimp acl2::gatesimp-equiv) (equal (aignet-hash-or lit1 lit2 gatesimp strash aignet) (aignet-hash-or lit1 lit2 acl2::gatesimp-equiv strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-or-of-node-list-fix-aignet (equal (aignet-hash-or lit1 lit2 gatesimp strash (node-list-fix aignet)) (aignet-hash-or lit1 lit2 gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-or-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet acl2::aignet-equiv) (equal (aignet-hash-or lit1 lit2 gatesimp strash aignet) (aignet-hash-or lit1 lit2 gatesimp strash acl2::aignet-equiv))) :rule-classes :congruence)