Name a module instance, if necessary.
(vl-modinst-addinstnames x nf) → (mv new-x nf)
Function:
(defun vl-modinst-addinstnames (x nf) (declare (xargs :guard (and (vl-modinst-p x) (vl-namefactory-p nf)))) (let ((__function__ 'vl-modinst-addinstnames)) (declare (ignorable __function__)) (b* (((when (vl-modinst->instname x)) (mv (vl-modinst-fix x) (vl-namefactory-fix nf))) ((mv new-name nf) (vl-namefactory-indexed-name "modinst" nf)) (new-x (change-vl-modinst x :instname new-name))) (mv new-x nf))))
Theorem:
(defthm vl-modinst-p-of-vl-modinst-addinstnames.new-x (b* (((mv ?new-x ?nf) (vl-modinst-addinstnames x nf))) (vl-modinst-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-namefactory-p-of-vl-modinst-addinstnames.nf (b* (((mv ?new-x ?nf) (vl-modinst-addinstnames x nf))) (vl-namefactory-p nf)) :rule-classes :rewrite)
Theorem:
(defthm vl-modinst-addinstnames-of-vl-modinst-fix-x (equal (vl-modinst-addinstnames (vl-modinst-fix x) nf) (vl-modinst-addinstnames x nf)))
Theorem:
(defthm vl-modinst-addinstnames-vl-modinst-equiv-congruence-on-x (implies (vl-modinst-equiv x x-equiv) (equal (vl-modinst-addinstnames x nf) (vl-modinst-addinstnames x-equiv nf))) :rule-classes :congruence)
Theorem:
(defthm vl-modinst-addinstnames-of-vl-namefactory-fix-nf (equal (vl-modinst-addinstnames x (vl-namefactory-fix nf)) (vl-modinst-addinstnames x nf)))
Theorem:
(defthm vl-modinst-addinstnames-vl-namefactory-equiv-congruence-on-nf (implies (vl-namefactory-equiv nf nf-equiv) (equal (vl-modinst-addinstnames x nf) (vl-modinst-addinstnames x nf-equiv))) :rule-classes :congruence)