Safely generate the (fast) wirealist for a module.
(vl-module-wirealist x warnings) → (mv successp warnings wire-alist)
Note: this function is memoized and generates fast alists. You should be sure to clear its memo table so that these fast alists can be garbage collected.
This function can fail, setting
But unless the failure is due to a namespace problem, the resulting wire alist will be at least a partial wire alist for this module that has entries for all of the wires that don't have problems.
A key property of this function is that the wire alist it generates binds completely unique bits to all of the wires. This is proven as the following theorem:
Theorem:
(defthm no-duplicatesp-equal-of-append-alist-vals-of-vl-module-wirealist (let ((walist (mv-nth 2 (vl-module-wirealist x warnings)))) (no-duplicatesp-equal (append-alist-vals walist))))
Function:
(defun vl-module-wirealist (x warnings) (declare (xargs :guard (and (vl-module-p x) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-module-wirealist)) (declare (ignorable __function__)) (b* (((vl-module x) x) ((unless (mbe :logic (uniquep (vl-vardecllist->names x.vardecls)) :exec (uniquep (vl-vardecllist->names-exec x.vardecls nil)))) (mv nil (fatal :type :vl-namespace-error :msg "~m0 illegally redefines ~&1." :args (list x.name (duplicated-members (vl-vardecllist->names x.vardecls)))) nil))) (vl-vardecllist-to-wirealist x.vardecls warnings))))
Theorem:
(defthm booleanp-of-vl-module-wirealist.successp (b* (((mv ?successp ?warnings ?wire-alist) (vl-module-wirealist x warnings))) (booleanp successp)) :rule-classes :type-prescription)
Theorem:
(defthm vl-warninglist-p-of-vl-module-wirealist.warnings (b* (((mv ?successp ?warnings ?wire-alist) (vl-module-wirealist x warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-wirealist-p-of-vl-module-wirealist.wire-alist (b* (((mv ?successp ?warnings ?wire-alist) (vl-module-wirealist x warnings))) (vl-wirealist-p wire-alist)) :rule-classes :rewrite)
Theorem:
(defthm no-duplicatesp-equal-of-append-alist-vals-of-vl-module-wirealist (let ((walist (mv-nth 2 (vl-module-wirealist x warnings)))) (no-duplicatesp-equal (append-alist-vals walist))))