(read-file-into-memory filename ptr x86 state) → (mv bytes-read x86 state)
Function:
(defun read-file-into-memory (filename ptr x86 state) (declare (xargs :stobjs (x86 state))) (declare (xargs :guard (and (stringp filename) (canonical-address-p ptr)))) (let ((__function__ 'read-file-into-memory)) (declare (ignorable __function__)) (b* (((mv channel state) (open-input-channel filename :byte state)) ((when (not channel)) (mv 0 x86 state)) ((mv bytes-read x86 state) (read-channel-into-memory channel ptr 0 x86 state)) (state (close-input-channel channel state))) (mv bytes-read x86 state))))
Theorem:
(defthm natp-of-read-file-into-memory.bytes-read (implies (and (stringp filename) (canonical-address-p ptr) (state-p1 state)) (b* (((mv ?bytes-read ?x86 acl2::?state) (read-file-into-memory filename ptr x86 state))) (natp bytes-read))) :rule-classes :rewrite)
Theorem:
(defthm x86p-of-read-file-into-memory.x86 (implies (x86p x86) (b* (((mv ?bytes-read ?x86 acl2::?state) (read-file-into-memory filename ptr x86 state))) (x86p x86))) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-read-file-into-memory.state (implies (and (stringp filename) (state-p1 state)) (b* (((mv ?bytes-read ?x86 acl2::?state) (read-file-into-memory filename ptr x86 state))) (state-p1 state))) :rule-classes :rewrite)