• 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-flush-out-descriptions
          • Vl-description
          • Vl-read-file
          • Vl-includeskips-report-gather
          • Vl-load-main
          • Extended-characters
            • Vl-location
            • Vl-echar-p
              • Make-vl-echar-fast
              • Vl-echar->char
              • Vl-echar
              • Vl-echar->loc
                • Vl-echarpack-p
              • 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-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-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))
         (mbe :logic (make-vl-location :filename x.filename
                                       :line (vl-echarpack->line x.pack)
                                       :col (vl-echarpack->col x.pack))
              :exec (cons (vl-echarpack->linecol x.pack)
                          (hons :vl-location x.filename))))))

    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)))