Keep only warnings of certain types.
(vl-keep-warnings types x) → ans
This can be useful to highlight certain warnings that are of particular interest.
Function:
(defun vl-keep-warnings (types x) (declare (xargs :guard (and (symbol-listp types) (vl-warninglist-p x)))) (let ((__function__ 'vl-keep-warnings)) (declare (ignorable __function__)) (cond ((atom x) nil) ((member (vl-warning->type (car x)) (acl2::symbol-list-fix types)) (cons (vl-warning-fix (car x)) (vl-keep-warnings types (cdr x)))) (t (vl-keep-warnings types (cdr x))))))
Theorem:
(defthm vl-warninglist-p-of-vl-keep-warnings (implies (force (vl-warninglist-p x)) (b* ((ans (vl-keep-warnings types x))) (vl-warninglist-p ans))) :rule-classes :rewrite)
Theorem:
(defthm vl-keep-warnings-of-symbol-list-fix-types (equal (vl-keep-warnings (acl2::symbol-list-fix types) x) (vl-keep-warnings types x)))
Theorem:
(defthm vl-keep-warnings-symbol-list-equiv-congruence-on-types (implies (acl2::symbol-list-equiv types types-equiv) (equal (vl-keep-warnings types x) (vl-keep-warnings types-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-keep-warnings-of-vl-warninglist-fix-x (equal (vl-keep-warnings types (vl-warninglist-fix x)) (vl-keep-warnings types x)))
Theorem:
(defthm vl-keep-warnings-vl-warninglist-equiv-congruence-on-x (implies (vl-warninglist-equiv x x-equiv) (equal (vl-keep-warnings types x) (vl-keep-warnings types x-equiv))) :rule-classes :congruence)