Set of keys to which any value in a set is associated.
This lifts rlookup* to sets of values.
Function:
(defun rlookup* (vals map) (declare (xargs :guard (and (setp vals) (mapp map)))) (let ((__function__ 'rlookup*)) (declare (ignorable __function__)) (cond ((set::emptyp vals) nil) (t (union (rlookup (set::head vals) map) (rlookup* (set::tail vals) map))))))
Theorem:
(defthm setp-of-rlookup* (b* ((keys (rlookup* vals map))) (setp keys)) :rule-classes :rewrite)
Theorem:
(defthm rlookup*-when-left-emptyp (implies (set::emptyp vals) (equal (rlookup* vals map) nil)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm rlookup*-when-right-emptyp (implies (emptyp map) (equal (rlookup* vals map) nil)) :rule-classes (:rewrite :type-prescription))