• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • 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
        • Aleobft
        • Aleovm
          • Circuits
          • Language
            • Grammar
            • Early-version
              • Abstract-syntax
              • Parser
                • Lex-record
                • Lex-group-escaped-char-body
                • Lex-group-instruction-body
                  • Lex-increment
                  • Lex-decrement
                  • Lex-value-type
                  • Lex-unary-op
                  • Lex-rest-of-block-comment-fns
                  • Lex-not-dq-or-backslash
                  • Lex-not-star-or-slash
                  • *defparse-aleo-group-table*
                  • Lex-hex-digit
                  • Lex-transition-output
                  • Lex-transition-input
                  • Lex-binary-op
                  • Lex-transition
                  • Lex-mapping-value
                  • Lex-group-program-declaration
                  • Lex-function-output
                  • Lex-function-input
                  • Lex-finalize-output
                  • Lex-finalize-input
                  • Lex-program
                  • Lex-not-star
                  • Lex-mapping-key
                  • Lex-hash-op
                  • *defparse-aleo-repetition-table*
                  • Lex-cast
                  • Lex-call
                  • Lex-unsigned-type
                  • Lex-signed-type
                  • Lex-function
                  • Lex-finalize-type
                  • Lex-finalize
                  • Lex-commit
                  • Lex-is
                  • Lex-register-type
                  • Lex-mapping
                  • Lex-group-entry-type-visibility
                  • Lex-group-bhp-sizes
                  • Lex-arithmetic-literal
                  • Lex-tuple
                  • Lex-safe-nonascii
                  • Lex-literal-type
                  • Lex-instruction
                  • Lex-entry
                  • Lex-arithmetic-type
                  • Lex-struct
                  • Lex-not-lf-or-cr
                  • Lex-commit-op
                  • Lex-ternary
                  • Lex-plain-ws
                  • Lex-operand
                  • Lex-literal
                  • Lex-hash
                  • Lex-group-letter/digit/_
                  • Lex-finalize-command
                  • Lex-escaped-char
                  • Lex-binary
                  • Lex-unary
                  • Lex-string-element
                  • Lex-import
                  • Lex-group-psd-sizes
                  • Lex-group-escaped-lf/not-lf-or-cr
                  • Lex-group-address-public/private
                  • Lex-group-1*-plain-ws/escaped-lf
                  • Lex-unsigned-literal
                  • Lex-repetition-1*6-hex-digit
                  • Lex-group-u64-public/private
                  • Lex-group-locator/identifier
                  • Lex-signed-literal
                  • Lex-scalar-literal
                  • Lex-group-literal
                  • Lex-group-address-char-*-underbar
                  • Lex-field-literal
                  • Lex-command
                  • Lex-assert
                  • Lex-string-literal
                  • Lex-register-access
                  • Lex-program-id
                  • Lex-plaintext-type
                  • Lex-optional-transition-finalize
                  • Lex-integer-literal
                  • Lex-group-ped-sizes
                  • Lex-group-dot-identifier
                  • Lex-group-digit-*-underbar
                  • Lex-group-1-ws-register
                  • Lex-boolean-literal
                  • Lex-locator
                  • Lex-line-comment
                  • Lex-integer-type
                  • Lex-identifier
                  • Lex-group-1-ws-operand
                  • Lex-group-1-operand
                  • Lex-entry-type
                  • Lex-address-literal
                  • Lex-letter
                  • Lex-comment
                  • Lex-block-comment
                  • Lex-assert-op
                  • Lex-uppercase-letter
                  • Lex-repetition-1*-program-declaration
                  • Lex-repetition-1*-address-char-*-underbar
                  • Lex-register
                  • Lex-lowercase-letter
                  • Lex-is-op
                  • Lex-escaped-ws
                  • Lex-escaped-lf
                  • Lex-visible-ascii
                  • Lex-string-type
                  • Lex-scalar-type
                  • Lex-boolean-type
                  • Lex-address-type
                  • Lex-ternary-op
                  • Lex-repetition-*-program-declaration
                  • Lex-repetition-*-plain-ws-or-escaped-lf
                  • Lex-repetition-*-escaped-lf/not-lf-or-cr
                  • Lex-repetition-*-address-char-*-underbar
                  • Lex-repetition-1*-digit-*-underbar
                  • Lex-group-type
                  • Lex-field-type
                  • Lex-repetition-3-operands
                  • Lex-repetition-1*-ws-register
                  • Lex-repetition-1*-ws-operand
                  • Lex-repetition-1*-instruction
                  • Lex-optional-hyphen
                  • Lex-digit
                  • Lex-sp
                  • Lex-repetition-*-transition-output
                  • Lex-repetition-*-transition-input
                  • Lex-repetition-*-string-element
                  • Lex-repetition-*-letter/digit/_
                  • Lex-repetition-*-function-output
                  • Lex-repetition-*-function-input
                  • Lex-repetition-*-finalize-output
                  • Lex-repetition-*-finalize-input
                  • Lex-repetition-*-dot-identifier
                  • Lex-repetition-*-digit-*-underbar
                  • Lex-repetition-1*-command
                  • Lex-lf
                  • Lex-ht
                  • Lex-dq
                  • Lex-cr
                  • Lex-ws
                  • Lex-repetition-*-ws-register
                  • Lex-repetition-*-ws-operand
                  • Lex-repetition-*-instruction
                  • Lex-repetition-2-operands
                  • Lex-repetition-*-plain-ws
                  • Lex-repetition-*-import
                  • Lex-repetition-*-hex-digit
                  • Lex-repetition-*-comment/ws
                  • Lex-repetition-*-command
                  • Lex-repetition-1*-plain-ws
                  • Lex-group-comment/ws
                  • Lex-repetition-*-underbar
                  • Lex-repetition-*-tuple
                  • Lex-repetition-*-entry
                  • Lex-repetition-*-digit
                  • Lex-repetition-1*-tuple
                  • Lex-repetition-1*-digit
                  • Lex-address-char
                  • Lex-group-address-char
                  • Lex-cws
                  • Address-char-nat-p
                  • *defparse-aleo-option-table*
                • Concrete-syntax
              • Concrete-syntax
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Parser

    Lex-group-instruction-body

    Parse a ( unary / binary / ternary / is / assert / commit / hash / cast / call ).

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

    Definitions and Theorems

    Function: lex-group-instruction-body

    (defun lex-group-instruction-body (abnf::input)
     (declare (xargs :guard (nat-listp abnf::input)))
     (let ((__function__ 'lex-group-instruction-body))
      (declare (ignorable __function__))
      (b*
       (((mv abnf::treess abnf::input)
         (b* (((mv abnf::treess1 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-unary abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess1)))
               (mv abnf::treess1 abnf::input1))
              ((mv abnf::treess2 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-binary abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess2)))
               (mv abnf::treess2 abnf::input1))
              ((mv abnf::treess3 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-ternary abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess3)))
               (mv abnf::treess3 abnf::input1))
              ((mv abnf::treess4 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-is abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess4)))
               (mv abnf::treess4 abnf::input1))
              ((mv abnf::treess5 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-assert abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess5)))
               (mv abnf::treess5 abnf::input1))
              ((mv abnf::treess6 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-commit abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess6)))
               (mv abnf::treess6 abnf::input1))
              ((mv abnf::treess7 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-hash abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess7)))
               (mv abnf::treess7 abnf::input1))
              ((mv abnf::treess8 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-cast abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess8)))
               (mv abnf::treess8 abnf::input1))
              ((mv abnf::treess9 abnf::input1)
               (b* (((mv abnf::tree abnf::input)
                     (lex-call abnf::input))
                    ((when (reserrp abnf::tree))
                     (mv (reserrf-push abnf::tree)
                         abnf::input))
                    (abnf::trees1 (list abnf::tree))
                    (abnf::treess (list abnf::trees1)))
                 (mv abnf::treess abnf::input)))
              ((when (not (reserrp abnf::treess9)))
               (mv abnf::treess9 abnf::input1)))
          (mv
           (reserrf
               (list :found (list abnf::treess1
                                  abnf::treess2 abnf::treess3
                                  abnf::treess4 abnf::treess5
                                  abnf::treess6 abnf::treess7
                                  abnf::treess8 abnf::treess9)
                     :required
                     '(((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "unary"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "binary"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "ternary"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "is"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "assert"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "commit"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "hash"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "cast"))))
                       ((:repetition (:repeat 1 (:finite 1))
                                     (:rulename (:rulename "call")))))))
           abnf::input)))
        ((when (reserrp abnf::treess))
         (mv (reserrf-push abnf::treess)
             (nat-list-fix abnf::input))))
       (mv (abnf::make-tree-nonleaf :rulename? nil
                                    :branches abnf::treess)
           abnf::input))))

    Theorem: tree-resultp-of-lex-group-instruction-body.tree

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

    Theorem: nat-listp-of-lex-group-instruction-body.rest-input

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

    Theorem: len-of-lex-group-instruction-body-<=

    (defthm len-of-lex-group-instruction-body-<=
      (b* (((mv abnf::?tree abnf::?rest-input)
            (lex-group-instruction-body abnf::input)))
        (<= (len abnf::rest-input)
            (len abnf::input)))
      :rule-classes :linear)

    Theorem: len-of-lex-group-instruction-body-<

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

    Theorem: lex-group-instruction-body-of-nat-list-fix-input

    (defthm lex-group-instruction-body-of-nat-list-fix-input
      (equal (lex-group-instruction-body (nat-list-fix abnf::input))
             (lex-group-instruction-body abnf::input)))

    Theorem: lex-group-instruction-body-nat-list-equiv-congruence-on-input

    (defthm
          lex-group-instruction-body-nat-list-equiv-congruence-on-input
      (implies (acl2::nat-list-equiv abnf::input input-equiv)
               (equal (lex-group-instruction-body abnf::input)
                      (lex-group-instruction-body input-equiv)))
      :rule-classes :congruence)