Remove (an occurrence of) a value from an obag.
This is similar to set::delete for osets.
Function:
(defun delete (x bag) (declare (xargs :guard (bagp bag))) (let ((__function__ 'delete)) (declare (ignorable __function__)) (cond ((emptyp bag) nil) ((equal x (head bag)) (tail bag)) (t (cons (head bag) (delete x (tail bag)))))))
Theorem:
(defthm bagp-of-delete (b* ((bag1 (delete x bag))) (bagp bag1)) :rule-classes :rewrite)