Clean up a module instance, removing any useless parameters.
(vl-modinst-elim-useless-params x map) → new-x
Function:
(defun vl-modinst-elim-useless-params (x map) (declare (xargs :guard (and (vl-modinst-p x) (vl-useless-params-map-p map)))) (let ((__function__ 'vl-modinst-elim-useless-params)) (declare (ignorable __function__)) (b* (((vl-modinst x) x) ((when (vl-paramargs-empty-p x.paramargs)) x) (entry (hons-get x.modname map)) ((unless entry) x) (args-prime (vl-paramargs-elim-useless-params (cdr entry) x.paramargs))) (change-vl-modinst x :paramargs args-prime))))
Theorem:
(defthm vl-modinst-p-of-vl-modinst-elim-useless-params (implies (force (vl-modinst-p x)) (b* ((new-x (vl-modinst-elim-useless-params x map))) (vl-modinst-p new-x))) :rule-classes :rewrite)