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