Write a component to a Java
(int-array-write array index component) → new-array
Function:
(defun int-array-write (array index component) (declare (xargs :guard (and (int-arrayp array) (int-valuep index) (int-valuep component)))) (declare (xargs :guard (int-array-index-in-range-p array index))) (let ((__function__ 'int-array-write)) (declare (ignorable __function__)) (if (mbt (int-array-index-in-range-p array index)) (int-array (update-nth (int-value->int index) component (int-array->components array))) (int-array-fix array))))
Theorem:
(defthm int-arrayp-of-int-array-write (b* ((new-array (int-array-write array index component))) (int-arrayp new-array)) :rule-classes :rewrite)
Theorem:
(defthm len-of-components-of-int-array-write (b* ((?new-array (int-array-write array index component))) (equal (len (int-array->components new-array)) (len (int-array->components array)))))
Theorem:
(defthm int-array-index-in-range-p-of-int-array-write (b* ((?new-array (int-array-write array index component))) (equal (int-array-index-in-range-p new-array index1) (int-array-index-in-range-p array index1))))