Print a translation unit.
(print-transunit tunit pstate) → new-pstate
We ensure that there is at least one external declaration, as required by the grammar.
Function:
(defun print-transunit (tunit pstate) (declare (xargs :guard (and (transunitp tunit) (pristatep pstate)))) (declare (xargs :guard (transunit-unambp tunit))) (let ((__function__ 'print-transunit)) (declare (ignorable __function__)) (b* (((transunit tunit) tunit) ((unless tunit.decls) (raise "Misusage error: empty translation unit.") (pristate-fix pstate))) (print-extdecl-list tunit.decls pstate))))
Theorem:
(defthm pristatep-of-print-transunit (b* ((new-pstate (print-transunit tunit pstate))) (pristatep new-pstate)) :rule-classes :rewrite)
Theorem:
(defthm print-transunit-of-transunit-fix-tunit (equal (print-transunit (transunit-fix tunit) pstate) (print-transunit tunit pstate)))
Theorem:
(defthm print-transunit-transunit-equiv-congruence-on-tunit (implies (transunit-equiv tunit tunit-equiv) (equal (print-transunit tunit pstate) (print-transunit tunit-equiv pstate))) :rule-classes :congruence)
Theorem:
(defthm print-transunit-of-pristate-fix-pstate (equal (print-transunit tunit (pristate-fix pstate)) (print-transunit tunit pstate)))
Theorem:
(defthm print-transunit-pristate-equiv-congruence-on-pstate (implies (pristate-equiv pstate pstate-equiv) (equal (print-transunit tunit pstate) (print-transunit tunit pstate-equiv))) :rule-classes :congruence)