Smallest key, and associated value, of a non-empty omap.
(head map) → (mv key val)
This is similar to set::head for osets.
Function:
(defun head (map) (declare (xargs :guard (mapp map))) (declare (xargs :guard (not (emptyp map)))) (let ((__function__ 'head)) (declare (ignorable __function__)) (let ((pair (car (mfix map)))) (mv (car pair) (cdr pair)))))
Theorem:
(defthm head-key-when-emptyp (implies (emptyp map) (equal (mv-nth 0 (head map)) nil)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm head-value-when-emptyp (implies (emptyp map) (equal (mv-nth 1 (head map)) nil)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm head-key-count (implies (not (emptyp map)) (< (acl2-count (mv-nth 0 (head map))) (acl2-count map))) :rule-classes (:rewrite :linear))
Theorem:
(defthm head-value-count (implies (not (emptyp map)) (< (acl2-count (mv-nth 1 (head map))) (acl2-count map))) :rule-classes (:rewrite :linear))
Theorem:
(defthm head-key-count-built-in (implies (not (emptyp map)) (o< (acl2-count (mv-nth 0 (head map))) (acl2-count map))) :rule-classes :built-in-clause)
Theorem:
(defthm head-value-count-built-in (implies (not (emptyp map)) (o< (acl2-count (mv-nth 1 (head map))) (acl2-count map))) :rule-classes :built-in-clause)