Rewrite occurrences to drive new, fresh wires instead of multiply driven wires.
Signature: (vl-res-rewrite-occs occs mds idx sigma) returns
Function:
(defun vl-res-rewrite-occs (occs mds idx sigma) "Returns (MV OCCS' IDX' SIGMA')" (declare (xargs :guard (and (natp idx) (vl-emodwirelist-p (alist-keys mds)) (vl-res-sigma-p sigma)))) (b* (((when (atom occs)) (mv nil (lnfix idx) sigma)) ((mv car idx sigma) (vl-res-rewrite-occ (car occs) mds idx sigma)) ((mv cdr idx sigma) (vl-res-rewrite-occs (cdr occs) mds idx sigma))) (mv (cons car cdr) idx sigma)))
Theorem:
(defthm vl-res-rewrite-occs-mvtypes-0 (true-listp (mv-nth 0 (vl-res-rewrite-occs occs mds idx sigma))) :rule-classes :type-prescription)
Theorem:
(defthm vl-res-rewrite-occs-mvtypes-1 (natp (mv-nth 1 (vl-res-rewrite-occs occs mds idx sigma))) :rule-classes :type-prescription)
Theorem:
(defthm vl-res-sigma-p-of-vl-res-rewrite-occs (implies (and (vl-emodwirelist-p (alist-keys mds)) (vl-res-sigma-p sigma)) (vl-res-sigma-p (mv-nth 2 (vl-res-rewrite-occs occ mds idx sigma)))))
Theorem:
(defthm good-esim-occsp-of-vl-res-rewrite-occs (implies (good-esim-occsp occ) (good-esim-occsp (mv-nth 0 (vl-res-rewrite-occs occ mds idx sigma)))))