Update a design to include any warnings from a vl-reportcard-p.
(vl-apply-reportcard x reportcard) → new-x
This is typically the last step in using a reportcard. We change
the design
One subtlety is that the reportcard may mention modules that aren't in the design. This typically shouldn't happen. If it does, these warnings will be associated with the top-level design, instead.
Function:
(defun vl-apply-reportcard (x reportcard) (declare (xargs :guard (and (vl-design-p x) (vl-reportcard-p reportcard)))) (let ((__function__ 'vl-apply-reportcard)) (declare (ignorable __function__)) (b* (((vl-design x) (vl-design-fix x)) (reportcard (vl-reportcard-fix reportcard)) ((when (atom reportcard)) x) (reportcard (vl-clean-reportcard reportcard)) (valid-keys (vl-design-reportcard-keys x)) (valid-fal (make-lookup-alist valid-keys)) (revived (vl-reportcard-revive-invalid-warnings reportcard valid-fal)) (- (fast-alist-free valid-fal)) (new-toplevel (append-without-guard (cdr (hons-get :design reportcard)) revived x.warnings)) (new-x (change-vl-design x :mods (vl-modulelist-apply-reportcard x.mods reportcard) :udps (vl-udplist-apply-reportcard x.udps reportcard) :interfaces (vl-interfacelist-apply-reportcard x.interfaces reportcard) :programs (vl-programlist-apply-reportcard x.programs reportcard) :classes (vl-classlist-apply-reportcard x.classes reportcard) :packages (vl-packagelist-apply-reportcard x.packages reportcard) :configs (vl-configlist-apply-reportcard x.configs reportcard) :typedefs (vl-typedeflist-apply-reportcard x.typedefs reportcard) :warnings new-toplevel)) (- (fast-alist-free reportcard))) new-x)))
Theorem:
(defthm vl-design-p-of-vl-apply-reportcard (b* ((new-x (vl-apply-reportcard x reportcard))) (vl-design-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-apply-reportcard-of-vl-design-fix-x (equal (vl-apply-reportcard (vl-design-fix x) reportcard) (vl-apply-reportcard x reportcard)))
Theorem:
(defthm vl-apply-reportcard-vl-design-equiv-congruence-on-x (implies (vl-design-equiv x x-equiv) (equal (vl-apply-reportcard x reportcard) (vl-apply-reportcard x-equiv reportcard))) :rule-classes :congruence)
Theorem:
(defthm vl-apply-reportcard-of-vl-reportcard-fix-reportcard (equal (vl-apply-reportcard x (vl-reportcard-fix reportcard)) (vl-apply-reportcard x reportcard)))
Theorem:
(defthm vl-apply-reportcard-vl-reportcard-equiv-congruence-on-reportcard (implies (vl-reportcard-equiv reportcard reportcard-equiv) (equal (vl-apply-reportcard x reportcard) (vl-apply-reportcard x reportcard-equiv))) :rule-classes :congruence)