• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Vl-loadstate
          • Lexer
          • Parser
          • Vl-load-merge-descriptions
          • Vl-find-basename/extension
          • Vl-load-file
          • Vl-loadresult
          • Scope-of-defines
          • Vl-find-file
            • Vl-slow-find-file-aux
            • Vl-cache-find-file-aux
            • Vl-extend-pathname
            • Vl-file-exists-p
            • Vl-ends-with-directory-separatorp
            • Vl-dirlist-cache
            • Vl-dircache
              • Vl-dircache-p
              • Vl-dircache-fix
              • Vl-make-dircache
                • Vl-make-dircache-aux
              • Vl-dircache-equiv
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-read-file
          • Vl-includeskips-report-gather
          • Vl-load-main
          • Extended-characters
          • Vl-load
          • Vl-load-description
          • Vl-descriptions-left-to-load
          • Inject-warnings
          • Vl-preprocess-debug
          • Vl-write-preprocessor-debug-file
          • Vl-read-file-report-gather
          • Vl-load-descriptions
          • Vl-load-files
          • Translate-off
          • Vl-load-read-file-hook
          • Vl-read-file-report
          • Vl-loadstate-pad
          • Vl-load-summary
          • Vl-collect-modules-from-descriptions
          • Vl-loadstate->warnings
          • Vl-iskips-report
          • Vl-descriptionlist
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Vl-dircache

Vl-make-dircache

Make a vl-dircache for a directory.

Signature
(vl-make-dircache dir warnings state) 
  → 
(mv cache warnings state)
Arguments
dir — Directory to list.
    Guard (stringp dir).
warnings — Warnings to extend in case of file errors.
    Guard (vl-warninglist-p warnings).
Returns
cache — Type (vl-dircache-p cache).
warnings — Type (vl-warninglist-p warnings).
state — Type (state-p1 state), given (force (state-p1 state)).

Definitions and Theorems

Function: vl-make-dircache

(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: vl-dircache-p-of-vl-make-dircache.cache

(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: vl-warninglist-p-of-vl-make-dircache.warnings

(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: state-p1-of-vl-make-dircache.state

(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: vl-make-dircache-of-str-fix-dir

(defthm vl-make-dircache-of-str-fix-dir
  (equal (vl-make-dircache (str-fix dir)
                           warnings state)
         (vl-make-dircache dir warnings state)))

Theorem: vl-make-dircache-streqv-congruence-on-dir

(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: vl-make-dircache-of-vl-warninglist-fix-warnings

(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: vl-make-dircache-vl-warninglist-equiv-congruence-on-warnings

(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)

Subtopics

Vl-make-dircache-aux