Extend vl-replicate-modinst across a vl-modinstlist-p
(vl-replicate-modinstlist x nf ss warnings) → (mv warnings new-x nf)
Function:
(defun vl-replicate-modinstlist (x nf ss warnings) (declare (xargs :guard (and (vl-modinstlist-p x) (vl-namefactory-p nf) (vl-scopestack-p ss) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-replicate-modinstlist)) (declare (ignorable __function__)) (b* (((when (atom x)) (mv (ok) nil nf)) ((mv warnings car-insts nf) (vl-replicate-modinst (car x) nf ss warnings)) ((mv warnings cdr-insts nf) (vl-replicate-modinstlist (cdr x) nf ss warnings))) (mv warnings (append car-insts cdr-insts) nf))))
Theorem:
(defthm vl-warninglist-p-of-vl-replicate-modinstlist.warnings (b* (((mv ?warnings ?new-x ?nf) (vl-replicate-modinstlist x nf ss warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-modinstlist-p-of-vl-replicate-modinstlist.new-x (implies (and (force (vl-modinstlist-p x)) (force (vl-namefactory-p nf)) (force (vl-scopestack-p ss)) (force (vl-warninglist-p warnings))) (b* (((mv ?warnings ?new-x ?nf) (vl-replicate-modinstlist x nf ss warnings))) (vl-modinstlist-p new-x))) :rule-classes :rewrite)
Theorem:
(defthm vl-namefactory-p-of-vl-replicate-modinstlist.nf (implies (and (force (vl-modinstlist-p x)) (force (vl-namefactory-p nf)) (force (vl-scopestack-p ss)) (force (vl-warninglist-p warnings))) (b* (((mv ?warnings ?new-x ?nf) (vl-replicate-modinstlist x nf ss warnings))) (vl-namefactory-p nf))) :rule-classes :rewrite)
Theorem:
(defthm vl-replicate-modinstlist-mvtypes-1 (true-listp (mv-nth 1 (vl-replicate-modinstlist x nf ss warnings))) :rule-classes :type-prescription)