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