Function:
(defun vl-file-exists-p (filename state) (declare (xargs :stobjs (state))) (declare (xargs :guard (stringp filename))) (let ((__function__ 'vl-file-exists-p)) (declare (ignorable __function__)) (b* ((filename (string-fix filename)) ((mv channel state) (open-input-channel filename :character state)) ((unless channel) (mv nil state)) (state (close-input-channel channel state))) (mv t state))))
Theorem:
(defthm booleanp-of-vl-file-exists-p.exists-p (b* (((mv ?exists-p acl2::?state) (vl-file-exists-p filename state))) (booleanp exists-p)) :rule-classes :type-prescription)
Theorem:
(defthm state-p1-of-vl-file-exists-p.state (implies (force (state-p1 state)) (b* (((mv ?exists-p acl2::?state) (vl-file-exists-p filename state))) (state-p1 state))) :rule-classes :rewrite)
Theorem:
(defthm vl-file-exists-p-of-str-fix-filename (equal (vl-file-exists-p (str-fix filename) state) (vl-file-exists-p filename state)))
Theorem:
(defthm vl-file-exists-p-streqv-congruence-on-filename (implies (streqv filename filename-equiv) (equal (vl-file-exists-p filename state) (vl-file-exists-p filename-equiv state))) :rule-classes :congruence)