Smallest element of a non-empty obag.
(head bag) → *
This is similar to head for osets.
Function:
(defun head (bag) (declare (xargs :guard (bagp bag))) (declare (xargs :guard (not (emptyp bag)))) (let ((__function__ 'head)) (declare (ignorable __function__)) (mbe :logic (car (bfix bag)) :exec (car bag))))
Theorem:
(defthm head-when-emptyp (implies (emptyp bag) (equal (head bag) nil)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm head-count (implies (not (emptyp bag)) (< (acl2-count (head bag)) (acl2-count bag))) :rule-classes (:rewrite :linear))
Theorem:
(defthm head-count-built-in (implies (not (emptyp bag)) (o< (acl2-count (head bag)) (acl2-count bag))) :rule-classes :built-in-clause)