Read a location at an
(elf-read-mem-null-term byte-list offset) → bl
Function:
(defun elf-read-mem-null-term (byte-list offset) (declare (xargs :guard (and (byte-listp byte-list) (natp offset)))) (declare (xargs :guard (<= offset (len byte-list)))) (let ((__function__ 'elf-read-mem-null-term)) (declare (ignorable __function__)) (if (natp offset) (if (< offset (len byte-list)) (let* ((val (car (nthcdr offset byte-list)))) (if (equal 0 val) nil (cons val (elf-read-mem-null-term byte-list (1+ offset))))) nil) nil)))
Theorem:
(defthm byte-listp-of-elf-read-mem-null-term (implies (and (natp offset) (byte-listp byte-list)) (b* ((bl (elf-read-mem-null-term byte-list offset))) (byte-listp bl))) :rule-classes :rewrite)