Event to pretty-print the generated C code to the file system.
(atc-gen-fileset-event fileset file-name pretty-printing print) → event
This serves to run pprint-fileset after the constant and theorem events have been submitted. This function generates an event form that is put (by atc-gen-everything) after the constant and theorem events. When the events are submitted to and processed by ACL2, we get to this file generation event only if the previous events are successful. This is a sort of safety/security constraint: do not even generate files, unless they are correct.
If
In order to generate an embedded event form for output file generation,
we generate a make-event whose argument generates the file.
The argument must also return an embedded event form,
so we use value-triple with
Function:
(defun atc-gen-fileset-event (fileset file-name pretty-printing print) (declare (xargs :guard (and (filesetp fileset) (stringp file-name) (pprint-options-p pretty-printing) (evmac-input-print-p print)))) (let ((__function__ 'atc-gen-fileset-event)) (declare (ignorable __function__)) (b* ((progress-start? (and (evmac-input-print->= print :info) '((cw-event "~%Generating the file(s)...")))) (progress-end? (and (evmac-input-print->= print :info) '((cw-event " done.~%")))) (file-gen-event (cons 'make-event (cons (cons 'b* (cons (cons (cons '(er &) (cons (cons 'pprint-fileset (cons (cons 'quote (cons fileset 'nil)) (cons file-name (cons (cons 'quote (cons pretty-printing 'nil)) '(state))))) 'nil)) 'nil) '((acl2::value '(value-triple :invisible))))) 'nil)))) (cons 'progn (append progress-start? (cons file-gen-event progress-end?))))))
Theorem:
(defthm pseudo-event-formp-of-atc-gen-fileset-event (b* ((event (atc-gen-fileset-event fileset file-name pretty-printing print))) (pseudo-event-formp event)) :rule-classes :rewrite)