Set of values associated to a set of keys in an omap.
This lifts lookup to sets of keys.
Function:
(defun lookup* (keys map) (declare (xargs :guard (and (setp keys) (mapp map)))) (declare (xargs :guard (in* keys map))) (let ((__function__ 'lookup*)) (declare (ignorable __function__)) (cond ((set::emptyp keys) nil) ((mbt (if (assoc (set::head keys) map) t nil)) (insert (lookup (set::head keys) map) (lookup* (set::tail keys) map))) (t (lookup* (set::tail keys) map)))))
Theorem:
(defthm setp-of-lookup* (b* ((vals (lookup* keys map))) (setp vals)) :rule-classes :rewrite)
Theorem:
(defthm lookup*-when-left-emptyp (implies (set::emptyp keys) (equal (lookup* keys map) nil)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm lookup*-when-right-emptyp (implies (emptyp map) (equal (lookup* keys map) nil)))