(vl-follow-array-indices x type) → (mv err trace)
Function:
(defun vl-follow-array-indices (x type) (declare (xargs :guard (and (vl-exprlist-p x) (vl-datatype-p type)))) (declare (xargs :guard (vl-datatype-resolved-p type))) (let ((__function__ 'vl-follow-array-indices)) (declare (ignorable __function__)) (b* (((when (atom x)) (mv nil nil)) ((mv err caveat newtype &) (vl-datatype-remove-dim type)) ((when err) (mv err nil)) ((mv err rest) (vl-follow-array-indices (cdr x) newtype)) ((when err) (mv err nil))) (mv nil (cons (make-vl-selstep :select (make-vl-select-index :val (car x)) :type newtype :caveat caveat) rest)))))
Theorem:
(defthm return-type-of-vl-follow-array-indices.err (b* (((mv ?err common-lisp::?trace) (vl-follow-array-indices x type))) (iff (vl-msg-p err) err)) :rule-classes :rewrite)
Theorem:
(defthm vl-seltrace-p-of-vl-follow-array-indices.trace (b* (((mv ?err common-lisp::?trace) (vl-follow-array-indices x type))) (vl-seltrace-p trace)) :rule-classes :rewrite)
Theorem:
(defthm vl-seltrace-usertypes-ok-of-follow-array-indices (b* (((mv ?err common-lisp::?trace) (vl-follow-array-indices x type))) (implies (vl-datatype-resolved-p type) (vl-seltrace-usertypes-ok trace))))
Theorem:
(defthm true-listp-of-vl-follow-array-indices-trace (b* (((mv ?err common-lisp::?trace) (vl-follow-array-indices x type))) (true-listp trace)) :rule-classes :type-prescription)
Theorem:
(defthm vl-seltrace->indices-of-vl-follow-array-indices (b* (((mv ?err common-lisp::?trace) (vl-follow-array-indices x type))) (implies (not err) (equal (vl-seltrace->indices trace) (vl-exprlist-fix x)))))
Theorem:
(defthm consp-of-vl-follow-array-indices (b* (((mv ?err common-lisp::?trace) (vl-follow-array-indices x type))) (implies (not err) (equal (consp trace) (consp x)))))
Theorem:
(defthm len-of-vl-follow-array-indices (b* (((mv ?err common-lisp::?trace) (vl-follow-array-indices x type))) (implies (not err) (equal (len trace) (len x)))))
Theorem:
(defthm vl-follow-array-indices-of-vl-exprlist-fix-x (equal (vl-follow-array-indices (vl-exprlist-fix x) type) (vl-follow-array-indices x type)))
Theorem:
(defthm vl-follow-array-indices-vl-exprlist-equiv-congruence-on-x (implies (vl-exprlist-equiv x x-equiv) (equal (vl-follow-array-indices x type) (vl-follow-array-indices x-equiv type))) :rule-classes :congruence)
Theorem:
(defthm vl-follow-array-indices-of-vl-datatype-fix-type (equal (vl-follow-array-indices x (vl-datatype-fix type)) (vl-follow-array-indices x type)))
Theorem:
(defthm vl-follow-array-indices-vl-datatype-equiv-congruence-on-type (implies (vl-datatype-equiv type type-equiv) (equal (vl-follow-array-indices x type) (vl-follow-array-indices x type-equiv))) :rule-classes :congruence)