Simplify a single-output aignet by assuming inputs from a top-level conjunction to be true.
(constprop aignet aignet2 config) → new-aignet2
Note: This should only be run on a single-output combinational aignet. In the current implementation it will return a copy of the original aignet otherwise; if we did attempt to apply the transform to each combinational output in a network having more than one, we might increase the size of the network.
This transform searches the top-level AND or OR gate nest of the output
formula for conjuncts/disjuncts that imply that combinational inputs are
equivalent to one another or to constants. It computes canonical forms of each
of the equivalence classes yielded by this process (where constant literals are
always the canonical representatives of their equivalence classes). It then
rephrases the formula as follows. Suppose F is the top-level formula and C is
the conjunction of all the inputs/negations. Let
Function:
(defun constprop (aignet aignet2 config) (declare (xargs :stobjs (aignet aignet2))) (declare (xargs :guard (constprop-config-p config))) (let ((__function__ 'constprop)) (declare (ignorable __function__)) (b* (((local-stobjs aignet-tmp) (mv aignet2 aignet-tmp)) (aignet-tmp (constprop-core aignet aignet-tmp config)) (aignet2 (aignet-prune-comb aignet-tmp aignet2 (constprop-config->gatesimp config)))) (mv aignet2 aignet-tmp))))
Theorem:
(defthm num-ins-of-constprop (b* ((?new-aignet2 (constprop aignet aignet2 config))) (equal (stype-count :pi new-aignet2) (stype-count :pi aignet))))
Theorem:
(defthm num-regs-of-constprop (b* ((?new-aignet2 (constprop aignet aignet2 config))) (equal (stype-count :reg new-aignet2) (stype-count :reg aignet))))
Theorem:
(defthm num-outs-of-constprop (b* ((?new-aignet2 (constprop aignet aignet2 config))) (equal (stype-count :po new-aignet2) (stype-count :po aignet))))
Theorem:
(defthm constprop-comb-equivalent (b* ((?new-aignet2 (constprop aignet aignet2 config))) (comb-equiv new-aignet2 aignet)))
Theorem:
(defthm normalize-inputs-of-constprop (b* nil (implies (syntaxp (not (equal aignet2 ''nil))) (equal (constprop aignet aignet2 config) (let ((aignet2 nil)) (constprop aignet aignet2 config))))))
Theorem:
(defthm constprop-of-node-list-fix-aignet (equal (constprop (node-list-fix aignet) aignet2 config) (constprop aignet aignet2 config)))
Theorem:
(defthm constprop-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet aignet-equiv) (equal (constprop aignet aignet2 config) (constprop aignet-equiv aignet2 config))) :rule-classes :congruence)
Theorem:
(defthm constprop-of-node-list-fix-aignet2 (equal (constprop aignet (node-list-fix aignet2) config) (constprop aignet aignet2 config)))
Theorem:
(defthm constprop-node-list-equiv-congruence-on-aignet2 (implies (node-list-equiv aignet2 aignet2-equiv) (equal (constprop aignet aignet2 config) (constprop aignet aignet2-equiv config))) :rule-classes :congruence)
Theorem:
(defthm constprop-of-constprop-config-fix-config (equal (constprop aignet aignet2 (constprop-config-fix config)) (constprop aignet aignet2 config)))
Theorem:
(defthm constprop-constprop-config-equiv-congruence-on-config (implies (constprop-config-equiv config config-equiv) (equal (constprop aignet aignet2 config) (constprop aignet aignet2 config-equiv))) :rule-classes :congruence)