Convert the vl-res-sigma-p database into a list of E occurrences to drive each multiply driven wire.
(vl-make-res-occs idx sigma) takes
W --> (W_1 W_2 ... W_n)
Where
Function:
(defun vl-make-res-occs (idx sigma) "Returns (MV OCCS IDX')" (declare (xargs :guard (and (natp idx) (vl-res-sigma-p sigma)))) (b* ((idx (lnfix idx)) ((when (atom sigma)) (mv nil idx)) (out1 (caar sigma)) (ins1 (cdar sigma)) (idx (+ 1 idx)) (fresh (make-vl-emodwire :basename "vl_res" :index idx)) ((unless (and (true-listp ins1) (uniquep ins1))) (er hard? 'vl-make-res-occs "Failed to generate unique drivers!") (mv nil idx)) (occ1 (vl-make-res-occ fresh out1 ins1)) ((mv rest idx) (vl-make-res-occs idx (cdr sigma)))) (mv (cons occ1 rest) idx)))
Theorem:
(defthm vl-make-res-occs-mvtypes-0 (true-listp (mv-nth 0 (vl-make-res-occs idx sigma))) :rule-classes :type-prescription)
Theorem:
(defthm vl-make-res-occs-mvtypes-1 (natp (mv-nth 1 (vl-make-res-occs idx sigma))) :rule-classes :type-prescription)
Theorem:
(defthm good-esim-occsp-of-vl-make-res-occs (implies (and (force (natp idx)) (force (vl-res-sigma-p sigma))) (good-esim-occsp (mv-nth 0 (vl-make-res-occs idx sigma)))))