Remove instances of modules that we're supposed to drop.
(vl-module-drop-user-submodules x names fal) → new-x
Function:
(defun vl-module-drop-user-submodules (x names fal) (declare (xargs :guard (and (vl-module-p x) (string-listp names) (equal fal (make-lookup-alist names))))) (let ((__function__ 'vl-module-drop-user-submodules)) (declare (ignorable __function__)) (b* ((x (vl-module-fix x)) ((vl-module x) x) ((mv bad-insts good-insts) (vl-filter-modinsts-by-modname+ names x.modinsts fal)) ((when bad-insts) (b* ((nbad (len bad-insts)) (bad-names (mergesort (vl-modinstlist->modnames bad-insts))) (warnings (fatal :type :vl-dropped-insts :msg "In module ~m0, deleting ~x1 submodule ~ instance~s2 because ~s3 to the module~s4 ~ ~&5, which we have been told to drop. ~ These deletions might cause our analysis ~ to be flawed." :args (list x.name nbad (if (eql nbad 1) "" "s") (if (eql nbad 1) "it refers" "they refer") (if (vl-plural-p bad-names) "s" "") bad-names) :acc x.warnings))) (change-vl-module x :modinsts good-insts :warnings warnings)))) x)))
Theorem:
(defthm vl-module-p-of-vl-module-drop-user-submodules (b* ((new-x (vl-module-drop-user-submodules x names fal))) (vl-module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-module-drop-user-submodules-of-vl-module-fix-x (equal (vl-module-drop-user-submodules (vl-module-fix x) names fal) (vl-module-drop-user-submodules x names fal)))
Theorem:
(defthm vl-module-drop-user-submodules-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-module-drop-user-submodules x names fal) (vl-module-drop-user-submodules x-equiv names fal))) :rule-classes :congruence)
Theorem:
(defthm vl-module-drop-user-submodules-of-string-list-fix-names (equal (vl-module-drop-user-submodules x (string-list-fix names) fal) (vl-module-drop-user-submodules x names fal)))
Theorem:
(defthm vl-module-drop-user-submodules-string-list-equiv-congruence-on-names (implies (str::string-list-equiv names names-equiv) (equal (vl-module-drop-user-submodules x names fal) (vl-module-drop-user-submodules x names-equiv fal))) :rule-classes :congruence)