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

    High-level constructor for an vl-echar-p.

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

    See make-vl-echar-fast for a faster alternative.

    Definitions and Theorems

    Function: vl-echar

    (defun vl-echar (char loc)
      (declare (xargs :guard (and (characterp char)
                                  (vl-location-p loc))))
      (let ((__function__ 'vl-echar))
        (declare (ignorable __function__))
        (b* (((vl-location loc) loc))
          (vl-echar-raw
               loc.filename
               (vl-echarpack (the (unsigned-byte 8) (char-code char))
                             loc.line loc.col)))))

    Theorem: vl-echar-p-of-vl-echar

    (defthm vl-echar-p-of-vl-echar
      (b* ((echar (vl-echar char loc)))
        (vl-echar-p echar))
      :rule-classes :rewrite)

    Theorem: vl-echar-of-char-fix-char

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

    Theorem: vl-echar-chareqv-congruence-on-char

    (defthm vl-echar-chareqv-congruence-on-char
      (implies (chareqv char char-equiv)
               (equal (vl-echar char loc)
                      (vl-echar char-equiv loc)))
      :rule-classes :congruence)

    Theorem: vl-echar-of-vl-location-fix-loc

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

    Theorem: vl-echar-vl-location-equiv-congruence-on-loc

    (defthm vl-echar-vl-location-equiv-congruence-on-loc
      (implies (vl-location-equiv loc loc-equiv)
               (equal (vl-echar char loc)
                      (vl-echar char loc-equiv)))
      :rule-classes :congruence)