Gather symbols whose names have some (case-insensitive) substring.
(collect-syms-with-isubstr a x) returns a list of all the symbols
in the list
See also collect-strs-with-isubstr, which is similar but for string lists instead of symbol lists.
Function:
(defun collect-syms-with-isubstr (a x) (declare (xargs :guard (and (stringp a) (symbol-listp x)))) (cond ((atom x) nil) ((isubstrp a (symbol-name (car x))) (cons (car x) (collect-syms-with-isubstr a (cdr x)))) (t (collect-syms-with-isubstr a (cdr x)))))
Theorem:
(defthm istreqv-implies-equal-collect-syms-with-isubstr-1 (implies (istreqv a a-equiv) (equal (collect-syms-with-isubstr a x) (collect-syms-with-isubstr a-equiv x))) :rule-classes (:congruence))
Theorem:
(defthm collect-syms-with-isubstr-when-atom (implies (atom x) (equal (collect-syms-with-isubstr a x) nil)))
Theorem:
(defthm collect-syms-with-isubstr-of-cons (equal (collect-syms-with-isubstr a (cons b x)) (if (isubstrp a (symbol-name b)) (cons b (collect-syms-with-isubstr a x)) (collect-syms-with-isubstr a x))))
Theorem:
(defthm member-equal-collect-syms-with-isubstr (iff (member-equal b (collect-syms-with-isubstr a x)) (and (member-equal b x) (isubstrp a (symbol-name b)))))
Theorem:
(defthm subsetp-equal-of-collect-syms-with-isubstr (implies (subsetp-equal x y) (subsetp-equal (collect-syms-with-isubstr a x) y)))
Theorem:
(defthm subsetp-equal-collect-syms-with-isubstr-self (subsetp-equal (collect-syms-with-isubstr a x) x))