• 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
            • Lex-strings
            • Lex-identifiers
            • Vl-typo-uppercase-p
            • Vl-typo-number-p
            • Vl-typo-lowercase-p
            • Lex-numbers
              • Vl-decimal-digit-p
              • Vl-z-digit-p
              • Vl-x-digit-p
              • Vl-underscore-or-octal-digit-p
              • Vl-underscore-or-hex-digit-p
              • Vl-underscore-or-decimal-digit-p
              • Vl-underscore-or-binary-digit-p
              • Vl-octal-digit-p
              • Vl-non-zero-decimal-digit-p
              • Vl-hex-digit-p
              • Vl-binary-digit-p
              • Vl-lex-integer
              • Vl-correct-bitlist
              • Vl-lex-time-or-real-number
              • Vl-read-decimal-value
              • Vl-lex-unbased-unsized-literal
              • Vl-lex-number
                • Vl-lex-number-token/remainder-thms
              • Vl-read-non-zero-unsigned-number
              • Vl-read-any-base
              • Vl-read-unsigned-number
              • Vl-read-time-unit
              • Vl-read-binary-value
              • Vl-read-real-tail
              • Vl-read-octal-value
              • Vl-read-hex-value
              • Vl-read-decimal-base
              • Vl-read-octal-base
              • Vl-read-hex-base
              • Vl-read-binary-base
              • Vl-hex-digits-to-bitlist
              • Vl-octal-digits-to-bitlist
              • Vl-decimal-digits-to-bitlist
              • Vl-binary-digits-to-bitlist
              • Vl-underscore-or-octal-digit-list-p
              • Vl-underscore-or-hex-digit-list-p
              • Vl-underscore-or-decimal-digit-list-p
              • Vl-underscore-or-binary-digit-list-p
              • Vl-non-zero-decimal-digit-list-p
              • Vl-decimal-digit-list-p
              • Vl-binary-digit-list-p
              • Vl-z-digit-list-p
              • Vl-x-digit-list-p
              • Vl-octal-digit-list-p
              • Vl-hex-digit-list-p
              • Vl-timeunit-lookup
            • 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
          • 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-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
  • Lex-numbers

Vl-lex-number

Match number, time_literal, and unbased_unsized_literal.

Signature
(vl-lex-number echars breakp st warnings) 
  → 
(mv token? remainder warnings)
Arguments
echars — Guard (vl-echarlist-p echars).
breakp — Guard (booleanp breakp).
st — Guard (vl-lexstate-p st).
warnings — Guard (vl-warninglist-p warnings).
Returns
warnings — Type (vl-warninglist-p warnings).

Definitions and Theorems

Function: vl-lex-number$inline

(defun vl-lex-number$inline (echars breakp st warnings)
  (declare (xargs :guard (and (vl-echarlist-p echars)
                              (booleanp breakp)
                              (vl-lexstate-p st)
                              (vl-warninglist-p warnings))))
  (let ((__function__ 'vl-lex-number))
    (declare (ignorable __function__))
    (b* ((warnings (vl-warninglist-fix warnings))
         ((mv token remainder)
          (vl-lex-time-or-real-number echars breakp st))
         ((when token)
          (mv token remainder warnings))
         ((mv token remainder warnings)
          (vl-lex-integer echars breakp warnings))
         ((when token)
          (mv token remainder warnings))
         ((unless (vl-lexstate->extintsp st))
          (mv nil echars warnings))
         ((mv token remainder)
          (vl-lex-unbased-unsized-literal echars breakp)))
      (mv token remainder warnings))))

Theorem: vl-warninglist-p-of-vl-lex-number.warnings

(defthm vl-warninglist-p-of-vl-lex-number.warnings
  (b* (((mv ?token? ?remainder ?warnings)
        (vl-lex-number$inline echars breakp st warnings)))
    (vl-warninglist-p warnings))
  :rule-classes :rewrite)

Theorem: vl-token-p-of-vl-lex-number

(defthm vl-token-p-of-vl-lex-number
 (implies
  (and (force (vl-echarlist-p echars)) t)
  (equal
     (vl-token-p (mv-nth 0
                         (vl-lex-number echars breakp st warnings)))
     (if (mv-nth 0
                 (vl-lex-number echars breakp st warnings))
         t
       nil))))

Theorem: true-listp-of-vl-lex-number

(defthm true-listp-of-vl-lex-number
 (equal
     (true-listp (mv-nth 1
                         (vl-lex-number echars breakp st warnings)))
     (true-listp echars))
 :rule-classes
 ((:rewrite)
  (:type-prescription
   :corollary
   (implies
        (true-listp echars)
        (true-listp
             (mv-nth 1
                     (vl-lex-number echars breakp st warnings)))))))

Theorem: vl-echarlist-p-of-vl-lex-number

(defthm vl-echarlist-p-of-vl-lex-number
 (implies
     (force (vl-echarlist-p echars))
     (equal (vl-echarlist-p
                 (mv-nth 1
                         (vl-lex-number echars breakp st warnings)))
            t)))

Theorem: append-of-vl-lex-number

(defthm append-of-vl-lex-number
 (implies
  (and (mv-nth 0
               (vl-lex-number echars breakp st warnings))
       (force (vl-echarlist-p echars))
       t)
  (equal
    (append (vl-token->etext
                 (mv-nth 0
                         (vl-lex-number echars breakp st warnings)))
            (mv-nth 1
                    (vl-lex-number echars breakp st warnings)))
    echars)))

Theorem: no-change-loser-of-vl-lex-number

(defthm no-change-loser-of-vl-lex-number
  (implies (not (mv-nth 0
                        (vl-lex-number echars breakp st warnings)))
           (equal (mv-nth 1
                          (vl-lex-number echars breakp st warnings))
                  echars)))

Theorem: acl2-count-of-vl-lex-number-weak

(defthm acl2-count-of-vl-lex-number-weak
 (<= (acl2-count (mv-nth 1
                         (vl-lex-number echars breakp st warnings)))
     (acl2-count echars))
 :rule-classes ((:rewrite) (:linear)))

Theorem: acl2-count-of-vl-lex-number-strong

(defthm acl2-count-of-vl-lex-number-strong
 (implies
  (and (mv-nth 0
               (vl-lex-number echars breakp st warnings))
       t)
  (< (acl2-count (mv-nth 1
                         (vl-lex-number echars breakp st warnings)))
     (acl2-count echars)))
 :rule-classes ((:rewrite) (:linear)))

Subtopics

Vl-lex-number-token/remainder-thms
Token and remainder theorems for vl-lex-number, automatically generated by def-token/remainder-thms.