Check well-formedness of lvalues in a vl-plainarg-p.
(vl-plainarg-lvaluecheck x loc instname warnings) → new-warnings
We check the lvalues throughout
Function:
(defun vl-plainarg-lvaluecheck (x loc instname warnings) (declare (xargs :guard (and (vl-plainarg-p x) (vl-warninglist-p warnings)))) (declare (xargs :guard (and (vl-location-p loc) (maybe-stringp instname)))) (let ((__function__ 'vl-plainarg-lvaluecheck)) (declare (ignorable __function__)) (b* ((dir (vl-plainarg->dir x)) (expr (vl-plainarg->expr x)) ((unless expr) (ok)) ((unless dir) (ok)) ((when (eq dir :vl-input)) (ok)) ((when (vl-expr-lvaluep expr)) (ok))) (warn :type :vl-bad-lvalue :msg "~l0: expression for ~s1 port ~s2 of instance ~w3 is not a ~ valid lvalue: ~a4.~%" :args (list loc (if (eq dir :vl-inout) "inout" "output") (vl-plainarg->portname x) instname expr)))))
Theorem:
(defthm vl-warninglist-p-of-vl-plainarg-lvaluecheck (b* ((new-warnings (vl-plainarg-lvaluecheck x loc instname warnings))) (vl-warninglist-p new-warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-plainarg-lvaluecheck-of-vl-plainarg-fix-x (equal (vl-plainarg-lvaluecheck (vl-plainarg-fix x) loc instname warnings) (vl-plainarg-lvaluecheck x loc instname warnings)))
Theorem:
(defthm vl-plainarg-lvaluecheck-vl-plainarg-equiv-congruence-on-x (implies (vl-plainarg-equiv x x-equiv) (equal (vl-plainarg-lvaluecheck x loc instname warnings) (vl-plainarg-lvaluecheck x-equiv loc instname warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-plainarg-lvaluecheck-of-vl-warninglist-fix-warnings (equal (vl-plainarg-lvaluecheck x loc instname (vl-warninglist-fix warnings)) (vl-plainarg-lvaluecheck x loc instname warnings)))
Theorem:
(defthm vl-plainarg-lvaluecheck-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-plainarg-lvaluecheck x loc instname warnings) (vl-plainarg-lvaluecheck x loc instname warnings-equiv))) :rule-classes :congruence)