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