Open an file for reading.
Signature: (open-input-channel file-name typ state-state) returns
This is a logic-mode function, but its logical definition is tricky;
see logical-story-of-io. The main logical consequence is that (on
success)
Under the hood, we use Lisp's file operations to try to open the file. On
success,
On failure,
Theorem:
(defthm state-p1-of-open-input-channel (implies (and (state-p1 state) (stringp fname) (member type *file-types*)) (state-p1 (mv-nth 1 (open-input-channel fname type state)))))
Theorem:
(defthm symbolp-of-open-input-channel (symbolp (mv-nth 0 (open-input-channel fname type state))) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm open-input-channel-p1-of-open-input-channel (implies (and (state-p1 state) (stringp fname) (member type *file-types*) (equal channel (mv-nth 0 (open-input-channel fname type state))) channel) (open-input-channel-p1 channel type (mv-nth 1 (open-input-channel fname type state)))))