• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
          • Transformations
          • Language
            • Abstract-syntax
            • Dynamic-semantics
            • Concrete-syntax
              • Lexer
                • Lex-keyword
                • Lex-group-escape-sequence-single
                • Lex-symbol
                • Lex-rest-of-block-comment-fns
                • Lex-group-for-hex-string
                • Lex-hex-digit
                • Lex-group-escape-sequence-body
                • Lex-whitespace-char
                • Lex-string-literal
                • Lex-literal
                • Lex-identifier-start
                • Lex-hex-string
                • Lex-single-quoted-printable
                • Lex-double-quoted-printable
                • Lex-group-optional-underbar-and-two-hex-digits
                • Lex-escape-sequence
                • Lex-token
                • Lex-not-star-or-slash
                • Lex-not-lf-or-cr
                • Lex-group-squoted-or-escape
                • Lex-group-dquoted-or-escape
                • Lex-optional-sequence-of-2hex-digits
                • Lex-decimal-number
                • Lex-lexeme
                • Lex-identifier-rest
                • Lex-end-of-line-comment
                • Lex-nonzero-decimal-digit
                • Lex-repetition-*-optional-underbar-and-two-hex-digits
                • Lex-not-star
                • Lex-comment
                • Lex-boolean
                • Lex-block-comment
                • Lex-uppercase-letter
                • Lex-lowercase-letter
                • Lex-identifier
                • Lex-hex-number
                • Lex-decimal-digit
                • Lex-squote
                • Lex-repetition-4-hex-digits
                • Lex-optional-underbar
                • Lex-dquote
                • Lex-repetition-*-squoted-or-escape
                • Lex-repetition-*-dquoted-or-escape
                • Lex-repetition-*-whitespace-char
                • Lex-repetition-*-identifier-rest
                • Lex-repetition-2-hex-digits
                • Lex-lf
                • Lex-cr
                • Lex-repetition-*-not-lf-or-cr
                • Lex-repetition-*-decimal-digit
                • Lexemeize-yul
                • Lex-repetition-*-lexeme
                • Lex-repetition-*-hex-digit
                • *defparse-yul-group-table*
                • Lex-whitespace
                  • Lexemeize-yul-bytes
                  • *defparse-yul-repetition-table*
                  • *defparse-yul-option-table*
                • Parser
                • Grammar-old
                • Grammar
                • Tokenizer
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Lexer

    Lex-whitespace

    Lex rule whitespace = 1*whitespace-char.

    Signature
    (lex-whitespace input) → (mv tree rest-input)
    Arguments
    input — Guard (nat-listp input).
    Returns
    tree — Type (abnf::tree-resultp tree).
    rest-input — Type (nat-listp rest-input).

    Definitions and Theorems

    Function: lex-whitespace

    (defun lex-whitespace (input)
      (declare (xargs :guard (nat-listp input)))
      (let ((__function__ 'lex-whitespace))
        (declare (ignorable __function__))
        (b* (((mv tree-1char input-after-1char)
              (lex-whitespace-char input))
             ((when (reserrp tree-1char))
              (mv (reserrf "whitespace problem")
                  (nat-list-fix input)))
             ((mv trees-restchars input-after-restchars)
              (lex-repetition-*-whitespace-char input-after-1char))
             ((when (reserrp trees-restchars))
              (mv (reserrf "whitespace problem")
                  (nat-list-fix input))))
          (mv (abnf::make-tree-nonleaf
                   :rulename? (abnf::rulename "whitespace")
                   :branches (list (cons tree-1char trees-restchars)))
              input-after-restchars))))

    Theorem: tree-resultp-of-lex-whitespace.tree

    (defthm tree-resultp-of-lex-whitespace.tree
      (b* (((mv ?tree ?rest-input)
            (lex-whitespace input)))
        (abnf::tree-resultp tree))
      :rule-classes :rewrite)

    Theorem: nat-listp-of-lex-whitespace.rest-input

    (defthm nat-listp-of-lex-whitespace.rest-input
      (b* (((mv ?tree ?rest-input)
            (lex-whitespace input)))
        (nat-listp rest-input))
      :rule-classes :rewrite)

    Theorem: len-of-lex-whitespace-<

    (defthm len-of-lex-whitespace-<
      (b* (((mv ?tree ?rest-input)
            (lex-whitespace input)))
        (implies (not (reserrp tree))
                 (< (len rest-input) (len input))))
      :rule-classes :linear)

    Theorem: lex-whitespace-of-nat-list-fix-input

    (defthm lex-whitespace-of-nat-list-fix-input
      (equal (lex-whitespace (nat-list-fix input))
             (lex-whitespace input)))

    Theorem: lex-whitespace-nat-list-equiv-congruence-on-input

    (defthm lex-whitespace-nat-list-equiv-congruence-on-input
      (implies (acl2::nat-list-equiv input input-equiv)
               (equal (lex-whitespace input)
                      (lex-whitespace input-equiv)))
      :rule-classes :congruence)