Rewrite operators throughout a vl-plainarg-p
(vl-plainarg-oprewrite x warnings) → (mv warnings new-x)
Function:
(defun vl-plainarg-oprewrite (x warnings) (declare (xargs :guard (and (vl-plainarg-p x) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-plainarg-oprewrite)) (declare (ignorable __function__)) (b* ((x (vl-plainarg-fix x))) (b* (((vl-plainarg x) x) ((unless x.expr) (mv (ok) x)) ((mv warnings expr-prime) (vl-expr-oprewrite x.expr warnings))) (mv warnings (change-vl-plainarg x :expr expr-prime))))))
Theorem:
(defthm vl-warninglist-p-of-vl-plainarg-oprewrite.warnings (b* (((mv ?warnings ?new-x) (vl-plainarg-oprewrite x warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-plainarg-p-of-vl-plainarg-oprewrite.new-x (b* (((mv ?warnings ?new-x) (vl-plainarg-oprewrite x warnings))) (vl-plainarg-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-plainarg-oprewrite-of-vl-plainarg-fix-x (equal (vl-plainarg-oprewrite (vl-plainarg-fix x) warnings) (vl-plainarg-oprewrite x warnings)))
Theorem:
(defthm vl-plainarg-oprewrite-vl-plainarg-equiv-congruence-on-x (implies (vl-plainarg-equiv x x-equiv) (equal (vl-plainarg-oprewrite x warnings) (vl-plainarg-oprewrite x-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-plainarg-oprewrite-of-vl-warninglist-fix-warnings (equal (vl-plainarg-oprewrite x (vl-warninglist-fix warnings)) (vl-plainarg-oprewrite x warnings)))
Theorem:
(defthm vl-plainarg-oprewrite-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-plainarg-oprewrite x warnings) (vl-plainarg-oprewrite x warnings-equiv))) :rule-classes :congruence)