• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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-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-find-basename/extension

    Vl-find-highest-priority-extension

    Signature
    (vl-find-highest-priority-extension extensions found) → hit
    Arguments
    extensions — Extensions we care about in priority order.
        Guard (string-listp extensions).
    found — Extensions we found for this particular file.
        Guard (string-listp found).
    Returns
    hit — Type (stringp hit).

    Definitions and Theorems

    Function: vl-find-highest-priority-extension

    (defun vl-find-highest-priority-extension (extensions found)
      (declare (xargs :guard (and (string-listp extensions)
                                  (string-listp found))))
      (let ((__function__ 'vl-find-highest-priority-extension))
        (declare (ignorable __function__))
        (b* ((extensions (string-list-fix extensions))
             (found (string-list-fix found))
             ((when (atom extensions))
              (raise "Programming error, failed to find extension.")
              "")
             ((when (member-equal (car extensions) found))
              (car extensions)))
          (vl-find-highest-priority-extension (cdr extensions)
                                              found))))

    Theorem: stringp-of-vl-find-highest-priority-extension

    (defthm stringp-of-vl-find-highest-priority-extension
      (b* ((hit (vl-find-highest-priority-extension extensions found)))
        (stringp hit))
      :rule-classes :type-prescription)

    Theorem: vl-find-highest-priority-extension-of-string-list-fix-extensions

    (defthm
       vl-find-highest-priority-extension-of-string-list-fix-extensions
     (equal
        (vl-find-highest-priority-extension (string-list-fix extensions)
                                            found)
        (vl-find-highest-priority-extension extensions found)))

    Theorem: vl-find-highest-priority-extension-string-list-equiv-congruence-on-extensions

    (defthm
     vl-find-highest-priority-extension-string-list-equiv-congruence-on-extensions
     (implies
      (str::string-list-equiv extensions extensions-equiv)
      (equal
           (vl-find-highest-priority-extension extensions found)
           (vl-find-highest-priority-extension extensions-equiv found)))
     :rule-classes :congruence)

    Theorem: vl-find-highest-priority-extension-of-string-list-fix-found

    (defthm vl-find-highest-priority-extension-of-string-list-fix-found
      (equal (vl-find-highest-priority-extension
                  extensions (string-list-fix found))
             (vl-find-highest-priority-extension extensions found)))

    Theorem: vl-find-highest-priority-extension-string-list-equiv-congruence-on-found

    (defthm
     vl-find-highest-priority-extension-string-list-equiv-congruence-on-found
     (implies
      (str::string-list-equiv found found-equiv)
      (equal
           (vl-find-highest-priority-extension extensions found)
           (vl-find-highest-priority-extension extensions found-equiv)))
     :rule-classes :congruence)