(vl-array-assignpat-keyval-resolve lsb msb x) → (mv err svex-membs)
Function:
(defun vl-array-assignpat-keyval-resolve (lsb msb x) (declare (xargs :guard (and (integerp lsb) (integerp msb) (vl-svex-keyvallist-p x)))) (let ((__function__ 'vl-array-assignpat-keyval-resolve)) (declare (ignorable __function__)) (b* ((first (or (vl-svex-keyval-index-lookup msb x) (vl-svex-keyval-default-lookup x))) (err1 (and (not first) (vmsg "No assignment pattern entry for array index ~x0" (lifix msb)))) ((when (eql (lifix lsb) (lifix msb))) (mv err1 (list (or first (svex-x))))) (next (if (< (lifix lsb) (lifix msb)) (- (lifix msb) 1) (+ (lifix msb) 1))) ((mv err rest) (vl-array-assignpat-keyval-resolve lsb next x))) (mv (or err1 err) (cons (or first (svex-x)) rest)))))
Theorem:
(defthm return-type-of-vl-array-assignpat-keyval-resolve.err (b* (((mv ?err ?svex-membs) (vl-array-assignpat-keyval-resolve lsb msb x))) (iff (vl-msg-p err) err)) :rule-classes :rewrite)
Theorem:
(defthm svexlist-p-of-vl-array-assignpat-keyval-resolve.svex-membs (b* (((mv ?err ?svex-membs) (vl-array-assignpat-keyval-resolve lsb msb x))) (sv::svexlist-p svex-membs)) :rule-classes :rewrite)
Theorem:
(defthm len-of-vl-array-assignpat-keyval-resolve (b* (((mv ?err ?svex-membs) (vl-array-assignpat-keyval-resolve lsb msb x))) (equal (len svex-membs) (+ 1 (abs (- (ifix msb) (ifix lsb)))))))
Theorem:
(defthm len-of-vl-array-assignpat-keyval-resolve-range (implies (vl-range-resolved-p range) (b* (((vl-range range))) (equal (len (mv-nth 1 (vl-array-assignpat-keyval-resolve (vl-resolved->val range.lsb) (vl-resolved->val range.msb) x))) (vl-range-size range)))))
Theorem:
(defthm vars-of-vl-array-assignpat-keyval-resolve (b* (((mv ?err ?svex-membs) (vl-array-assignpat-keyval-resolve lsb msb x))) (implies (and ans (not (member v (vl-svex-keyvallist-vars x)))) (not (member v (sv::svexlist-vars svex-membs))))))
Theorem:
(defthm vl-array-assignpat-keyval-resolve-of-ifix-lsb (equal (vl-array-assignpat-keyval-resolve (ifix lsb) msb x) (vl-array-assignpat-keyval-resolve lsb msb x)))
Theorem:
(defthm vl-array-assignpat-keyval-resolve-int-equiv-congruence-on-lsb (implies (acl2::int-equiv lsb lsb-equiv) (equal (vl-array-assignpat-keyval-resolve lsb msb x) (vl-array-assignpat-keyval-resolve lsb-equiv msb x))) :rule-classes :congruence)
Theorem:
(defthm vl-array-assignpat-keyval-resolve-of-ifix-msb (equal (vl-array-assignpat-keyval-resolve lsb (ifix msb) x) (vl-array-assignpat-keyval-resolve lsb msb x)))
Theorem:
(defthm vl-array-assignpat-keyval-resolve-int-equiv-congruence-on-msb (implies (acl2::int-equiv msb msb-equiv) (equal (vl-array-assignpat-keyval-resolve lsb msb x) (vl-array-assignpat-keyval-resolve lsb msb-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-array-assignpat-keyval-resolve-of-vl-svex-keyvallist-fix-x (equal (vl-array-assignpat-keyval-resolve lsb msb (vl-svex-keyvallist-fix x)) (vl-array-assignpat-keyval-resolve lsb msb x)))
Theorem:
(defthm vl-array-assignpat-keyval-resolve-vl-svex-keyvallist-equiv-congruence-on-x (implies (vl-svex-keyvallist-equiv x x-equiv) (equal (vl-array-assignpat-keyval-resolve lsb msb x) (vl-array-assignpat-keyval-resolve lsb msb x-equiv))) :rule-classes :congruence)