Write an element to an array of type
(uchar-array-integer-write array index element) → new-array
Function:
(defun uchar-array-integer-write (array index element) (declare (xargs :guard (and (uchar-arrayp array) (integerp index) (ucharp element)))) (declare (xargs :guard (uchar-array-integer-index-okp array index))) (let ((__function__ 'uchar-array-integer-write)) (declare (ignorable __function__)) (b* ((array (uchar-array-fix array)) (index (ifix index)) (element (uchar-fix element))) (if (mbt (uchar-array-integer-index-okp array index)) (uchar-array-of (update-nth index element (uchar-array->elements array))) array))))
Theorem:
(defthm uchar-arrayp-of-uchar-array-integer-write (b* ((new-array (uchar-array-integer-write array index element))) (uchar-arrayp new-array)) :rule-classes :rewrite)
Theorem:
(defthm len-of-uchar-array->elements-of-uchar-array-integer-write (equal (len (uchar-array->elements (uchar-array-integer-write array index element))) (len (uchar-array->elements array))))
Theorem:
(defthm uchar-array-length-of-uchar-array-integer-write (equal (uchar-array-length (uchar-array-integer-write array index element)) (uchar-array-length array)))
Theorem:
(defthm uchar-array-integer-write-alt-def (implies (and (uchar-arrayp array) (integerp index) (ucharp elem) (uchar-array-integer-index-okp array index)) (equal (uchar-array-integer-write array index elem) (value-array-write index elem array))))
Theorem:
(defthm uchar-array-integer-write-of-uchar-array-fix-array (equal (uchar-array-integer-write (uchar-array-fix array) index element) (uchar-array-integer-write array index element)))
Theorem:
(defthm uchar-array-integer-write-uchar-array-equiv-congruence-on-array (implies (uchar-array-equiv array array-equiv) (equal (uchar-array-integer-write array index element) (uchar-array-integer-write array-equiv index element))) :rule-classes :congruence)
Theorem:
(defthm uchar-array-integer-write-of-ifix-index (equal (uchar-array-integer-write array (ifix index) element) (uchar-array-integer-write array index element)))
Theorem:
(defthm uchar-array-integer-write-int-equiv-congruence-on-index (implies (acl2::int-equiv index index-equiv) (equal (uchar-array-integer-write array index element) (uchar-array-integer-write array index-equiv element))) :rule-classes :congruence)
Theorem:
(defthm uchar-array-integer-write-of-uchar-fix-element (equal (uchar-array-integer-write array index (uchar-fix element)) (uchar-array-integer-write array index element)))
Theorem:
(defthm uchar-array-integer-write-uchar-equiv-congruence-on-element (implies (uchar-equiv element element-equiv) (equal (uchar-array-integer-write array index element) (uchar-array-integer-write array index element-equiv))) :rule-classes :congruence)