• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
        • Proof-support
        • Semantics
        • Lifting
        • R1cs-subset
        • Indexed-names
        • Well-formedness
        • Abstract-syntax
        • Concrete-syntax
          • Lexer
          • Grammar
          • Parser
            • Parse-operator-among
            • Parse-separator
            • Parse-operator
            • Parse-definition
            • Parse-relation-constraint
            • Parse-equality-constraint
            • Parse-*-comma-identifier
              • Parse-*-comma-expression
              • Parse-*-comma-constraint
              • Parse-system
              • Parse-identifier
              • Parse-numeral
              • Parse-constraint
              • Parse-*-definition
              • Parse-*-constraint
              • Parsize
              • Check-token-string
              • Check-token-root
              • Parse-token
              • Token-stringp
              • Token-rootp
              • Patbind-pok<
              • Parse-unary-minus-expression
              • Parse-multiplication-expression-rest
              • Parse-additive-expression-rest
              • Parse-primary-expression
              • Parse-multiplication-expression
              • Parse-additive-expression
              • Parse-expression
              • Patbind-pok
              • Perr
            • Tokenizer
          • R1cs-bridge
          • Parser-interface
        • Wp-gen
        • Dimacs-reader
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Riscv
        • Bitcoin
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Parser

    Parse-*-comma-identifier

    Parse a *( "," identifier ).

    Signature
    (parse-*-comma-identifier token input) 
      → 
    (mv trees next-token rest-input)
    Arguments
    token — Guard (abnf::tree-optionp token).
    input — Guard (abnf::tree-listp input).
    Returns
    trees — Type (abnf::tree-list-resultp trees).
    next-token — Type (abnf::tree-optionp next-token).
    rest-input — Type (abnf::tree-listp rest-input).

    Definitions and Theorems

    Function: parse-*-comma-identifier

    (defun parse-*-comma-identifier (token input)
      (declare (xargs :guard (and (abnf::tree-optionp token)
                                  (abnf::tree-listp input))))
      (let ((__function__ 'parse-*-comma-identifier))
        (declare (ignorable __function__))
        (b* (((unless (token-stringp "," token))
              (mv nil (abnf::tree-option-fix token)
                  (abnf::tree-list-fix input)))
             (start-token token)
             (start-input input)
             ((pok< tree1)
              (parse-separator "," token input))
             (token1 token)
             (input1 input)
             ((mv tree2 token input)
              (parse-identifier token input)))
          (if (reserrp tree2)
              (mv nil (abnf::tree-option-fix start-token)
                  (abnf::tree-list-fix start-input))
            (b* ((tree (abnf::make-tree-nonleaf
                            :rulename? nil
                            :branches (list (list tree1) (list tree2))))
                 ((unless (mbt (< (parsize token input)
                                  (parsize token1 input1))))
                  (mv (reserrf :impossible)
                      token1 input1))
                 ((pok trees)
                  (parse-*-comma-identifier token input)))
              (mv (cons tree trees) token input))))))

    Theorem: tree-list-resultp-of-parse-*-comma-identifier.trees

    (defthm tree-list-resultp-of-parse-*-comma-identifier.trees
      (b* (((mv ?trees ?next-token ?rest-input)
            (parse-*-comma-identifier token input)))
        (abnf::tree-list-resultp trees))
      :rule-classes :rewrite)

    Theorem: tree-optionp-of-parse-*-comma-identifier.next-token

    (defthm tree-optionp-of-parse-*-comma-identifier.next-token
      (b* (((mv ?trees ?next-token ?rest-input)
            (parse-*-comma-identifier token input)))
        (abnf::tree-optionp next-token))
      :rule-classes :rewrite)

    Theorem: tree-listp-of-parse-*-comma-identifier.rest-input

    (defthm tree-listp-of-parse-*-comma-identifier.rest-input
      (b* (((mv ?trees ?next-token ?rest-input)
            (parse-*-comma-identifier token input)))
        (abnf::tree-listp rest-input))
      :rule-classes :rewrite)

    Theorem: parsize-of-parse-*-comma-identifier-<=

    (defthm parsize-of-parse-*-comma-identifier-<=
      (b* (((mv ?trees ?next-token ?rest-input)
            (parse-*-comma-identifier token input)))
        (<= (parsize next-token rest-input)
            (parsize token input)))
      :rule-classes :linear)

    Theorem: parse-*-comma-identifier-of-tree-option-fix-token

    (defthm parse-*-comma-identifier-of-tree-option-fix-token
      (equal (parse-*-comma-identifier (abnf::tree-option-fix token)
                                       input)
             (parse-*-comma-identifier token input)))

    Theorem: parse-*-comma-identifier-tree-option-equiv-congruence-on-token

    (defthm
         parse-*-comma-identifier-tree-option-equiv-congruence-on-token
      (implies (abnf::tree-option-equiv token token-equiv)
               (equal (parse-*-comma-identifier token input)
                      (parse-*-comma-identifier token-equiv input)))
      :rule-classes :congruence)

    Theorem: parse-*-comma-identifier-of-tree-list-fix-input

    (defthm parse-*-comma-identifier-of-tree-list-fix-input
     (equal (parse-*-comma-identifier token (abnf::tree-list-fix input))
            (parse-*-comma-identifier token input)))

    Theorem: parse-*-comma-identifier-tree-list-equiv-congruence-on-input

    (defthm parse-*-comma-identifier-tree-list-equiv-congruence-on-input
      (implies (abnf::tree-list-equiv input input-equiv)
               (equal (parse-*-comma-identifier token input)
                      (parse-*-comma-identifier token input-equiv)))
      :rule-classes :congruence)