(observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2) → (mv new-copy new-strash new-aignet2)
Function:
(defun observability-fixed-inputs (n invals inmasks hyp-lit aignet copy gatesimp strash aignet2) (declare (xargs :stobjs (invals inmasks aignet copy strash aignet2))) (declare (xargs :guard (and (natp n) (litp hyp-lit) (gatesimp-p gatesimp)))) (declare (xargs :guard (and (<= (nfix n) (num-ins aignet)) (fanin-litp hyp-lit aignet2) (aignet-copies-in-bounds copy aignet2) (<= (num-ins aignet) (num-ins aignet2)) (<= (num-ins aignet) (bits-length invals)) (<= (num-ins aignet) (bits-length inmasks)) (<= (num-fanins aignet) (lits-length copy))))) (let ((__function__ 'observability-fixed-inputs)) (declare (ignorable __function__)) (b* (((when (mbe :logic (zp (- (num-ins aignet) (nfix n))) :exec (eql (num-ins aignet) n))) (b* ((aignet2 (aignet-fix aignet2))) (mv copy strash aignet2))) (input-lit (get-lit (innum->id n aignet) copy)) ((mv fixed-lit strash aignet2) (if (eql 1 (get-bit n inmasks)) (aignet-hash-mux hyp-lit input-lit (get-bit n invals) gatesimp strash aignet2) (mv input-lit strash aignet2))) (orig-id (innum->id n aignet)) (copy (set-lit orig-id fixed-lit copy))) (observability-fixed-inputs (1+ (lnfix n)) invals inmasks hyp-lit aignet copy gatesimp strash aignet2))))
Theorem:
(defthm copies-in-bounds-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (implies (and (aignet-copies-in-bounds copy aignet2) (aignet-litp hyp-lit aignet2) (<= (num-ins aignet) (num-ins aignet2))) (aignet-copies-in-bounds new-copy new-aignet2))))
Theorem:
(defthm copy-length-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (implies (<= (num-fanins aignet) (len copy)) (equal (len new-copy) (len copy)))))
Theorem:
(defthm aignet-extension-p-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (aignet-extension-p new-aignet2 aignet2)))
Theorem:
(defthm stypes-preserved-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (implies (and (not (equal (stype-fix stype) (and-stype))) (not (equal (stype-fix stype) (xor-stype)))) (equal (stype-count stype new-aignet2) (stype-count stype aignet2)))))
Theorem:
(defthm non-input-copy-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (implies (not (equal (stype (car (lookup-id id aignet))) :pi)) (equal (nth-lit id new-copy) (nth-lit id copy)))))
Theorem:
(defthm input-copy-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (implies (and (<= (nfix n) (nfix innum)) (< (nfix innum) (num-ins aignet)) (aignet-litp hyp-lit aignet2) (aignet-copies-in-bounds copy aignet2) (<= (num-ins aignet) (num-ins aignet2)) (equal 1 (lit-eval hyp-lit some-invals some-regvals aignet2))) (equal (lit-eval (nth-lit (fanin-count (lookup-stype innum :pi aignet)) new-copy) some-invals some-regvals new-aignet2) (lit-eval (nth-lit (fanin-count (lookup-stype innum :pi aignet)) copy) some-invals some-regvals aignet2)))))
Theorem:
(defthm input-copy-values-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (implies (and (aignet-litp hyp-lit aignet2) (aignet-copies-in-bounds copy aignet2) (<= (num-ins aignet) (num-ins aignet2)) (equal 1 (lit-eval hyp-lit some-invals some-regvals aignet2))) (equal (input-copy-values n some-invals some-regvals aignet new-copy new-aignet2) (input-copy-values n some-invals some-regvals aignet copy aignet2)))))
Theorem:
(defthm reg-copy-values-of-observability-fixed-inputs (b* (((mv ?new-copy ?new-strash ?new-aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) (implies (and (aignet-copies-in-bounds copy aignet2) (aignet-litp hyp-lit aignet2) (<= (num-ins aignet) (num-ins aignet2))) (equal (reg-copy-values 0 some-invals some-regvals aignet new-copy new-aignet2) (reg-copy-values 0 some-invals some-regvals aignet copy aignet2)))))
Theorem:
(defthm observability-fixed-inputs-of-nfix-n (equal (observability-fixed-inputs (nfix n) invals inmasks hyp-lit aignet copy gatesimp strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2)))
Theorem:
(defthm observability-fixed-inputs-nat-equiv-congruence-on-n (implies (nat-equiv n n-equiv) (equal (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2) (observability-fixed-inputs n-equiv invals inmasks hyp-lit aignet copy gatesimp strash aignet2))) :rule-classes :congruence)
Theorem:
(defthm observability-fixed-inputs-of-lit-fix-hyp-lit (equal (observability-fixed-inputs n invals inmasks (lit-fix hyp-lit) aignet copy gatesimp strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2)))
Theorem:
(defthm observability-fixed-inputs-lit-equiv-congruence-on-hyp-lit (implies (lit-equiv hyp-lit hyp-lit-equiv) (equal (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit-equiv aignet copy gatesimp strash aignet2))) :rule-classes :congruence)
Theorem:
(defthm observability-fixed-inputs-of-node-list-fix-aignet (equal (observability-fixed-inputs n invals inmasks hyp-lit (node-list-fix aignet) copy gatesimp strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2)))
Theorem:
(defthm observability-fixed-inputs-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet aignet-equiv) (equal (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet-equiv copy gatesimp strash aignet2))) :rule-classes :congruence)
Theorem:
(defthm observability-fixed-inputs-of-gatesimp-fix-gatesimp (equal (observability-fixed-inputs n invals inmasks hyp-lit aignet copy (gatesimp-fix gatesimp) strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2)))
Theorem:
(defthm observability-fixed-inputs-gatesimp-equiv-congruence-on-gatesimp (implies (gatesimp-equiv gatesimp gatesimp-equiv) (equal (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp-equiv strash aignet2))) :rule-classes :congruence)
Theorem:
(defthm observability-fixed-inputs-of-node-list-fix-aignet2 (equal (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash (node-list-fix aignet2)) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2)))
Theorem:
(defthm observability-fixed-inputs-node-list-equiv-congruence-on-aignet2 (implies (node-list-equiv aignet2 aignet2-equiv) (equal (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2) (observability-fixed-inputs n invals inmasks hyp-lit aignet copy gatesimp strash aignet2-equiv))) :rule-classes :congruence)