Check if every key in a set is in an omap.
Function:
(defun in* (keys map) (declare (xargs :guard (and (setp keys) (mapp map)))) (let ((__function__ 'in*)) (declare (ignorable __function__)) (cond ((set::emptyp keys) t) (t (and (assoc (set::head keys) map) (in* (set::tail keys) map))))))
Theorem:
(defthm booleanp-of-in* (b* ((yes/no (in* keys map))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm in*-when-left-emptyp (implies (set::emptyp keys) (in* keys map)))
Theorem:
(defthm in*-when-rigth-emptyp (implies (emptyp map) (equal (in* keys map) (set::emptyp keys))))
Theorem:
(defthm in*-of-tail (implies (in* keys map) (in* (set::tail keys) map)))