Map a translation unit to the language definition.
(ldm-transunit tunit) → (mv erp file)
A translation unit consists of a list of external declarations. We map all of them to the language definition (if possible), obtaining a corresponding list of external declaration, which we put into a c::file.
Function:
(defun ldm-transunit (tunit) (declare (xargs :guard (transunitp tunit))) (declare (xargs :guard (transunit-unambp tunit))) (let ((__function__ 'ldm-transunit)) (declare (ignorable __function__)) (b* (((reterr) (c::file nil)) (extdecls (transunit->decls tunit)) ((erp extdecls1) (ldm-extdecl-list extdecls))) (retok (c::make-file :declons extdecls1)))))
Theorem:
(defthm filep-of-ldm-transunit.file (b* (((mv acl2::?erp ?file) (ldm-transunit tunit))) (c::filep file)) :rule-classes :rewrite)
Theorem:
(defthm ldm-transunit-of-transunit-fix-tunit (equal (ldm-transunit (transunit-fix tunit)) (ldm-transunit tunit)))
Theorem:
(defthm ldm-transunit-transunit-equiv-congruence-on-tunit (implies (transunit-equiv tunit tunit-equiv) (equal (ldm-transunit tunit) (ldm-transunit tunit-equiv))) :rule-classes :congruence)