• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
                • Expression
                • Syntax-abstraction
                • Statement
                • Files
                • Input-files
                • Identifiers
                • Types
                • Struct-init
                • Branch
                • Statements
                  • Asgop
                  • Constdecl
                  • Console
                  • Vardecl
                  • Vardecl-result
                  • Statement-result
                  • Statement-list-result
                  • Constdecl-result
                  • Console-result
                  • Branch-result
                  • Branch-list-result
                  • Asgop-result
                  • Asgop-to-binop
                    • Statement-fixtypes
                  • Format-strings
                  • Input-syntax-abstraction
                  • Expressions
                  • Output-files
                  • Addresses
                  • Literals
                  • Characters
                  • Expression-list
                  • Statement-list
                  • Output-syntax-abstraction
                  • Struct-init-list
                  • Branch-list
                  • Annotations
                  • Abstract-syntax-trees
                  • Symbols
                  • Keywords
                  • Programs
                  • Packages
                  • Bit-sizes
                • Dynamic-semantics
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Statements

    Asgop-to-binop

    Map each Leo compound assignment operator to the corresponding binary operator.

    Signature
    (asgop-to-binop op) → bop
    Arguments
    op — Guard (asgopp op).
    Returns
    bop — Type (binopp bop).

    Definitions and Theorems

    Function: asgop-to-binop

    (defun asgop-to-binop (op)
      (declare (xargs :guard (asgopp op)))
      (declare (xargs :guard (not (asgop-case op :asg))))
      (let ((__function__ 'asgop-to-binop))
        (declare (ignorable __function__))
        (asgop-case op
                    :asg (prog2$ (impossible)
                                 (ec-call (binop-fix :irrelevant)))
                    :asg-add (binop-add)
                    :asg-sub (binop-sub)
                    :asg-mul (binop-mul)
                    :asg-div (binop-div)
                    :asg-rem (binop-rem)
                    :asg-pow (binop-pow)
                    :asg-shl (binop-shl)
                    :asg-shr (binop-shr)
                    :asg-bitand (binop-bitand)
                    :asg-bitior (binop-bitior)
                    :asg-bitxor (binop-bitxor)
                    :asg-and (binop-and)
                    :asg-or (binop-or))))

    Theorem: binopp-of-asgop-to-binop

    (defthm binopp-of-asgop-to-binop
      (b* ((bop (asgop-to-binop op)))
        (binopp bop))
      :rule-classes :rewrite)

    Theorem: asgop-to-binop-of-asgop-fix-op

    (defthm asgop-to-binop-of-asgop-fix-op
      (equal (asgop-to-binop (asgop-fix op))
             (asgop-to-binop op)))

    Theorem: asgop-to-binop-asgop-equiv-congruence-on-op

    (defthm asgop-to-binop-asgop-equiv-congruence-on-op
      (implies (asgop-equiv op op-equiv)
               (equal (asgop-to-binop op)
                      (asgop-to-binop op-equiv)))
      :rule-classes :congruence)