Usual way to compute the width of a net/reg, given its range.
(vl-maybe-range-size x) → size
(defun vl-maybe-range-size (x) (declare (xargs :guard (vl-maybe-range-p x))) (declare (xargs :guard (vl-maybe-range-resolved-p x))) (let ((__function__ 'vl-maybe-range-size)) (declare (ignorable __function__)) (if (not x) 1 (vl-range-size x))))
(defthm posp-of-vl-maybe-range-size (b* ((size (vl-maybe-range-size x))) (posp size)) :rule-classes :type-prescription)
(defthm vl-maybe-range-size-of-vl-maybe-range-fix-x (equal (vl-maybe-range-size (vl-maybe-range-fix x)) (vl-maybe-range-size x)))
(defthm vl-maybe-range-size-vl-maybe-range-equiv-congruence-on-x (implies (vl-maybe-range-equiv x x-equiv) (equal (vl-maybe-range-size x) (vl-maybe-range-size x-equiv))) :rule-classes :congruence)