Main function for rewriting expressions.
(vl-expr-increwrite x loc) → (mv new-x pre post)
Function:
(defun vl-expr-increwrite (x loc) (declare (xargs :guard (and (vl-expr-p x) (vl-location-p loc)))) (let ((__function__ 'vl-expr-increwrite)) (declare (ignorable __function__)) (b* ((x (vl-expr-fix x)) ((unless (vl-expr-has-incexprs-p x)) (mv x nil nil)) ((mv new-x pre-rev post-rev) (vl-expr-increwrite-aux x nil nil loc))) (mv new-x (rev pre-rev) (rev post-rev)))))
Theorem:
(defthm vl-expr-p-of-vl-expr-increwrite.new-x (b* (((mv ?new-x ?pre ?post) (vl-expr-increwrite x loc))) (vl-expr-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-stmtlist-p-of-vl-expr-increwrite.pre (b* (((mv ?new-x ?pre ?post) (vl-expr-increwrite x loc))) (vl-stmtlist-p pre)) :rule-classes :rewrite)
Theorem:
(defthm vl-stmtlist-p-of-vl-expr-increwrite.post (b* (((mv ?new-x ?pre ?post) (vl-expr-increwrite x loc))) (vl-stmtlist-p post)) :rule-classes :rewrite)
Theorem:
(defthm vl-expr-increwrite-of-vl-expr-fix-x (equal (vl-expr-increwrite (vl-expr-fix x) loc) (vl-expr-increwrite x loc)))
Theorem:
(defthm vl-expr-increwrite-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-expr-increwrite x loc) (vl-expr-increwrite x-equiv loc))) :rule-classes :congruence)
Theorem:
(defthm vl-expr-increwrite-of-vl-location-fix-loc (equal (vl-expr-increwrite x (vl-location-fix loc)) (vl-expr-increwrite x loc)))
Theorem:
(defthm vl-expr-increwrite-vl-location-equiv-congruence-on-loc (implies (vl-location-equiv loc loc-equiv) (equal (vl-expr-increwrite x loc) (vl-expr-increwrite x loc-equiv))) :rule-classes :congruence)