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