Gather up a sub-alist from some 4v environment.
Function:
(defun 4v-alist-extract (keys al) (declare (xargs :guard t)) (if (atom keys) nil (cons (cons (car keys) (4v-lookup (car keys) al)) (4v-alist-extract (cdr keys) al))))
Theorem:
(defthm alist-keys-4v-alist-extract (equal (alist-keys (4v-alist-extract keys alist)) (append keys nil)))
Theorem:
(defthm hons-assoc-equal-4v-alist-extract (equal (hons-assoc-equal key (4v-alist-extract keys al)) (and (member-equal key keys) (cons key (4v-fix (cdr (hons-assoc-equal key al)))))))
Theorem:
(defthm set-equiv-implies-key-and-env-equiv-4v-alist-extract-1 (implies (set-equiv keys keys-equiv) (key-and-env-equiv (4v-alist-extract keys al) (4v-alist-extract keys-equiv al))) :rule-classes (:congruence))