Filter a reportcard to only keep the warnings of certain types.
(vl-keep-from-reportcard types x) → sub-reportcard
Function:
(defun vl-keep-from-reportcard (types x) (declare (xargs :guard (and (symbol-listp types) (vl-reportcard-p x)))) (let ((__function__ 'vl-keep-from-reportcard)) (declare (ignorable __function__)) (b* ((x (vl-reportcard-fix x)) ((when (atom x)) nil) ((cons name1 warnings1) (car x)) (keep1 (vl-keep-warnings types warnings1)) (rest (vl-keep-from-reportcard types (cdr x))) ((when keep1) (hons-acons name1 keep1 rest))) rest)))
Theorem:
(defthm vl-reportcard-p-of-vl-keep-from-reportcard (b* ((sub-reportcard (vl-keep-from-reportcard types x))) (vl-reportcard-p sub-reportcard)) :rule-classes :rewrite)
Theorem:
(defthm vl-keep-from-reportcard-of-symbol-list-fix-types (equal (vl-keep-from-reportcard (acl2::symbol-list-fix types) x) (vl-keep-from-reportcard types x)))
Theorem:
(defthm vl-keep-from-reportcard-symbol-list-equiv-congruence-on-types (implies (acl2::symbol-list-equiv types types-equiv) (equal (vl-keep-from-reportcard types x) (vl-keep-from-reportcard types-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-keep-from-reportcard-of-vl-reportcard-fix-x (equal (vl-keep-from-reportcard types (vl-reportcard-fix x)) (vl-keep-from-reportcard types x)))
Theorem:
(defthm vl-keep-from-reportcard-vl-reportcard-equiv-congruence-on-x (implies (vl-reportcard-equiv x x-equiv) (equal (vl-keep-from-reportcard types x) (vl-keep-from-reportcard types x-equiv))) :rule-classes :congruence)