Optimize expressions throughout a vl-gateinstlist-p.
(vl-gateinstlist-optimize x ss) → (mv changedp new-x)
Function:
(defun vl-gateinstlist-optimize (x ss) (declare (xargs :guard (and (vl-gateinstlist-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-gateinstlist-optimize)) (declare (ignorable __function__)) (b* (((when (atom x)) (mv nil nil)) ((mv car-changedp car-prime) (vl-gateinst-optimize (car x) ss)) ((mv cdr-changedp cdr-prime) (vl-gateinstlist-optimize (cdr x) ss))) (mv (or car-changedp cdr-changedp) (cons car-prime cdr-prime)))))
Theorem:
(defthm booleanp-of-vl-gateinstlist-optimize.changedp (b* (((mv ?changedp ?new-x) (vl-gateinstlist-optimize x ss))) (booleanp changedp)) :rule-classes :type-prescription)
Theorem:
(defthm vl-gateinstlist-p-of-vl-gateinstlist-optimize.new-x (b* (((mv ?changedp ?new-x) (vl-gateinstlist-optimize x ss))) (vl-gateinstlist-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-gateinstlist-optimize-mvtypes-1 (true-listp (mv-nth 1 (vl-gateinstlist-optimize x ss))) :rule-classes :type-prescription)
Theorem:
(defthm vl-gateinstlist-optimize-of-vl-gateinstlist-fix-x (equal (vl-gateinstlist-optimize (vl-gateinstlist-fix x) ss) (vl-gateinstlist-optimize x ss)))
Theorem:
(defthm vl-gateinstlist-optimize-vl-gateinstlist-equiv-congruence-on-x (implies (vl-gateinstlist-equiv x x-equiv) (equal (vl-gateinstlist-optimize x ss) (vl-gateinstlist-optimize x-equiv ss))) :rule-classes :congruence)
Theorem:
(defthm vl-gateinstlist-optimize-of-vl-scopestack-fix-ss (equal (vl-gateinstlist-optimize x (vl-scopestack-fix ss)) (vl-gateinstlist-optimize x ss)))
Theorem:
(defthm vl-gateinstlist-optimize-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-gateinstlist-optimize x ss) (vl-gateinstlist-optimize x ss-equiv))) :rule-classes :congruence)