Write the printed characters to a file.
Function:
(defun vl-print-to-file-fn (filename ps state) (declare (xargs :stobjs (ps state))) (declare (xargs :guard (stringp filename))) (let ((__function__ 'vl-print-to-file)) (declare (ignorable __function__)) (b* ((filename (string-fix filename)) ((mv channel state) (open-output-channel filename :character state)) ((unless channel) (raise "Error opening file ~s0 for writing." filename) state) (state (princ$ (vl-ps->string) channel state))) (close-output-channel channel state))))
Theorem:
(defthm state-p1-of-vl-print-to-file (implies (force (state-p1 state)) (b* ((state (vl-print-to-file-fn filename ps state))) (state-p1 state))) :rule-classes :rewrite)
Theorem:
(defthm vl-print-to-file-fn-of-str-fix-filename (equal (vl-print-to-file-fn (str-fix filename) ps state) (vl-print-to-file-fn filename ps state)))
Theorem:
(defthm vl-print-to-file-fn-streqv-congruence-on-filename (implies (streqv filename filename-equiv) (equal (vl-print-to-file-fn filename ps state) (vl-print-to-file-fn filename-equiv ps state))) :rule-classes :congruence)