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