• 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
            • Lex-strings
            • Lex-identifiers
            • 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
              • Def-prefix/remainder-thms
              • Def-token/remainder-thms
              • Vl-read-until-literal
              • Vl-read-through-literal
              • Vl-matches-string-p
              • Vl-read-literal
              • Vl-echarlist-kill-underscores
                • Vl-read-some-literal
              • 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
    • Lexer-utils

    Vl-echarlist-kill-underscores

    Remove all occurrences of the underscore character from a vl-echarlist-p.

    Signature
    (vl-echarlist-kill-underscores x) → reduced-x
    Arguments
    x — Guard (vl-echarlist-p x).
    Returns
    reduced-x — Type (vl-echarlist-p reduced-x), given the guard.

    Verilog uses underscores as a digit separator, e.g., you can write 1_000_000 instead of 1000000 for greater readability on long numbers. This function strips away the underscores so we can interpret the remaining digits with vl-echarlist-unsigned-value.

    Definitions and Theorems

    Function: vl-echarlist-kill-underscores

    (defun vl-echarlist-kill-underscores (x)
      (declare (xargs :guard (vl-echarlist-p x)))
      (let ((__function__ 'vl-echarlist-kill-underscores))
        (declare (ignorable __function__))
        (cond ((atom x) nil)
              ((eql (vl-echar->char (car x)) #\_)
               (vl-echarlist-kill-underscores (cdr x)))
              (t (cons (car x)
                       (vl-echarlist-kill-underscores (cdr x)))))))

    Theorem: vl-echarlist-p-of-vl-echarlist-kill-underscores

    (defthm vl-echarlist-p-of-vl-echarlist-kill-underscores
      (implies (and (force (vl-echarlist-p x)))
               (b* ((reduced-x (vl-echarlist-kill-underscores x)))
                 (vl-echarlist-p reduced-x)))
      :rule-classes :rewrite)