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