Throws away whatever part of the design is not necessary for particular design elements.
(vl-remove-unnecessary-elements keep design) → trimmed-design
Function:
(defun vl-remove-unnecessary-elements (keep design) (declare (xargs :guard (and (string-listp keep) (vl-design-p design)))) (let ((__function__ 'vl-remove-unnecessary-elements)) (declare (ignorable __function__)) (b* ((necessary (vl-necessary-elements-transitive keep design)) (fal (make-lookup-alist necessary)) ((vl-design design)) (mods (with-local-nrev (vl-fast-keep-modules necessary fal design.mods nrev))) (udps (with-local-nrev (vl-fast-keep-udps necessary fal design.udps nrev))) (interfaces (with-local-nrev (vl-fast-keep-interfaces necessary fal design.interfaces nrev))) (programs (with-local-nrev (vl-fast-keep-programs necessary fal design.programs nrev))) (packages (with-local-nrev (vl-fast-keep-packages necessary fal design.packages nrev))) (configs (with-local-nrev (vl-fast-keep-configs necessary fal design.configs nrev))) (vardecls (with-local-nrev (vl-fast-keep-vardecls necessary fal design.vardecls nrev))) (taskdecls (with-local-nrev (vl-fast-keep-taskdecls necessary fal design.taskdecls nrev))) (fundecls (with-local-nrev (vl-fast-keep-fundecls necessary fal design.fundecls nrev))) (paramdecls (with-local-nrev (vl-fast-keep-paramdecls necessary fal design.paramdecls nrev))) (typedefs (with-local-nrev (vl-fast-keep-typedefs necessary fal design.typedefs nrev))) (imports (with-local-nrev (vl-fast-keep-imports-by-package necessary fal design.imports nrev))) (- (fast-alist-free fal))) (change-vl-design design :mods mods :udps udps :interfaces interfaces :programs programs :packages packages :configs configs :vardecls vardecls :taskdecls taskdecls :fundecls fundecls :paramdecls paramdecls :typedefs typedefs :imports imports :fwdtypes nil))))
Theorem:
(defthm vl-design-p-of-vl-remove-unnecessary-elements (b* ((trimmed-design (vl-remove-unnecessary-elements keep design))) (vl-design-p trimmed-design)) :rule-classes :rewrite)
Theorem:
(defthm vl-remove-unnecessary-elements-of-string-list-fix-keep (equal (vl-remove-unnecessary-elements (string-list-fix keep) design) (vl-remove-unnecessary-elements keep design)))
Theorem:
(defthm vl-remove-unnecessary-elements-string-list-equiv-congruence-on-keep (implies (str::string-list-equiv keep keep-equiv) (equal (vl-remove-unnecessary-elements keep design) (vl-remove-unnecessary-elements keep-equiv design))) :rule-classes :congruence)
Theorem:
(defthm vl-remove-unnecessary-elements-of-vl-design-fix-design (equal (vl-remove-unnecessary-elements keep (vl-design-fix design)) (vl-remove-unnecessary-elements keep design)))
Theorem:
(defthm vl-remove-unnecessary-elements-vl-design-equiv-congruence-on-design (implies (vl-design-equiv design design-equiv) (equal (vl-remove-unnecessary-elements keep design) (vl-remove-unnecessary-elements keep design-equiv))) :rule-classes :congruence)