Read an entire list of files into a list of extended characters.
(vl-read-files filenames &key (state 'state)) → (mv errmsg? data state)
Function:
(defun vl-read-files-fn (filenames state) (declare (xargs :stobjs (state))) (declare (xargs :guard (string-listp filenames))) (let ((__function__ 'vl-read-files)) (declare (ignorable __function__)) (mbe :logic (b* (((when (atom filenames)) (mv nil nil state)) ((mv okp first state) (vl-read-file (car filenames))) ((unless okp) (mv (msg "Error reading file ~s0." (car filenames)) nil state)) ((mv okp rest state) (vl-read-files (cdr filenames)))) (mv okp (append first rest) state)) :exec (with-local-stobj nrev (mv-let (errmsg echars nrev state) (b* (((mv errmsg nrev state) (vl-read-files-aux filenames nrev)) ((mv echars nrev) (nrev-finish nrev))) (mv errmsg echars nrev state)) (mv errmsg echars state))))))
Theorem:
(defthm vl-echarlist-p-of-vl-read-files.data (implies (and (force (state-p state)) (force (string-listp filenames))) (b* (((mv ?errmsg? ?data acl2::?state) (vl-read-files-fn filenames state))) (vl-echarlist-p data))) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-vl-read-files.state (implies (force (state-p1 state)) (b* (((mv ?errmsg? ?data acl2::?state) (vl-read-files-fn filenames state))) (state-p1 state))) :rule-classes :rewrite)
Theorem:
(defthm true-listp-of-vl-read-files (true-listp (mv-nth 1 (vl-read-files filenames))) :rule-classes :type-prescription)
Theorem:
(defthm vl-read-files-aux-redef (equal (vl-read-files-aux filenames acc) (b* (((mv errmsg data state) (vl-read-files filenames))) (mv errmsg (append acc data) state))))