Extract and attach in-bounds warnings to a description.
(vl-description-inject-warnings x warnings) → (mv new-x warnings)
Function:
(defun vl-description-inject-warnings (x warnings) (declare (xargs :guard (and (vl-description-p x) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-description-inject-warnings)) (declare (ignorable __function__)) (b* ((x (vl-description-fix x)) (warnings (vl-warninglist-fix warnings)) ((when (atom warnings)) (mv x warnings)) ((unless (vl-description-has-comments-p x)) (mv x warnings)) (min (vl-description->minloc x)) (max (vl-description->maxloc x)) ((mv between beyond) (vl-filter-warnings-by-loc min max warnings nil nil)) ((unless (consp between)) (mv x warnings)) (new-x (vl-description-add-warnings x between))) (mv new-x beyond))))
Theorem:
(defthm vl-description-p-of-vl-description-inject-warnings.new-x (b* (((mv ?new-x ?warnings) (vl-description-inject-warnings x warnings))) (vl-description-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-warninglist-p-of-vl-description-inject-warnings.warnings (b* (((mv ?new-x ?warnings) (vl-description-inject-warnings x warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-description->name-of-vl-description-inject-warnings (b* (((mv ?new-x ?warnings) (vl-description-inject-warnings x warnings))) (equal (vl-description->name new-x) (vl-description->name x))) :rule-classes :rewrite)
Theorem:
(defthm vl-description-inject-warnings-of-vl-description-fix-x (equal (vl-description-inject-warnings (vl-description-fix x) warnings) (vl-description-inject-warnings x warnings)))
Theorem:
(defthm vl-description-inject-warnings-vl-description-equiv-congruence-on-x (implies (vl-description-equiv x x-equiv) (equal (vl-description-inject-warnings x warnings) (vl-description-inject-warnings x-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-description-inject-warnings-of-vl-warninglist-fix-warnings (equal (vl-description-inject-warnings x (vl-warninglist-fix warnings)) (vl-description-inject-warnings x warnings)))
Theorem:
(defthm vl-description-inject-warnings-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-description-inject-warnings x warnings) (vl-description-inject-warnings x warnings-equiv))) :rule-classes :congruence)