Remove all elements in
(remove-all x y) → *
Function:
(defun remove-all (x y) (declare (xargs :guard (and (true-listp x) (true-listp y)))) (let ((__function__ 'remove-all)) (declare (ignorable __function__)) (if (endp x) y (remove-all (cdr x) (remove-equal (car x) y)))))
Theorem:
(defthm remove-all-cons-to-remove-all-remove-equal (equal (remove-all (cons e x) y) (remove-all x (remove-equal e y))))
Theorem:
(defthm remove-all-x-and-cdr-x (equal (remove-all x (cdr x)) nil))
Theorem:
(defthm remove-all-x-x-is-nil (implies (true-listp x) (equal (remove-all x x) nil)))
Theorem:
(defthm remove-all-and-remove-equal-commute (equal (remove-all as (remove-equal e bs)) (remove-equal e (remove-all as bs))))
Theorem:
(defthm remove-all-commutes (equal (remove-all as (remove-all bs cs)) (remove-all bs (remove-all as cs))))
Theorem:
(defthm remove-all-returns-a-subset-of-the-list (subsetp-equal (remove-all x y) y))
Theorem:
(defthm remove-all-and-member-equal-1 (implies (member-equal e a) (equal (member-equal e (remove-all a b)) nil)))
Theorem:
(defthm remove-all-and-member-equal-2 (implies (not (member-equal e a)) (iff (member-equal e (remove-all a b)) (member-equal e b))))
Theorem:
(defthm remove-all-of-nil-is-nil (equal (remove-all x nil) nil))
Theorem:
(defthm remove-all-x-from-cons-e-y (equal (remove-all x (cons e y)) (if (member-equal e x) (remove-all x y) (cons e (remove-all x y)))))
Theorem:
(defthm remove-all-superset-from-subset-is-nil (implies (and (subsetp-equal y x) (true-listp y)) (equal (remove-all x y) nil)))
Theorem:
(defthm remove-all-and-set-equiv (implies (and (acl2::set-equiv x y) (true-listp y)) (equal (remove-all x y) nil)))
Theorem:
(defthm nested-remove-alls-and-subsetp-equal (implies (subsetp-equal a c) (subsetp-equal a (remove-all (remove-all a b) c))))