Build an omap from an alist.
If there are duplicate keys in the alist, the leftmost one, with the corresponding value, will be in the resulting omap. This is consistent with the shadowing of alists.
Function:
(defun from-alist (alist) (declare (xargs :guard (alistp alist))) (let ((__function__ 'from-alist)) (declare (ignorable __function__)) (cond ((endp alist) nil) (t (update (caar alist) (cdar alist) (from-alist (cdr alist)))))))
Theorem:
(defthm mapp-of-from-alist (b* ((map (from-alist alist))) (mapp map)) :rule-classes :rewrite)