Create the range
(vl-make-n-bit-range n) → maybe-range
Function:
(defun vl-make-n-bit-range (n) (declare (xargs :guard (posp n))) (let ((__function__ 'vl-make-n-bit-range)) (declare (ignorable __function__)) (let ((n (mbe :logic (pos-fix n) :exec n))) (make-vl-range :msb (vl-make-index (- n 1)) :lsb (vl-make-index 0)))))
Theorem:
(defthm vl-maybe-range-p-of-vl-make-n-bit-range (b* ((maybe-range (vl-make-n-bit-range n))) (vl-maybe-range-p maybe-range)) :rule-classes :rewrite)
Theorem:
(defthm vl-make-n-bit-range-of-pos-fix-n (equal (vl-make-n-bit-range (pos-fix n)) (vl-make-n-bit-range n)))
Theorem:
(defthm vl-make-n-bit-range-pos-equiv-congruence-on-n (implies (acl2::pos-equiv n n-equiv) (equal (vl-make-n-bit-range n) (vl-make-n-bit-range n-equiv))) :rule-classes :congruence)