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