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