Install fields from a vl-genblob into a package.
(vl-genblob->package x orig) → new-mod
See vl-package->genblob. This is the companion operation which takes the fields from the genblob and sticks them back into a package.
Certain fields of the package, like its warnings, name, and location information, aren't affected. But the real fields like modinsts, assigns, etc., are overwritten with whatever is in the genblob.
Function:
(defun vl-genblob->package (x orig) (declare (xargs :guard (and (vl-genblob-p x) (vl-package-p orig)))) (let ((__function__ 'vl-genblob->package)) (declare (ignorable __function__)) (b* (((vl-genblob x))) (change-vl-package orig :fundecls x.fundecls :taskdecls x.taskdecls :typedefs x.typedefs :paramdecls x.paramdecls :vardecls x.vardecls :imports x.imports))))
Theorem:
(defthm vl-package-p-of-vl-genblob->package (b* ((new-mod (vl-genblob->package x orig))) (vl-package-p new-mod)) :rule-classes :rewrite)
Theorem:
(defthm vl-genblob->package-of-vl-genblob-fix-x (equal (vl-genblob->package (vl-genblob-fix x) orig) (vl-genblob->package x orig)))
Theorem:
(defthm vl-genblob->package-vl-genblob-equiv-congruence-on-x (implies (vl-genblob-equiv x x-equiv) (equal (vl-genblob->package x orig) (vl-genblob->package x-equiv orig))) :rule-classes :congruence)
Theorem:
(defthm vl-genblob->package-of-vl-package-fix-orig (equal (vl-genblob->package x (vl-package-fix orig)) (vl-genblob->package x orig)))
Theorem:
(defthm vl-genblob->package-vl-package-equiv-congruence-on-orig (implies (vl-package-equiv orig orig-equiv) (equal (vl-genblob->package x orig) (vl-genblob->package x orig-equiv))) :rule-classes :congruence)