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