Check the assignments of a module for self-assignments to bits.
(vl-module-check-selfassigns x ss) → new-x
(vl-module-check-selfassigns x ss) checks all of the assignments
in the module
Function:
(defun vl-module-check-selfassigns (x ss) (declare (xargs :guard (and (vl-module-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-module-check-selfassigns)) (declare (ignorable __function__)) (b* (((vl-module x) (vl-module-fix x)) ((unless x.assigns) x) (ss (vl-scopestack-push x ss)) (warnings (vl-assignlist-check-selfassigns x.assigns ss)) ((unless warnings) x)) (change-vl-module x :warnings (append warnings x.warnings)))))
Theorem:
(defthm vl-module-p-of-vl-module-check-selfassigns (b* ((new-x (vl-module-check-selfassigns x ss))) (vl-module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-module-check-selfassigns-of-vl-module-fix-x (equal (vl-module-check-selfassigns (vl-module-fix x) ss) (vl-module-check-selfassigns x ss)))
Theorem:
(defthm vl-module-check-selfassigns-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-module-check-selfassigns x ss) (vl-module-check-selfassigns x-equiv ss))) :rule-classes :congruence)
Theorem:
(defthm vl-module-check-selfassigns-of-vl-scopestack-fix-ss (equal (vl-module-check-selfassigns x (vl-scopestack-fix ss)) (vl-module-check-selfassigns x ss)))
Theorem:
(defthm vl-module-check-selfassigns-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-module-check-selfassigns x ss) (vl-module-check-selfassigns x ss-equiv))) :rule-classes :congruence)