Optimize expressions throughout a vl-modinst-p.
(vl-modinst-optimize x ss) → (mv changedp new-x)
Function:
(defun vl-modinst-optimize (x ss) (declare (xargs :guard (and (vl-modinst-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-modinst-optimize)) (declare (ignorable __function__)) (b* ((x (vl-modinst-fix x))) (b* (((mv changedp args-prime) (vl-arguments-optimize (vl-modinst->portargs x) ss))) (if (not changedp) (mv nil x) (mv t (change-vl-modinst x :portargs args-prime)))))))
Theorem:
(defthm booleanp-of-vl-modinst-optimize.changedp (b* (((mv ?changedp ?new-x) (vl-modinst-optimize x ss))) (booleanp changedp)) :rule-classes :type-prescription)
Theorem:
(defthm vl-modinst-p-of-vl-modinst-optimize.new-x (b* (((mv ?changedp ?new-x) (vl-modinst-optimize x ss))) (vl-modinst-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-modinst-optimize-of-vl-modinst-fix-x (equal (vl-modinst-optimize (vl-modinst-fix x) ss) (vl-modinst-optimize x ss)))
Theorem:
(defthm vl-modinst-optimize-vl-modinst-equiv-congruence-on-x (implies (vl-modinst-equiv x x-equiv) (equal (vl-modinst-optimize x ss) (vl-modinst-optimize x-equiv ss))) :rule-classes :congruence)
Theorem:
(defthm vl-modinst-optimize-of-vl-scopestack-fix-ss (equal (vl-modinst-optimize x (vl-scopestack-fix ss)) (vl-modinst-optimize x ss)))
Theorem:
(defthm vl-modinst-optimize-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-modinst-optimize x ss) (vl-modinst-optimize x ss-equiv))) :rule-classes :congruence)