(read-file-as-string filename state) → (mv contents/nil state)
This is just a wrapper around read-file-characters. We leave it enabled.
Function:
(defun read-file-as-string (filename state) (declare (xargs :stobjs (state))) (declare (xargs :guard (stringp filename))) (let ((__function__ 'read-file-as-string)) (declare (ignorable __function__)) (mbe :logic (b* (((mv chars state) (read-file-characters filename state))) (mv (and (not (stringp chars)) (implode chars)) state)) :exec (b* (((mv rchars state) (read-file-characters-rev filename state))) (mv (and (not (stringp rchars)) (str::rchars-to-string rchars)) state)))))
Theorem:
(defthm return-type-of-read-file-as-string.contents/nil (b* (((mv ?contents/nil ?state) (read-file-as-string filename state))) (or (stringp contents/nil) (not contents/nil))) :rule-classes :type-prescription)