• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
              • Tyspecseq
              • Expr
              • Binop
                • Binopp
                • Binop-fix
                • Binop-case
                • Binop-kind
                  • Binop-equiv
                  • Binop-add
                  • Binop-sub
                  • Binop-shr
                  • Binop-shl
                  • Binop-rem
                  • Binop-ne
                  • Binop-mul
                  • Binop-lt
                  • Binop-logor
                  • Binop-logand
                  • Binop-le
                  • Binop-gt
                  • Binop-ge
                  • Binop-eq
                  • Binop-div
                  • Binop-bitxor
                  • Binop-bitior
                  • Binop-bitand
                  • Binop-asg-xor
                  • Binop-asg-sub
                  • Binop-asg-shr
                  • Binop-asg-shl
                  • Binop-asg-rem
                  • Binop-asg-mul
                  • Binop-asg-ior
                  • Binop-asg-div
                  • Binop-asg-and
                  • Binop-asg-add
                  • Binop-asg
                • Fileset
                • Obj-declor
                • Ident
                • Iconst
                • Obj-adeclor
                • Const
                • Fundef
                • Unop
                • File
                • Tag-declon
                • Fun-declor
                • Obj-declon
                • Iconst-length
                • Abstract-syntax-operations
                • Label
                • Struct-declon
                • Initer
                • Ext-declon
                • Fun-adeclor
                • Expr-option
                • Iconst-base
                • Initer-option
                • Iconst-option
                • Tyspecseq-option
                • Stmt-option
                • Scspecseq
                • Param-declon
                • Obj-declon-option
                • File-option
                • Tyname
                • Transunit
                • Fun-declon
                • Transunit-result
                • Param-declon-list
                • Struct-declon-list
                • Expr-list
                • Tyspecseq-list
                • Ident-set
                • Ident-list
                • Ext-declon-list
                • Unop-list
                • Tyname-list
                • Fundef-list
                • Fun-declon-list
                • Binop-list
                • Stmt-fixtypes
                • Expr-fixtypes
              • Integer-ranges
              • Implementation-environments
              • Dynamic-semantics
              • Static-semantics
              • Grammar
              • Integer-formats
              • Types
              • Portable-ascii-identifiers
              • Values
              • Integer-operations
              • Computation-states
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Bytes
              • Keywords
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Binop

    Binop-kind

    Get the kind (tag) of a binop structure.

    Signature
    (binop-kind x) → kind
    Arguments
    x — Guard (binopp x).

    Definitions and Theorems

    Function: binop-kind$inline

    (defun binop-kind$inline (x)
      (declare (xargs :guard (binopp x)))
      (let ((__function__ 'binop-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((or (atom x) (eq (car x) :mul)) :mul)
                          ((eq (car x) :div) :div)
                          ((eq (car x) :rem) :rem)
                          ((eq (car x) :add) :add)
                          ((eq (car x) :sub) :sub)
                          ((eq (car x) :shl) :shl)
                          ((eq (car x) :shr) :shr)
                          ((eq (car x) :lt) :lt)
                          ((eq (car x) :gt) :gt)
                          ((eq (car x) :le) :le)
                          ((eq (car x) :ge) :ge)
                          ((eq (car x) :eq) :eq)
                          ((eq (car x) :ne) :ne)
                          ((eq (car x) :bitand) :bitand)
                          ((eq (car x) :bitxor) :bitxor)
                          ((eq (car x) :bitior) :bitior)
                          ((eq (car x) :logand) :logand)
                          ((eq (car x) :logor) :logor)
                          ((eq (car x) :asg) :asg)
                          ((eq (car x) :asg-mul) :asg-mul)
                          ((eq (car x) :asg-div) :asg-div)
                          ((eq (car x) :asg-rem) :asg-rem)
                          ((eq (car x) :asg-add) :asg-add)
                          ((eq (car x) :asg-sub) :asg-sub)
                          ((eq (car x) :asg-shl) :asg-shl)
                          ((eq (car x) :asg-shr) :asg-shr)
                          ((eq (car x) :asg-and) :asg-and)
                          ((eq (car x) :asg-xor) :asg-xor)
                          (t :asg-ior))
             :exec (car x))))

    Theorem: binop-kind-possibilities

    (defthm binop-kind-possibilities
      (or (equal (binop-kind x) :mul)
          (equal (binop-kind x) :div)
          (equal (binop-kind x) :rem)
          (equal (binop-kind x) :add)
          (equal (binop-kind x) :sub)
          (equal (binop-kind x) :shl)
          (equal (binop-kind x) :shr)
          (equal (binop-kind x) :lt)
          (equal (binop-kind x) :gt)
          (equal (binop-kind x) :le)
          (equal (binop-kind x) :ge)
          (equal (binop-kind x) :eq)
          (equal (binop-kind x) :ne)
          (equal (binop-kind x) :bitand)
          (equal (binop-kind x) :bitxor)
          (equal (binop-kind x) :bitior)
          (equal (binop-kind x) :logand)
          (equal (binop-kind x) :logor)
          (equal (binop-kind x) :asg)
          (equal (binop-kind x) :asg-mul)
          (equal (binop-kind x) :asg-div)
          (equal (binop-kind x) :asg-rem)
          (equal (binop-kind x) :asg-add)
          (equal (binop-kind x) :asg-sub)
          (equal (binop-kind x) :asg-shl)
          (equal (binop-kind x) :asg-shr)
          (equal (binop-kind x) :asg-and)
          (equal (binop-kind x) :asg-xor)
          (equal (binop-kind x) :asg-ior))
      :rule-classes
      ((:forward-chaining :trigger-terms ((binop-kind x)))))