Process a plain argument and mark its wires in the alist. If the direction of the argument hasn't been resolved, return the list of any wires that have been used, so that we can issue a warning about them.
(vl-mark-wires-for-plainarg x alist warning-wires) → (mv new-alist warning-wires)
Function:
(defun vl-mark-wires-for-plainarg (x alist warning-wires) (declare (xargs :guard (and (vl-plainarg-p x) (vl-wireinfo-alistp alist) (string-listp warning-wires)))) (let ((__function__ 'vl-mark-wires-for-plainarg)) (declare (ignorable __function__)) (b* ((expr (vl-plainarg->expr x)) (dir (vl-plainarg->dir x)) ((unless expr) (mv alist warning-wires)) (wires (vl-expr-names expr))) (case dir (:vl-input (mv (vl-mark-wires-used wires t alist) warning-wires)) (:vl-output (mv (vl-mark-wires-set wires t alist) warning-wires)) (:vl-inout (let* ((alist (vl-mark-wires-used wires t alist)) (alist (vl-mark-wires-set wires t alist))) (mv alist warning-wires))) (t (mv alist (revappend wires warning-wires)))))))
Theorem:
(defthm vl-wireinfo-alistp-of-vl-mark-wires-for-plainarg.new-alist (implies (and (force (vl-plainarg-p x)) (force (vl-wireinfo-alistp alist)) (force (string-listp warning-wires))) (b* (((mv ?new-alist ?warning-wires) (vl-mark-wires-for-plainarg x alist warning-wires))) (vl-wireinfo-alistp new-alist))) :rule-classes :rewrite)
Theorem:
(defthm string-listp-of-vl-mark-wires-for-plainarg.warning-wires (implies (and (force (vl-plainarg-p x)) (force (vl-wireinfo-alistp alist)) (force (string-listp warning-wires))) (b* (((mv ?new-alist ?warning-wires) (vl-mark-wires-for-plainarg x alist warning-wires))) (string-listp warning-wires))) :rule-classes :rewrite)