Eliminate implicit truncations in assignments throughout a module.
(vl-module-trunc x) → new-x
Function:
(defun vl-module-trunc (x) (declare (xargs :guard (vl-module-p x))) (let ((__function__ 'vl-module-trunc)) (declare (ignorable __function__)) (b* ((x (vl-module-fix x)) ((vl-module x) x) ((when (vl-module->hands-offp x)) x) ((when (vl-assignlist-can-skip-trunc-p x.assigns)) x) (delta (vl-starting-delta x)) (delta (change-vl-delta delta :vardecls x.vardecls)) ((mv assigns delta) (vl-assignlist-trunc x.assigns delta)) ((vl-delta delta) (vl-free-delta delta))) (change-vl-module x :vardecls delta.vardecls :assigns (revappend-without-guard delta.assigns assigns) :warnings delta.warnings))))
Theorem:
(defthm vl-module-p-of-vl-module-trunc (b* ((new-x (vl-module-trunc x))) (vl-module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-module->name-of-vl-module-trunc (equal (vl-module->name (vl-module-trunc x)) (vl-module->name x)))
Theorem:
(defthm vl-module-trunc-of-vl-module-fix-x (equal (vl-module-trunc (vl-module-fix x)) (vl-module-trunc x)))
Theorem:
(defthm vl-module-trunc-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-module-trunc x) (vl-module-trunc x-equiv))) :rule-classes :congruence)