Check well-formedness of lvalues in a vl-assign-p.
(vl-assign-lvaluecheck x warnings) → new-warnings
We check the lvalues throughout
Function:
(defun vl-assign-lvaluecheck (x warnings) (declare (xargs :guard (and (vl-assign-p x) (vl-warninglist-p warnings)))) (declare (xargs :guard t)) (let ((__function__ 'vl-assign-lvaluecheck)) (declare (ignorable __function__)) (b* ((lvalue (vl-assign->lvalue x)) ((when (vl-expr-lvaluep lvalue)) (ok)) (loc (vl-assign->loc x))) (warn :type :vl-bad-lvalue :msg "~l0: assignment to bad lvalue ~a1." :args (list loc lvalue)))))
Theorem:
(defthm vl-warninglist-p-of-vl-assign-lvaluecheck (b* ((new-warnings (vl-assign-lvaluecheck x warnings))) (vl-warninglist-p new-warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-assign-lvaluecheck-of-vl-assign-fix-x (equal (vl-assign-lvaluecheck (vl-assign-fix x) warnings) (vl-assign-lvaluecheck x warnings)))
Theorem:
(defthm vl-assign-lvaluecheck-vl-assign-equiv-congruence-on-x (implies (vl-assign-equiv x x-equiv) (equal (vl-assign-lvaluecheck x warnings) (vl-assign-lvaluecheck x-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-assign-lvaluecheck-of-vl-warninglist-fix-warnings (equal (vl-assign-lvaluecheck x (vl-warninglist-fix warnings)) (vl-assign-lvaluecheck x warnings)))
Theorem:
(defthm vl-assign-lvaluecheck-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-assign-lvaluecheck x warnings) (vl-assign-lvaluecheck x warnings-equiv))) :rule-classes :congruence)