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