• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
        • Proof-support
        • Abstract-syntax
        • R1cs-subset
        • Semantics
        • Abstract-syntax-operations
        • Indexed-names
        • Well-formedness
        • Concrete-syntax
          • Lexer
          • Grammar
          • Parser
            • 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-pfcs-integer
              • Parse-constraint
              • Parse-*-definition
              • Parse-*-constraint
              • Parsize
              • Check-token-string
              • Check-token-root
              • Parse-token
              • Token-stringp
              • Token-rootp
              • Patbind-pok<
              • Parse-multiplication-expression-rest
              • Parse-addition-expression-rest
              • Parse-primary-expression
              • Parse-multiplication-expression
              • Parse-addition-expression
              • Parse-expression
              • Patbind-pok
              • Perr
            • Tokenizer
          • R1cs-bridge
          • Parser-interface
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Parser

    Parse-relation-constraint

    Parse a relation-constraint.

    Signature
    (parse-relation-constraint token input) 
      → 
    (mv tree next-token rest-input)
    Arguments
    token — Guard (abnf::tree-optionp token).
    input — Guard (abnf::tree-listp input).
    Returns
    tree — Type (abnf::tree-resultp tree).
    next-token — Type (abnf::tree-optionp next-token).
    rest-input — Type (abnf::tree-listp rest-input).

    Definitions and Theorems

    Function: parse-relation-constraint

    (defun parse-relation-constraint (token input)
     (declare (xargs :guard (and (abnf::tree-optionp token)
                                 (abnf::tree-listp input))))
     (let ((__function__ 'parse-relation-constraint))
      (declare (ignorable __function__))
      (b*
       (((pok tree1)
         (parse-identifier token input))
        ((pok tree2)
         (parse-separator "(" token input))
        ((pok tree3)
         (if (token-stringp ")" token)
             (mv (abnf::make-tree-nonleaf :rulename? nil
                                          :branches nil)
                 token input)
          (b* (((pok< tree)
                (parse-expression token input))
               ((pok trees)
                (parse-*-comma-expression token input)))
           (mv
            (abnf::make-tree-nonleaf :rulename? nil
                                     :branches (list (list tree) trees))
            token input))))
        ((pok tree4)
         (parse-separator ")" token input)))
       (mv (abnf::make-tree-nonleaf
                :rulename? (abnf::rulename "relation-constraint")
                :branches (list (list tree1)
                                (list tree2)
                                (list tree3)
                                (list tree4)))
           token input))))

    Theorem: tree-resultp-of-parse-relation-constraint.tree

    (defthm tree-resultp-of-parse-relation-constraint.tree
      (b* (((mv ?tree ?next-token ?rest-input)
            (parse-relation-constraint token input)))
        (abnf::tree-resultp tree))
      :rule-classes :rewrite)

    Theorem: tree-optionp-of-parse-relation-constraint.next-token

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

    Theorem: tree-listp-of-parse-relation-constraint.rest-input

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

    Theorem: parsize-of-parse-relation-constraint-<=

    (defthm parsize-of-parse-relation-constraint-<=
      (b* (((mv ?tree ?next-token ?rest-input)
            (parse-relation-constraint token input)))
        (<= (parsize next-token rest-input)
            (parsize token input)))
      :rule-classes :linear)

    Theorem: parsize-of-parse-relation-constraint-<

    (defthm parsize-of-parse-relation-constraint-<
      (b* (((mv ?tree ?next-token ?rest-input)
            (parse-relation-constraint token input)))
        (implies (not (reserrp tree))
                 (< (parsize next-token rest-input)
                    (parsize token input))))
      :rule-classes :linear)

    Theorem: parse-relation-constraint-of-tree-option-fix-token

    (defthm parse-relation-constraint-of-tree-option-fix-token
      (equal (parse-relation-constraint (abnf::tree-option-fix token)
                                        input)
             (parse-relation-constraint token input)))

    Theorem: parse-relation-constraint-tree-option-equiv-congruence-on-token

    (defthm
        parse-relation-constraint-tree-option-equiv-congruence-on-token
      (implies (abnf::tree-option-equiv token token-equiv)
               (equal (parse-relation-constraint token input)
                      (parse-relation-constraint token-equiv input)))
      :rule-classes :congruence)

    Theorem: parse-relation-constraint-of-tree-list-fix-input

    (defthm parse-relation-constraint-of-tree-list-fix-input
      (equal
           (parse-relation-constraint token (abnf::tree-list-fix input))
           (parse-relation-constraint token input)))

    Theorem: parse-relation-constraint-tree-list-equiv-congruence-on-input

    (defthm
          parse-relation-constraint-tree-list-equiv-congruence-on-input
      (implies (abnf::tree-list-equiv input input-equiv)
               (equal (parse-relation-constraint token input)
                      (parse-relation-constraint token input-equiv)))
      :rule-classes :congruence)