(vl-build-range-select-with expr range) → expr-with-range
Function:
(defun vl-build-range-select-with (expr range) (declare (xargs :guard (and (vl-expr-p expr) (vl-erange-p range)))) (let ((__function__ 'vl-build-range-select-with)) (declare (ignorable __function__)) (b* (((vl-erange range) range)) (case range.type (:vl-index (make-vl-nonatom :op :vl-with-index :args (list expr range.left))) (:vl-colon (make-vl-nonatom :op :vl-with-colon :args (list expr range.left range.right))) (:vl-pluscolon (make-vl-nonatom :op :vl-with-pluscolon :args (list expr range.left range.right))) (:vl-minuscolon (make-vl-nonatom :op :vl-with-minuscolon :args (list expr range.left range.right)))))))
Theorem:
(defthm vl-expr-p-of-vl-build-range-select-with (implies (and (force (vl-expr-p expr)) (force (vl-erange-p range))) (b* ((expr-with-range (vl-build-range-select-with expr range))) (vl-expr-p expr-with-range))) :rule-classes :rewrite)