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