Extend an alist by binding the names of vl-fundecls to their definitions.
(vl-fundecllist-alist x acc) → alist
This can be used as an alternative to vl-find-fundecl when you need to perform a lot of lookups.
Function:
(defun vl-fundecllist-alist (x acc) (declare (xargs :guard (vl-fundecllist-p x))) (let ((__function__ 'vl-fundecllist-alist)) (declare (ignorable __function__)) (if (atom x) acc (cons (cons (vl-fundecl->name (car x)) (vl-fundecl-fix (car x))) (vl-fundecllist-alist (cdr x) acc)))))
Theorem:
(defthm return-type-of-vl-fundecllist-alist (b* ((alist (vl-fundecllist-alist x acc))) (equal (vl-fundecl-alist-p alist) (vl-fundecl-alist-p acc))) :rule-classes :rewrite)
Theorem:
(defthm lookup-in-vl-fundecllist-alist-acc-elim (implies (syntaxp (not (equal acc ''nil))) (equal (hons-assoc-equal name (vl-fundecllist-alist x acc)) (or (hons-assoc-equal name (vl-fundecllist-alist x nil)) (hons-assoc-equal name acc)))))
Theorem:
(defthm lookup-in-vl-fundecllist-alist-fast (implies (stringp name) (equal (hons-assoc-equal name (vl-fundecllist-alist x nil)) (let ((val (vl-find-fundecl name x))) (and val (cons name val))))))
Theorem:
(defthm vl-fundecllist-alist-of-vl-fundecllist-fix-x (equal (vl-fundecllist-alist (vl-fundecllist-fix x) acc) (vl-fundecllist-alist x acc)))
Theorem:
(defthm vl-fundecllist-alist-vl-fundecllist-equiv-congruence-on-x (implies (vl-fundecllist-equiv x x-equiv) (equal (vl-fundecllist-alist x acc) (vl-fundecllist-alist x-equiv acc))) :rule-classes :congruence)