• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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-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-find-file

    Vl-cache-find-file-aux

    Alternative to vl-slow-find-file-aux using a vl-dirlist-cache-p.

    Signature
    (vl-cache-find-file-aux filename searchcache) → realpath
    Arguments
    filename — Guard (stringp filename).
    searchcache — Guard (vl-dirlist-cache-p searchcache).
    Returns
    realpath — Type (maybe-stringp realpath).

    Definitions and Theorems

    Function: vl-cache-find-file-aux

    (defun vl-cache-find-file-aux (filename searchcache)
      (declare (xargs :guard (and (stringp filename)
                                  (vl-dirlist-cache-p searchcache))))
      (let ((__function__ 'vl-cache-find-file-aux))
        (declare (ignorable __function__))
        (b* ((filename (string-fix filename))
             (searchcache (vl-dirlist-cache-fix searchcache))
             ((when (atom searchcache)) nil)
             ((cons dir file-fal) (car searchcache))
             (exists-p (hons-get filename file-fal))
             ((when exists-p)
              (vl-extend-pathname dir filename)))
          (vl-cache-find-file-aux filename (cdr searchcache)))))

    Theorem: maybe-stringp-of-vl-cache-find-file-aux

    (defthm maybe-stringp-of-vl-cache-find-file-aux
      (b* ((realpath (vl-cache-find-file-aux filename searchcache)))
        (maybe-stringp realpath))
      :rule-classes :type-prescription)

    Theorem: vl-cache-find-file-aux-of-str-fix-filename

    (defthm vl-cache-find-file-aux-of-str-fix-filename
      (equal (vl-cache-find-file-aux (str-fix filename)
                                     searchcache)
             (vl-cache-find-file-aux filename searchcache)))

    Theorem: vl-cache-find-file-aux-streqv-congruence-on-filename

    (defthm vl-cache-find-file-aux-streqv-congruence-on-filename
      (implies
           (streqv filename filename-equiv)
           (equal (vl-cache-find-file-aux filename searchcache)
                  (vl-cache-find-file-aux filename-equiv searchcache)))
      :rule-classes :congruence)

    Theorem: vl-cache-find-file-aux-of-vl-dirlist-cache-fix-searchcache

    (defthm vl-cache-find-file-aux-of-vl-dirlist-cache-fix-searchcache
      (equal (vl-cache-find-file-aux filename
                                     (vl-dirlist-cache-fix searchcache))
             (vl-cache-find-file-aux filename searchcache)))

    Theorem: vl-cache-find-file-aux-vl-dirlist-cache-equiv-congruence-on-searchcache

    (defthm
     vl-cache-find-file-aux-vl-dirlist-cache-equiv-congruence-on-searchcache
     (implies
          (vl-dirlist-cache-equiv searchcache searchcache-equiv)
          (equal (vl-cache-find-file-aux filename searchcache)
                 (vl-cache-find-file-aux filename searchcache-equiv)))
     :rule-classes :congruence)