• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • 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-rest-of-block-comment-after-star
                  • Lex-rest-of-block-comment
                • 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
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Axe
        • Lists-light
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Lexer

Lex-rest-of-block-comment-fns

Mutually recursive part of block comment lexing.

Definitions and Theorems

Function: lex-rest-of-block-comment

(defun lex-rest-of-block-comment (input)
 (declare (xargs :guard (nat-listp input)))
 (let ((__function__ 'lex-rest-of-block-comment))
  (declare (ignorable __function__))
  (b*
   (((mv trees input-after-trees)
     (b*
      (((mv tree-star+rest input-after-star+rest)
        (b*
         (((mv tree-star input-after-star)
           (abnf::parse-ichars "*" input))
          ((when (reserrp tree-star))
           (mv (reserrf "problem lexing \"*\"")
               input))
          ((mv tree-rest input-after-rest)
           (lex-rest-of-block-comment-after-star input-after-star))
          ((when (reserrp tree-rest))
           (mv
             (reserrf
                  "problem lexing rest-of-block-comment-after-star")
             input)))
         (mv (list (list tree-star) (list tree-rest))
             input-after-rest)))
       ((unless (reserrp tree-star+rest))
        (mv tree-star+rest input-after-star+rest))
       ((mv tree-not-star+rest
            input-after-not-star+rest)
        (b* (((mv tree-not-star input-after-not-star)
              (lex-not-star input))
             ((when (reserrp tree-not-star))
              (mv (reserrf "problem lexing not-star")
                  input))
             ((mv tree-rest input-after-rest)
              (lex-rest-of-block-comment input-after-not-star))
             ((when (reserrp tree-rest))
              (mv (reserrf "problem lexing rest-of-block-comment")
                  input)))
          (mv (list (list tree-not-star)
                    (list tree-rest))
              input-after-rest))))
      (mv tree-not-star+rest
          input-after-not-star+rest)))
    ((when (reserrp trees))
     (mv trees (nat-list-fix input))))
   (mv (abnf::make-tree-nonleaf
            :rulename? (abnf::rulename "rest-of-block-comment")
            :branches trees)
       input-after-trees))))

Function: lex-rest-of-block-comment-after-star

(defun lex-rest-of-block-comment-after-star (input)
 (declare (xargs :guard (nat-listp input)))
 (let ((__function__ 'lex-rest-of-block-comment-after-star))
  (declare (ignorable __function__))
  (b*
   (((mv trees input-after-trees)
     (b*
      (((mv tree-slash input-after-slash)
        (abnf::parse-ichars "/" input))
       ((unless (reserrp tree-slash))
        (mv (list (list tree-slash))
            input-after-slash))
       ((mv tree-star+rest input-after-star+rest)
        (b*
         (((mv tree-star input-after-star)
           (abnf::parse-ichars "*" input))
          ((when (reserrp tree-star))
           (mv (reserrf "problem lexing \"*\"")
               input))
          ((mv tree-rest input-after-rest)
           (lex-rest-of-block-comment-after-star input-after-star))
          ((when (reserrp tree-rest))
           (mv
             (reserrf
                  "problem lexing rest-of-block-comment-after-star")
             input)))
         (mv (list (list tree-star) (list tree-rest))
             input-after-rest)))
       ((unless (reserrp tree-star+rest))
        (mv tree-star+rest input-after-star+rest))
       ((mv tree-not-star-or-slash+rest
            input-after-not-star-or-slash+rest)
        (b* (((mv tree-not-star-or-slash
                  input-after-not-star-or-slash)
              (lex-not-star-or-slash input))
             ((when (reserrp tree-not-star-or-slash))
              (mv (reserrf "problem lexing not-star-or-slash")
                  input))
             ((mv tree-rest input-after-rest)
              (lex-rest-of-block-comment
                   input-after-not-star-or-slash))
             ((when (reserrp tree-rest))
              (mv (reserrf "problem lexing rest-of-block-comment")
                  input)))
          (mv (list (list tree-not-star-or-slash)
                    (list tree-rest))
              input-after-rest))))
      (mv tree-not-star-or-slash+rest
          input-after-not-star-or-slash+rest)))
    ((when (reserrp trees))
     (mv trees (nat-list-fix input))))
   (mv
    (abnf::make-tree-nonleaf
      :rulename? (abnf::rulename "rest-of-block-comment-after-star")
      :branches trees)
    input-after-trees))))

Theorem: return-type-of-lex-rest-of-block-comment.tree

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

Theorem: return-type-of-lex-rest-of-block-comment.rest-input

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

Theorem: return-type-of-lex-rest-of-block-comment-after-star.tree

(defthm return-type-of-lex-rest-of-block-comment-after-star.tree
  (b* (((mv ?tree ?rest-input)
        (lex-rest-of-block-comment-after-star input)))
    (abnf::tree-resultp tree))
  :rule-classes :rewrite)

Theorem: return-type-of-lex-rest-of-block-comment-after-star.rest-input

(defthm
     return-type-of-lex-rest-of-block-comment-after-star.rest-input
  (b* (((mv ?tree ?rest-input)
        (lex-rest-of-block-comment-after-star input)))
    (nat-listp rest-input))
  :rule-classes :rewrite)

Theorem: len-of-input-after-rest-of-block-comment-<=

(defthm len-of-input-after-rest-of-block-comment-<=
  (b* (((mv ?tree ?rest-input)
        (lex-rest-of-block-comment input)))
    (<= (len rest-input) (len input)))
  :rule-classes :linear)

Theorem: len-of-input-after-rest-of-block-comment-after-star-<=

(defthm len-of-input-after-rest-of-block-comment-after-star-<=
  (b* (((mv ?tree ?rest-input)
        (lex-rest-of-block-comment-after-star input)))
    (<= (len rest-input) (len input)))
  :rule-classes :linear)

Theorem: len-of-input-after-rest-of-block-comment-<

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

Theorem: len-of-input-after-rest-of-block-comment-after-star-<

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

Subtopics

Lex-rest-of-block-comment-after-star
Lex rule rest-of-block-comment-after-star.
Lex-rest-of-block-comment
Lex rule rest-of-block-comment.