• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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-echar-p
              • Make-vl-echar-fast
              • Vl-echar->char
              • Vl-echar
              • Vl-echar->loc
                • Vl-echarpack-p
              • Vl-location
              • Vl-echarlist->chars
              • Vl-echarlist-from-chars
              • Vl-echarlist-from-str
              • Vl-echarlist-unsigned-value
              • Vl-change-echarlist-locations
              • Vl-echar-digit-value
              • Vl-echarlist->string
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • 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
    • Vl-echar-p

    Vl-echar->loc

    High-level accessor: get the location from an vl-echar-p.

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

    Note that this has to construct a vl-location-p object.

    Definitions and Theorems

    Function: vl-echar->loc

    (defun vl-echar->loc (x)
      (declare (xargs :guard (vl-echar-p x)))
      (let ((__function__ 'vl-echar->loc))
        (declare (ignorable __function__))
        (b* (((vl-echar-raw x) x))
          (make-vl-location :filename x.filename
                            :line (vl-echarpack->line x.pack)
                            :col (vl-echarpack->col x.pack)))))

    Theorem: vl-location-p-of-vl-echar->loc

    (defthm vl-location-p-of-vl-echar->loc
      (b* ((loc (vl-echar->loc x)))
        (vl-location-p loc))
      :rule-classes :rewrite)

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

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

    Theorem: vl-echar->loc-vl-echar-raw-equiv-congruence-on-x

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

    Theorem: vl-echar->loc-of-vl-echar

    (defthm vl-echar->loc-of-vl-echar
      (equal (vl-echar->loc (vl-echar char loc))
             (vl-location-fix loc)))