• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
          • Vl-loadstate
          • Parser
          • Vl-load-merge-descriptions
          • Scope-of-defines
          • Vl-load-file
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-loadresult
          • Vl-read-file
          • Vl-find-basename/extension
          • Vl-find-file
          • Vl-read-files
          • Extended-characters
          • Vl-load
          • Vl-load-main
          • Vl-load-description
          • Vl-descriptions-left-to-load
          • Inject-warnings
            • Vl-filter-warnings-by-loc
            • Vl-descriptionlist-inject-warnings
            • Vl-description-inject-warnings
            • Vl-description-add-warnings
            • Vl-warning->loc
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Inject-warnings

    Vl-warning->loc

    Return the location of a warning, if it obeys the location convention.

    Signature
    (vl-warning->loc x) → loc?
    Arguments
    x — Guard (vl-warning-p x).
    Returns
    loc? — Type (iff (vl-location-p loc?) loc?).

    Definitions and Theorems

    Function: vl-warning->loc

    (defun vl-warning->loc (x)
      (declare (xargs :guard (vl-warning-p x)))
      (let ((__function__ 'vl-warning->loc))
        (declare (ignorable __function__))
        (b* ((args (vl-warning->args x)))
          (and (consp args)
               (vl-location-p (car args))
               (car args)))))

    Theorem: return-type-of-vl-warning->loc

    (defthm return-type-of-vl-warning->loc
      (b* ((loc? (vl-warning->loc x)))
        (iff (vl-location-p loc?) loc?))
      :rule-classes :rewrite)

    Theorem: vl-warning->loc-of-vl-warning-fix-x

    (defthm vl-warning->loc-of-vl-warning-fix-x
      (equal (vl-warning->loc (vl-warning-fix x))
             (vl-warning->loc x)))

    Theorem: vl-warning->loc-vl-warning-equiv-congruence-on-x

    (defthm vl-warning->loc-vl-warning-equiv-congruence-on-x
      (implies (vl-warning-equiv x x-equiv)
               (equal (vl-warning->loc x)
                      (vl-warning->loc x-equiv)))
      :rule-classes :congruence)