Read an element from an array of type
(schar-array-read array index) → element
Function:
(defun schar-array-read (array index) (declare (xargs :guard (and (schar-arrayp array) (cintegerp index)))) (declare (xargs :guard (schar-array-index-okp array index))) (let ((__function__ 'schar-array-read)) (declare (ignorable __function__)) (schar-fix (nth (integer-from-cinteger index) (schar-array->elements array)))))
Theorem:
(defthm scharp-of-schar-array-read (b* ((element (schar-array-read array index))) (scharp element)) :rule-classes :rewrite)
Theorem:
(defthm schar-array-read-alt-def (implies (and (schar-arrayp array) (cintegerp index) (schar-array-index-okp array index)) (equal (schar-array-read array index) (value-array-read (integer-from-cinteger index) array))))
Theorem:
(defthm schar-array-read-of-schar-array-fix-array (equal (schar-array-read (schar-array-fix array) index) (schar-array-read array index)))
Theorem:
(defthm schar-array-read-schar-array-equiv-congruence-on-array (implies (schar-array-equiv array array-equiv) (equal (schar-array-read array index) (schar-array-read array-equiv index))) :rule-classes :congruence)
Theorem:
(defthm schar-array-read-of-cinteger-fix-index (equal (schar-array-read array (cinteger-fix index)) (schar-array-read array index)))
Theorem:
(defthm schar-array-read-cinteger-equiv-congruence-on-index (implies (cinteger-equiv index index-equiv) (equal (schar-array-read array index) (schar-array-read array index-equiv))) :rule-classes :congruence)