Make a vl-dircache for a directory.
(vl-make-dircache dir warnings state) → (mv cache warnings state)
Function:
(defun vl-make-dircache (dir warnings state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (stringp dir) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-make-dircache)) (declare (ignorable __function__)) (b* ((dir (string-fix dir)) ((mv err files state) (time$ (oslib::ls-files dir) :msg ";; vl-make-dircache: ls-files: ~st sec, ~sa bytes~%" :mintime 1/2)) ((when err) (mv nil (warn :type :vl-filesystem-error :msg "Error creating directory cache for ~s0. ~@1." :args (list dir err)) state)) (cache (make-fast-alist (vl-make-dircache-aux files)))) (mv cache (ok) state))))
Theorem:
(defthm vl-dircache-p-of-vl-make-dircache.cache (b* (((mv ?cache ?warnings acl2::?state) (vl-make-dircache dir warnings state))) (vl-dircache-p cache)) :rule-classes :rewrite)
Theorem:
(defthm vl-warninglist-p-of-vl-make-dircache.warnings (b* (((mv ?cache ?warnings acl2::?state) (vl-make-dircache dir warnings state))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-vl-make-dircache.state (implies (force (state-p1 state)) (b* (((mv ?cache ?warnings acl2::?state) (vl-make-dircache dir warnings state))) (state-p1 state))) :rule-classes :rewrite)
Theorem:
(defthm vl-make-dircache-of-str-fix-dir (equal (vl-make-dircache (str-fix dir) warnings state) (vl-make-dircache dir warnings state)))
Theorem:
(defthm vl-make-dircache-streqv-congruence-on-dir (implies (streqv dir dir-equiv) (equal (vl-make-dircache dir warnings state) (vl-make-dircache dir-equiv warnings state))) :rule-classes :congruence)
Theorem:
(defthm vl-make-dircache-of-vl-warninglist-fix-warnings (equal (vl-make-dircache dir (vl-warninglist-fix warnings) state) (vl-make-dircache dir warnings state)))
Theorem:
(defthm vl-make-dircache-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-make-dircache dir warnings state) (vl-make-dircache dir warnings-equiv state))) :rule-classes :congruence)