Keep vl-description-ps by name.
(vl-keep-descriptions names x) → filtered-x
Function:
(defun vl-keep-descriptions (names x) (declare (xargs :guard (and (string-listp names) (vl-descriptionlist-p x)))) (let ((__function__ 'vl-keep-descriptions)) (declare (ignorable __function__)) (mbe :logic (cond ((atom x) nil) ((member-equal (vl-description->name (car x)) (string-list-fix names)) (cons (vl-description-fix (car x)) (vl-keep-descriptions names (cdr x)))) (t (vl-keep-descriptions names (cdr x)))) :exec (b* (((when (or (atom names) (atom x))) nil) ((unless (longer-than-p 10 names)) (vl-slow-keep-descriptions names x)) (fal (make-lookup-alist names)) (ans (with-local-nrev (vl-fast-keep-descriptions names fal x nrev))) (- (fast-alist-free fal))) ans))))
Theorem:
(defthm vl-descriptionlist-p-of-vl-keep-descriptions (b* ((filtered-x (vl-keep-descriptions names x))) (vl-descriptionlist-p filtered-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-keep-descriptions-when-atom (implies (atom x) (equal (vl-keep-descriptions names x) nil)))
Theorem:
(defthm vl-keep-descriptions-of-cons (equal (vl-keep-descriptions names (cons a x)) (if (member-equal (vl-description->name a) (string-list-fix names)) (cons (vl-description-fix a) (vl-keep-descriptions names x)) (vl-keep-descriptions names x))))
Theorem:
(defthm member-equal-of-vl-keep-descriptions (iff (member-equal a (vl-keep-descriptions names x)) (and (member-equal a (vl-descriptionlist-fix x)) (member-equal (vl-description->name a) (string-list-fix names)))))
Theorem:
(defthm subsetp-equal-of-vl-keep-descriptions (subsetp-equal (vl-keep-descriptions names x) (vl-descriptionlist-fix x)))
Theorem:
(defthm vl-keep-descriptions-when-atom-of-names (implies (atom names) (equal (vl-keep-descriptions names x) nil)))
Theorem:
(defthm vl-slow-keep-descriptions-removal (equal (vl-slow-keep-descriptions names x) (vl-keep-descriptions names x)))
Theorem:
(defthm vl-fast-keep-descriptions-removal (equal (vl-fast-keep-descriptions names fal x nrev) (append nrev (vl-keep-descriptions names x))))
Theorem:
(defthm vl-keep-descriptions-of-string-list-fix-names (equal (vl-keep-descriptions (string-list-fix names) x) (vl-keep-descriptions names x)))
Theorem:
(defthm vl-keep-descriptions-string-list-equiv-congruence-on-names (implies (str::string-list-equiv names names-equiv) (equal (vl-keep-descriptions names x) (vl-keep-descriptions names-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-keep-descriptions-of-vl-descriptionlist-fix-x (equal (vl-keep-descriptions names (vl-descriptionlist-fix x)) (vl-keep-descriptions names x)))
Theorem:
(defthm vl-keep-descriptions-vl-descriptionlist-equiv-congruence-on-x (implies (vl-descriptionlist-equiv x x-equiv) (equal (vl-keep-descriptions names x) (vl-keep-descriptions names x-equiv))) :rule-classes :congruence)