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