Transform the aignet so that some observability don't-care conditions don't affect the logical equivalence of nodes.
(observability-fix aignet aignet2 config state) → (mv new-aignet2 new-state)
This is mainly intended to be used on a single-output aignet, and
mainly as a precursor to fraiging. Settings for the transform can be tweaked
using the
Suppose we have a single-output AIG whose function is
The observability transform detects such situations and applies the
following transform, which restricts the inputs to
First, decompose the topmost AND in the output and sort conjuncts into small
and large ones according to some thresholds. The small ones are conjoined
together as
Next, find a satisfying assignment for
This provably produces a combinationally equivalent network, since
Theorem:
(defthm observability-fix-comb-equivalent (b* (((mv ?new-aignet2 ?new-state) (observability-fix aignet aignet2 config state))) (comb-equiv new-aignet2 aignet)))
Function:
(defun observability-fix (aignet aignet2 config state) (declare (xargs :stobjs (aignet aignet2 state))) (declare (xargs :guard (observability-config-p config))) (let ((__function__ 'observability-fix)) (declare (ignorable __function__)) (b* (((local-stobjs aignet-tmp) (mv aignet2 aignet-tmp state)) (aignet2 (aignet-raw-copy aignet aignet2)) ((mv aignet-tmp aignet2 state) (observability-fix-core aignet2 aignet-tmp config state)) (aignet2 (aignet-prune-comb aignet-tmp aignet2 (observability-config->gatesimp config)))) (mv aignet2 aignet-tmp state))))
Theorem:
(defthm num-ins-of-observability-fix (b* (((mv ?new-aignet2 ?new-state) (observability-fix aignet aignet2 config state))) (equal (stype-count :pi new-aignet2) (stype-count :pi aignet))))
Theorem:
(defthm num-regs-of-observability-fix (b* (((mv ?new-aignet2 ?new-state) (observability-fix aignet aignet2 config state))) (equal (stype-count :reg new-aignet2) (stype-count :reg aignet))))
Theorem:
(defthm num-outs-of-observability-fix (b* (((mv ?new-aignet2 ?new-state) (observability-fix aignet aignet2 config state))) (equal (stype-count :po new-aignet2) (stype-count :po aignet))))
Theorem:
(defthm observability-fix-comb-equivalent (b* (((mv ?new-aignet2 ?new-state) (observability-fix aignet aignet2 config state))) (comb-equiv new-aignet2 aignet)))
Theorem:
(defthm normalize-input-of-observability-fix (implies (syntaxp (not (equal aignet2 ''nil))) (equal (observability-fix aignet aignet2 config state) (observability-fix aignet nil config state))))
Theorem:
(defthm w-state-of-observability-fix (b* (((mv ?new-aignet2 ?new-state) (observability-fix aignet aignet2 config state))) (equal (w new-state) (w state))))
Theorem:
(defthm observability-fix-of-node-list-fix-aignet (equal (observability-fix (node-list-fix aignet) aignet2 config state) (observability-fix aignet aignet2 config state)))
Theorem:
(defthm observability-fix-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet aignet-equiv) (equal (observability-fix aignet aignet2 config state) (observability-fix aignet-equiv aignet2 config state))) :rule-classes :congruence)
Theorem:
(defthm observability-fix-of-node-list-fix-aignet2 (equal (observability-fix aignet (node-list-fix aignet2) config state) (observability-fix aignet aignet2 config state)))
Theorem:
(defthm observability-fix-node-list-equiv-congruence-on-aignet2 (implies (node-list-equiv aignet2 aignet2-equiv) (equal (observability-fix aignet aignet2 config state) (observability-fix aignet aignet2-equiv config state))) :rule-classes :congruence)
Theorem:
(defthm observability-fix-of-observability-config-fix-config (equal (observability-fix aignet aignet2 (observability-config-fix config) state) (observability-fix aignet aignet2 config state)))
Theorem:
(defthm observability-fix-observability-config-equiv-congruence-on-config (implies (observability-config-equiv config config-equiv) (equal (observability-fix aignet aignet2 config state) (observability-fix aignet aignet2 config-equiv state))) :rule-classes :congruence)