• 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
            • Lex-strings
            • Lex-identifiers
              • Vl-printable-not-whitespace-p
              • Vl-simple-id-tail-p
              • Vl-simple-id-head-p
              • Vl-read-escaped-identifier
                • Vl-read-escaped-identifier-prefix/remainder-thms
              • Vl-lex-system-identifier
              • Vl-lex-simple-identifier-or-keyword
              • Vl-printable-not-whitespace-list-p
              • Vl-simple-id-tail-list-p
              • Vl-simple-id-head-list-p
              • Vl-read-simple-identifier
              • Vl-lex-escaped-identifier
            • Vl-typo-uppercase-p
            • Vl-typo-number-p
            • Vl-typo-lowercase-p
            • Lex-numbers
            • Chartypes
            • Vl-lex
            • Defchar
            • Tokens
            • Lex-keywords
            • Lexstate
            • Make-test-tokens
            • Lexer-utils
            • Lex-comments
            • Vl-typo-uppercase-list-p
            • Vl-typo-lowercase-list-p
            • Vl-typo-number-list-p
          • 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-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
  • Lex-identifiers

Vl-read-escaped-identifier

Signature
(vl-read-escaped-identifier echars) 
  → 
(mv name/nil prefix remainder)
Arguments
echars — Guard (vl-echarlist-p echars).
Returns
name/nil — On success, a string with the interpreted name (similar to prefix, but without the leading backslash or trailing whitespace character.).
    Type (equal (stringp name/nil) (if name/nil t nil)), given the guard.

Definitions and Theorems

Function: vl-read-escaped-identifier

(defun vl-read-escaped-identifier (echars)
  (declare (xargs :guard (vl-echarlist-p echars)))
  (let ((__function__ 'vl-read-escaped-identifier))
    (declare (ignorable __function__))
    (b* (((when (or (not (consp echars))
                    (not (eql (vl-echar->char (car echars))
                              #\\))))
          (mv nil nil echars))
         ((mv tail remainder)
          (vl-read-while-printable-not-whitespace (cdr echars)))
         ((unless tail) (mv nil nil echars))
         ((unless (consp remainder))
          (mv (hons-copy (vl-echarlist->string tail))
              (cons (car echars) tail)
              remainder)))
      (mv (hons-copy (vl-echarlist->string tail))
          (cons (car echars)
                (append tail (list (car remainder))))
          (cdr remainder)))))

Theorem: return-type-of-vl-read-escaped-identifier.name/nil

(defthm return-type-of-vl-read-escaped-identifier.name/nil
  (implies (and (force (vl-echarlist-p echars)))
           (b* (((mv ?name/nil ?prefix ?remainder)
                 (vl-read-escaped-identifier echars)))
             (equal (stringp name/nil)
                    (if name/nil t nil))))
  :rule-classes :rewrite)

Theorem: vl-read-escaped-identifier-under-iff

(defthm vl-read-escaped-identifier-under-iff
  (b* (((mv name prefix ?remainder)
        (vl-read-escaped-identifier echars)))
    (iff prefix name)))

Subtopics

Vl-read-escaped-identifier-prefix/remainder-thms
Prefix and remainder theorems for vl-read-escaped-identifier, automatically generated by def-prefix/remainder-thms.