(remove-from-alist key alist) removes all bindings for
Function:
(defun remove-from-alist (key alist) (declare (xargs :guard (alistp alist))) (let ((__function__ 'remove-from-alist)) (declare (ignorable __function__)) (cond ((atom alist) nil) ((equal key (caar alist)) (remove-from-alist key (cdr alist))) (t (cons (car alist) (remove-from-alist key (cdr alist)))))))
Theorem:
(defthm alistp-of-remove-from-alist (implies (and (force (alistp alist))) (b* ((ans (remove-from-alist key alist))) (alistp ans))) :rule-classes :rewrite)
Theorem:
(defthm remove-from-alist-when-not-consp (implies (not (consp alist)) (equal (remove-from-alist key alist) nil)))
Theorem:
(defthm remove-from-alist-of-cons (equal (remove-from-alist key (cons a x)) (if (equal key (car a)) (remove-from-alist key x) (cons a (remove-from-alist key x)))))