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