Apply DAG-aware rewriting to the network.
(rewrite aignet aignet2 config) → new-aignet2
Function:
(defun rewrite (aignet aignet2 config) (declare (xargs :stobjs (aignet aignet2))) (declare (xargs :guard (rewrite-config-p config))) (let ((__function__ 'rewrite)) (declare (ignorable __function__)) (b* (((local-stobjs aignet-tmp) (mv aignet2 aignet-tmp)) (aignet-tmp (rewrite-core aignet aignet-tmp config)) (aignet2 (aignet-prune-comb aignet-tmp aignet2 (rewrite-config->gatesimp config)))) (mv aignet2 aignet-tmp))))
Theorem:
(defthm stype-counts-of-rewrite (b* ((?new-aignet2 (rewrite aignet aignet2 config))) (and (equal (stype-count :pi new-aignet2) (stype-count :pi aignet)) (equal (stype-count :reg new-aignet2) (stype-count :reg aignet)) (equal (stype-count :po new-aignet2) (stype-count :po aignet)))))
Theorem:
(defthm rewrite-correct (b* ((?new-aignet2 (rewrite aignet aignet2 config))) (comb-equiv new-aignet2 aignet)))
Theorem:
(defthm rewrite-normalize-inputs (implies (syntaxp (not (equal aignet2 ''nil))) (equal (rewrite aignet aignet2 config) (rewrite aignet nil config))))
Theorem:
(defthm rewrite-of-node-list-fix-aignet (equal (rewrite (node-list-fix aignet) aignet2 config) (rewrite aignet aignet2 config)))
Theorem:
(defthm rewrite-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet aignet-equiv) (equal (rewrite aignet aignet2 config) (rewrite aignet-equiv aignet2 config))) :rule-classes :congruence)
Theorem:
(defthm rewrite-of-node-list-fix-aignet2 (equal (rewrite aignet (node-list-fix aignet2) config) (rewrite aignet aignet2 config)))
Theorem:
(defthm rewrite-node-list-equiv-congruence-on-aignet2 (implies (node-list-equiv aignet2 aignet2-equiv) (equal (rewrite aignet aignet2 config) (rewrite aignet aignet2-equiv config))) :rule-classes :congruence)
Theorem:
(defthm rewrite-of-rewrite-config-fix-config (equal (rewrite aignet aignet2 (rewrite-config-fix config)) (rewrite aignet aignet2 config)))
Theorem:
(defthm rewrite-rewrite-config-equiv-congruence-on-config (implies (rewrite-config-equiv config config-equiv) (equal (rewrite aignet aignet2 config) (rewrite aignet aignet2 config-equiv))) :rule-classes :congruence)