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