(read-channel-into-byte-list channel acc state) → (mv bytes state)
Function:
(defun read-channel-into-byte-list (channel acc state) (declare (xargs :stobjs (state))) (declare (xargs :guard (symbolp channel))) (declare (xargs :guard (open-input-channel-p channel :byte state))) (let ((__function__ 'read-channel-into-byte-list)) (declare (ignorable __function__)) (b* (((mv current-byte state) (read-byte$ channel state))) (if (not current-byte) (mv acc state) (read-channel-into-byte-list channel (cons current-byte acc) state)))))
Theorem:
(defthm byte-listp-of-read-channel-into-byte-list.bytes (implies (and (state-p1 state) (symbolp channel) (open-input-channel-p channel :byte state) (byte-listp acc)) (b* (((mv ?bytes acl2::?state) (read-channel-into-byte-list channel acc state))) (byte-listp bytes))) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-read-channel-into-byte-list.state (implies (and (state-p1 state) (symbolp channel) (open-input-channel-p1 channel :byte state)) (b* (((mv ?bytes acl2::?state) (read-channel-into-byte-list channel acc state))) (state-p1 state))) :rule-classes :rewrite)
Theorem:
(defthm read-channel-into-byte-list-leaves-channel-open (implies (open-input-channel-p1 channel :byte state) (open-input-channel-p1 channel :byte (mv-nth 1 (read-channel-into-byte-list channel acc state)))))