Check if an omap is empty.
This is similar to set::empty for osets.
Function:
(defun empty (map) (declare (xargs :guard (mapp map))) (let ((__function__ 'empty)) (declare (ignorable __function__)) (null (mfix map))))
Theorem:
(defthm booleanp-of-empty (b* ((yes/no (empty map))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm mapp-when-not-empty (implies (not (empty map)) (mapp map)))
Theorem:
(defthm mfix-when-empty (implies (empty x) (equal (mfix x) nil)))
Theorem:
(defthm mapp-non-nil-implies-non-empty (implies (and (mapp map) map) (not (empty map))))
Theorem:
(defthm acl2-count-head-when-non-empty (implies (not (empty map)) (< (+ (acl2-count (car (car map))) (acl2-count (cdr (car map)))) (acl2-count map))))