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