Alist lookup that automatically 4v-fixes its result.
BOZO this is a convenient operation for ...
Function:
(defun 4v-lookup (k env) (declare (xargs :guard t)) (mbe :logic (let ((look (hons-get k env))) (if look (4v-fix (cdr look)) (4vx))) :exec (let ((look (hons-get k env))) (prog2$ (and (not look) (4v-lookup-not-found k)) (4v-fix (cdr look))))))
Theorem:
(defthm 4vp-of-4v-lookup (4vp (4v-lookup k env)))
Theorem:
(defthm 4v-fix-4v-lookup (equal (4v-fix (4v-lookup k env)) (4v-lookup k env)))