Rest of a non-empty obag after removing an occurrence of its smallest element.
This is similar to set::tail on osets.
Function:
(defun tail (bag) (declare (xargs :guard (bagp bag))) (declare (xargs :guard (not (emptyp bag)))) (let ((__function__ 'tail)) (declare (ignorable __function__)) (mbe :logic (cdr (bfix bag)) :exec (cdr bag))))
Theorem:
(defthm bagp-of-tail (b* ((bag1 (tail bag))) (bagp bag1)) :rule-classes :rewrite)
Theorem:
(defthm tail-when-emptyp (implies (emptyp bag) (equal (tail bag) nil)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm tail-count (implies (not (emptyp bag)) (< (acl2-count (tail bag)) (acl2-count bag))) :rule-classes (:rewrite :linear))
Theorem:
(defthm tail-count-built-in (implies (not (emptyp bag)) (o< (acl2-count (tail bag)) (acl2-count bag))) :rule-classes :built-in-clause)