Load and simplify some modules.
(defmodules-fn loadconfig simpconfig &key (state 'state)) → (mv trans state)
Function:
(defun defmodules-fn-fn (loadconfig simpconfig state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (vl-loadconfig-p loadconfig) (vl-simpconfig-p simpconfig)))) (let ((__function__ 'defmodules-fn)) (declare (ignorable __function__)) (b* (((mv loadresult state) (xf-cwtime (vl-load loadconfig))) ((vl-loadresult loadresult) (if (vl-simpconfig->compress-p simpconfig) (xf-cwtime (hons-copy loadresult)) loadresult)) ((mv good bad) (xf-cwtime (vl-simplify loadresult.design simpconfig))) (reportcard (vl-design-origname-reportcard good)) (- (vl-cw-ps-seq (vl-cw "Successfully simplified ~x0 module~s1.~%" (len (vl-design->mods good)) (if (vl-plural-p (vl-design->mods good)) "s" "")) (vl-println "") (vl-println "Warnings for successful modules:") (vl-print-reportcard reportcard) (vl-println ""))) (- (fast-alist-free reportcard)) (reportcard (vl-design-origname-reportcard bad)) (failmods (vl-design->mods bad)) (- (vl-cw-ps-seq (if (atom failmods) ps (vl-ps-seq (vl-cw "Failed to simplify ~x0 module~s1: " (len failmods) (if (vl-plural-p failmods) "s" "")) (vl-print-strings-with-commas (vl-modulelist->names failmods) 4) (vl-println "") (vl-println "Warnings for failed descriptions:") (vl-print-reportcard reportcard) (vl-println ""))))) (- (fast-alist-free reportcard)) (result (make-vl-translation :good good :bad bad :orig loadresult.design :filemap loadresult.filemap :defines loadresult.defines))) (mv result state))))
Theorem:
(defthm vl-translation-p-of-defmodules-fn.trans (implies (and (force (state-p state)) (force (vl-loadconfig-p loadconfig)) (force (vl-simpconfig-p simpconfig))) (b* (((mv acl2::?trans acl2::?state) (defmodules-fn-fn loadconfig simpconfig state))) (vl-translation-p trans))) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-defmodules-fn.state (implies (and (force (state-p state)) (force (vl-loadconfig-p loadconfig)) (force (vl-simpconfig-p simpconfig))) (b* (((mv acl2::?trans acl2::?state) (defmodules-fn-fn loadconfig simpconfig state))) (state-p1 state))) :rule-classes :rewrite)