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