Optimize expressions throughout a vl-arguments-p.
(vl-arguments-optimize x ss) → (mv changedp new-x)
Function:
(defun vl-arguments-optimize (x ss) (declare (xargs :guard (and (vl-arguments-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-arguments-optimize)) (declare (ignorable __function__)) (b* ((x (vl-arguments-fix x))) (vl-arguments-case x :vl-arguments-named (b* (((mv changedp args-prime) (vl-namedarglist-optimize x.args ss))) (if (not changedp) (mv nil x) (mv t (change-vl-arguments-named x :args args-prime)))) :vl-arguments-plain (b* (((mv changedp args-prime) (vl-plainarglist-optimize x.args ss))) (if (not changedp) (mv nil x) (mv t (change-vl-arguments-plain x :args args-prime))))))))
Theorem:
(defthm booleanp-of-vl-arguments-optimize.changedp (b* (((mv ?changedp ?new-x) (vl-arguments-optimize x ss))) (booleanp changedp)) :rule-classes :type-prescription)
Theorem:
(defthm vl-arguments-p-of-vl-arguments-optimize.new-x (b* (((mv ?changedp ?new-x) (vl-arguments-optimize x ss))) (vl-arguments-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-arguments-optimize-of-vl-arguments-fix-x (equal (vl-arguments-optimize (vl-arguments-fix x) ss) (vl-arguments-optimize x ss)))
Theorem:
(defthm vl-arguments-optimize-vl-arguments-equiv-congruence-on-x (implies (vl-arguments-equiv x x-equiv) (equal (vl-arguments-optimize x ss) (vl-arguments-optimize x-equiv ss))) :rule-classes :congruence)
Theorem:
(defthm vl-arguments-optimize-of-vl-scopestack-fix-ss (equal (vl-arguments-optimize x (vl-scopestack-fix ss)) (vl-arguments-optimize x ss)))
Theorem:
(defthm vl-arguments-optimize-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-arguments-optimize x ss) (vl-arguments-optimize x ss-equiv))) :rule-classes :congruence)