(vl-write-zip filename contents &key (state 'state)) → state
Function:
(defun vl-write-zip-fn (filename contents state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (stringp filename) (vl-zipfile-p contents)))) (let ((__function__ 'vl-write-zip)) (declare (ignorable __function__)) (b* (((mv acl2::channel state) (open-output-channel! filename :object state)) ((unless acl2::channel) (raise "Failed to open file for writing: ~s0~%" filename) state) ((vl-zipfile contents)) (state (acl2::print-legibly (list :about "This is a .vlzip file created by the VL Verilog Toolkit."))) (state (acl2::print-legibly (list :name contents.name))) (state (acl2::print-legibly (list :syntax contents.syntax))) (state (acl2::print-legibly (list :date contents.date))) (state (acl2::print-legibly (list :ltime contents.ltime))) (state (acl2::print-compressed (list :design contents.design))) (state (acl2::print-compressed (list :filemap contents.filemap))) (state (acl2::print-compressed (list :defines contents.defines))) (state (close-output-channel acl2::channel state))) state)))
Theorem:
(defthm state-p1-of-vl-write-zip (implies (and (state-p1 state) (stringp filename)) (state-p1 (vl-write-zip filename contents))))