Recognizer for heap.
(heapp x) → *
Function:
(defun heapp (x) (declare (xargs :guard t)) (if (atom x) (null x) (and (consp (car x)) (addressp (caar x)) (valuep (cdar x)) (or (null (cdr x)) (and (consp (cdr x)) (consp (cadr x)) (acl2::fast-<< (caar x) (caadr x)) (heapp (cdr x)))))))
Theorem:
(defthm booleanp-of-heapp (booleanp (heapp x)))
Theorem:
(defthm mapp-when-heapp (implies (heapp x) (omap::mapp x)) :rule-classes (:rewrite :forward-chaining))
Theorem:
(defthm heapp-of-tail (implies (heapp x) (heapp (omap::tail x))))
Theorem:
(defthm addressp-of-head-key-when-heapp (implies (and (heapp x) (not (omap::emptyp x))) (addressp (mv-nth 0 (omap::head x)))))
Theorem:
(defthm valuep-of-head-val-when-heapp (implies (and (heapp x) (not (omap::emptyp x))) (valuep (mv-nth 1 (omap::head x)))))
Theorem:
(defthm heapp-of-update (implies (and (heapp x) (addressp k) (valuep v)) (heapp (omap::update k v x))))
Theorem:
(defthm heapp-of-update* (implies (and (heapp x) (heapp y)) (heapp (omap::update* x y))))
Theorem:
(defthm heapp-of-delete (implies (heapp x) (heapp (omap::delete k x))))
Theorem:
(defthm heapp-of-delete* (implies (heapp x) (heapp (omap::delete* k x))))
Theorem:
(defthm addressp-when-assoc-heapp-binds-free-x (implies (and (omap::assoc k x) (heapp x)) (addressp k)))
Theorem:
(defthm addressp-of-car-of-assoc-heapp (implies (and (heapp x) (omap::assoc k x)) (addressp (car (omap::assoc k x)))))
Theorem:
(defthm valuep-of-cdr-of-assoc-heapp (implies (and (heapp x) (omap::assoc k x)) (valuep (cdr (omap::assoc k x)))))
Theorem:
(defthm valuep-of-lookup-when-heapp (implies (and (heapp x) (omap::assoc k x)) (valuep (omap::lookup k x))))