• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Community
    • 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-find-basename/extension-aux
            • Vl-find-highest-priority-extension
            • Vl-split-filename
            • Vl-dirxcache
              • Vl-dirxcache-p
              • Vl-dirxcache-fix
              • Vl-make-dirxcache
                • Vl-make-dirxcache-aux
              • Vl-dirxcache-equiv
            • Vl-dirxlist-cache
          • Vl-load-file
          • Vl-loadresult
          • Scope-of-defines
          • Vl-find-file
          • 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-dirxcache

Vl-make-dirxcache

Make a vl-dirxcache for a directory.

Signature
(vl-make-dirxcache dir extensions warnings state) 
  → 
(mv cache warnings state)
Arguments
dir — Directory to list.
    Guard (stringp dir).
extensions — Extensions we care about, e.g., "v" "sv", no dots.
    Guard (string-listp extensions).
warnings — Warnings to extend in case of file errors.
    Guard (vl-warninglist-p warnings).
Returns
cache — Type (vl-dirxcache-p cache).
warnings — Type (vl-warninglist-p warnings).
state — Type (state-p1 state), given (force (state-p1 state)).

Definitions and Theorems

Function: vl-make-dirxcache

(defun vl-make-dirxcache (dir extensions warnings state)
 (declare (xargs :stobjs (state)))
 (declare (xargs :guard (and (stringp dir)
                             (string-listp extensions)
                             (vl-warninglist-p warnings))))
 (let ((__function__ 'vl-make-dirxcache))
  (declare (ignorable __function__))
  (b*
   ((dir (string-fix dir))
    ((mv err files state)
     (time$ (oslib::ls-files dir)
            :msg "vl-make-dirxcache: 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 (vl-make-dirxcache-aux files extensions nil)))
   (mv cache (ok) state))))

Theorem: vl-dirxcache-p-of-vl-make-dirxcache.cache

(defthm vl-dirxcache-p-of-vl-make-dirxcache.cache
  (b* (((mv ?cache ?warnings acl2::?state)
        (vl-make-dirxcache dir extensions warnings state)))
    (vl-dirxcache-p cache))
  :rule-classes :rewrite)

Theorem: vl-warninglist-p-of-vl-make-dirxcache.warnings

(defthm vl-warninglist-p-of-vl-make-dirxcache.warnings
  (b* (((mv ?cache ?warnings acl2::?state)
        (vl-make-dirxcache dir extensions warnings state)))
    (vl-warninglist-p warnings))
  :rule-classes :rewrite)

Theorem: state-p1-of-vl-make-dirxcache.state

(defthm state-p1-of-vl-make-dirxcache.state
  (implies (force (state-p1 state))
           (b* (((mv ?cache ?warnings acl2::?state)
                 (vl-make-dirxcache dir extensions warnings state)))
             (state-p1 state)))
  :rule-classes :rewrite)

Theorem: vl-make-dirxcache-of-str-fix-dir

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

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

(defthm vl-make-dirxcache-streqv-congruence-on-dir
 (implies
    (streqv dir dir-equiv)
    (equal (vl-make-dirxcache dir extensions warnings state)
           (vl-make-dirxcache dir-equiv extensions warnings state)))
 :rule-classes :congruence)

Theorem: vl-make-dirxcache-of-string-list-fix-extensions

(defthm vl-make-dirxcache-of-string-list-fix-extensions
  (equal (vl-make-dirxcache dir (string-list-fix extensions)
                            warnings state)
         (vl-make-dirxcache dir extensions warnings state)))

Theorem: vl-make-dirxcache-string-list-equiv-congruence-on-extensions

(defthm vl-make-dirxcache-string-list-equiv-congruence-on-extensions
 (implies
    (str::string-list-equiv extensions extensions-equiv)
    (equal (vl-make-dirxcache dir extensions warnings state)
           (vl-make-dirxcache dir extensions-equiv warnings state)))
 :rule-classes :congruence)

Theorem: vl-make-dirxcache-of-vl-warninglist-fix-warnings

(defthm vl-make-dirxcache-of-vl-warninglist-fix-warnings
  (equal (vl-make-dirxcache dir
                            extensions (vl-warninglist-fix warnings)
                            state)
         (vl-make-dirxcache dir extensions warnings state)))

Theorem: vl-make-dirxcache-vl-warninglist-equiv-congruence-on-warnings

(defthm
      vl-make-dirxcache-vl-warninglist-equiv-congruence-on-warnings
 (implies
    (vl-warninglist-equiv warnings warnings-equiv)
    (equal (vl-make-dirxcache dir extensions warnings state)
           (vl-make-dirxcache dir extensions warnings-equiv state)))
 :rule-classes :congruence)

Subtopics

Vl-make-dirxcache-aux