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