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