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