Implement an if-then-else of the given literals in an AIGNET, or find a node already representing the required logical expression.
(aignet-hash-mux c tb fb gatesimp strash aignet) → (mv result new-strash new-aignet)
See aignet-construction.
Function:
(defun aignet-hash-mux (c tb fb gatesimp strash aignet) (declare (xargs :stobjs (strash aignet))) (declare (type (unsigned-byte 30) c) (type (unsigned-byte 30) tb) (type (unsigned-byte 30) fb) (type (unsigned-byte 6) gatesimp)) (declare (xargs :guard (and (litp c) (litp tb) (litp fb) (gatesimp-p gatesimp)))) (declare (xargs :guard (and (fanin-litp c aignet) (fanin-litp tb aignet) (fanin-litp fb aignet)) :split-types t)) (let ((__function__ 'aignet-hash-mux)) (declare (ignorable __function__)) (b* ((aignet (mbe :logic (non-exec (node-list-fix aignet)) :exec aignet)) (c (mbe :logic (non-exec (aignet-lit-fix c aignet)) :exec c)) (tb (mbe :logic (non-exec (aignet-lit-fix tb aignet)) :exec tb)) (fb (mbe :logic (non-exec (aignet-lit-fix fb aignet)) :exec fb)) ((when (eql tb fb)) (mv tb strash aignet)) ((when (eql tb (lit-negate fb))) (aignet-hash-xor c fb gatesimp strash aignet))) (aignet-build (or (and c tb) (and (not c) fb)) gatesimp strash aignet))))
Theorem:
(defthm acl2::litp-of-aignet-hash-mux.result (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-mux c tb fb gatesimp strash aignet))) (litp result)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm acl2::aignet-extension-p-of-aignet-hash-mux (aignet-extension-p (mv-nth 2 (aignet-hash-mux c tb fb gatesimp strash aignet)) aignet) :rule-classes :rewrite)
Theorem:
(defthm aignet-litp-of-aignet-hash-mux (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-mux c tb fb gatesimp strash aignet))) (aignet-litp result new-aignet)))
Theorem:
(defthm deps-of-aignet-hash-mux (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-mux c tb fb gatesimp strash aignet))) (implies (and (not (depends-on (lit->var c) ci-id aignet)) (not (depends-on (lit->var tb) ci-id aignet)) (not (depends-on (lit->var fb) ci-id aignet))) (not (depends-on (lit->var result) ci-id new-aignet)))))
Theorem:
(defthm lit-eval-of-aignet-hash-mux (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-mux c tb fb gatesimp strash aignet))) (equal (lit-eval result invals regvals new-aignet) (b-ite (lit-eval c invals regvals aignet) (lit-eval tb invals regvals aignet) (lit-eval fb invals regvals aignet)))))
Theorem:
(defthm stype-counts-preserved-of-aignet-hash-mux (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-mux c tb fb 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-mux (b* (((mv ?result ?new-strash ?new-aignet) (aignet-hash-mux c tb fb gatesimp strash aignet))) (implies (and (< (fanin-count aignet) 536870909) (natp n) (<= 30 n)) (unsigned-byte-p n result))))
Theorem:
(defthm acl2::aignet-hash-mux-of-lit-fix-c (equal (aignet-hash-mux (lit-fix c) tb fb gatesimp strash aignet) (aignet-hash-mux c tb fb gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-mux-lit-equiv-congruence-on-c (implies (lit-equiv c acl2::c-equiv) (equal (aignet-hash-mux c tb fb gatesimp strash aignet) (aignet-hash-mux acl2::c-equiv tb fb gatesimp strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-mux-of-lit-fix-tb (equal (aignet-hash-mux c (lit-fix tb) fb gatesimp strash aignet) (aignet-hash-mux c tb fb gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-mux-lit-equiv-congruence-on-tb (implies (lit-equiv tb acl2::tb-equiv) (equal (aignet-hash-mux c tb fb gatesimp strash aignet) (aignet-hash-mux c acl2::tb-equiv fb gatesimp strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-mux-of-lit-fix-fb (equal (aignet-hash-mux c tb (lit-fix fb) gatesimp strash aignet) (aignet-hash-mux c tb fb gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-mux-lit-equiv-congruence-on-fb (implies (lit-equiv fb acl2::fb-equiv) (equal (aignet-hash-mux c tb fb gatesimp strash aignet) (aignet-hash-mux c tb acl2::fb-equiv gatesimp strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-mux-of-gatesimp-fix-gatesimp (equal (aignet-hash-mux c tb fb (gatesimp-fix gatesimp) strash aignet) (aignet-hash-mux c tb fb gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-mux-gatesimp-equiv-congruence-on-gatesimp (implies (gatesimp-equiv gatesimp acl2::gatesimp-equiv) (equal (aignet-hash-mux c tb fb gatesimp strash aignet) (aignet-hash-mux c tb fb acl2::gatesimp-equiv strash aignet))) :rule-classes :congruence)
Theorem:
(defthm acl2::aignet-hash-mux-of-node-list-fix-aignet (equal (aignet-hash-mux c tb fb gatesimp strash (node-list-fix aignet)) (aignet-hash-mux c tb fb gatesimp strash aignet)))
Theorem:
(defthm acl2::aignet-hash-mux-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet acl2::aignet-equiv) (equal (aignet-hash-mux c tb fb gatesimp strash aignet) (aignet-hash-mux c tb fb gatesimp strash acl2::aignet-equiv))) :rule-classes :congruence)