• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
      • 100-theorems
      • Arithmetic
      • Bit-vectors
        • Sparseint
          • Sparseint-impl
          • Sparseint-p
          • Sparseint-binary-bittest
          • Sparseint-concatenate
          • Sparseint-binary-bitop
            • Sparseint-bitite
            • Sparseint-fix
            • Sparseint$-binary-minus
            • Sparseint-trailing-1-count-from
            • Sparseint-trailing-0-count-from
            • Sparseint-equal
            • Sparseint-test-bitorc2
            • Sparseint-test-bitorc1
            • Sparseint-test-bitnand
            • Sparseint-test-bitandc2
            • Sparseint-test-bitandc1
            • Sparseint-test-bitand
            • Sparseint-rightshift
            • Sparseint-bitcount-from
            • Sparseint-test-bitxor
            • Sparseint-test-bitor
            • Sparseint-test-bitnor
            • Sparseint-test-biteqv
            • Sparseint-compare
            • Sparseint-binary-minus
            • Sparseint-sign-ext
            • Sparseint-plus
            • Sparseint-bitandc2
            • Sparseint-bitandc1
            • Sparseint-bitand
            • Sparseint$-leaf-bitlimit
            • Sparseint-bitxor
            • Sparseint-bitorc2
            • Sparseint-bitorc1
            • Sparseint-bitor
            • Sparseint-bitnor
            • Sparseint-bitnand
            • Sparseint-biteqv
            • Sparseint-ash
            • Sparseint-<
            • Sparseint-bit
            • Sparseint-trailing-1-count
            • Sparseint-trailing-0-count
            • Sparseint-unary-minus
            • Sparseint-length
            • Sparseint-bitnot
            • Sparseint-bitcount
            • Int-to-sparseint
            • Sparseint-val
          • Bitops
          • Bv
          • Ihs
          • Rtl
        • Algebra
      • Testing-utilities
    • Sparseint

    Sparseint-binary-bitop

    Apply a binary bitwise operation (represented as a 4-bit truth table) to two sparseints.

    Signature
    (sparseint-binary-bitop op x y) → binary-res
    Arguments
    op — Guard (integerp op).
    x — Guard (sparseint-p x).
    y — Guard (sparseint-p y).
    Returns
    binary-res — Type (sparseint-p binary-res).

    Definitions and Theorems

    Function: sparseint-binary-bitop$inline

    (defun sparseint-binary-bitop$inline (op x y)
      (declare (type (unsigned-byte 4) op))
      (declare (xargs :guard (and (integerp op)
                                  (sparseint-p x)
                                  (sparseint-p y))))
      (let ((__function__ 'sparseint-binary-bitop))
        (declare (ignorable __function__))
        (sparseint$-binary-bitop op (sparseint-fix x)
                                 (sparseint-fix y))))

    Theorem: sparseint-p-of-sparseint-binary-bitop

    (defthm sparseint-p-of-sparseint-binary-bitop
      (b* ((binary-res (sparseint-binary-bitop$inline op x y)))
        (sparseint-p binary-res))
      :rule-classes :rewrite)

    Theorem: sparseint-val-of-sparseint-binary-bitop

    (defthm sparseint-val-of-sparseint-binary-bitop
      (b* ((?binary-res (sparseint-binary-bitop$inline op x y)))
        (equal (sparseint-val binary-res)
               (binary-bitop op (sparseint-val x)
                             (sparseint-val y)))))

    Theorem: sparseint-binary-bitop$inline-of-ifix-op

    (defthm sparseint-binary-bitop$inline-of-ifix-op
      (equal (sparseint-binary-bitop$inline (ifix op)
                                            x y)
             (sparseint-binary-bitop$inline op x y)))

    Theorem: sparseint-binary-bitop$inline-int-equiv-congruence-on-op

    (defthm sparseint-binary-bitop$inline-int-equiv-congruence-on-op
      (implies (int-equiv op op-equiv)
               (equal (sparseint-binary-bitop$inline op x y)
                      (sparseint-binary-bitop$inline op-equiv x y)))
      :rule-classes :congruence)

    Theorem: sparseint-binary-bitop$inline-of-sparseint-fix-x

    (defthm sparseint-binary-bitop$inline-of-sparseint-fix-x
      (equal (sparseint-binary-bitop$inline op (sparseint-fix x)
                                            y)
             (sparseint-binary-bitop$inline op x y)))

    Theorem: sparseint-binary-bitop$inline-sparseint-equiv-congruence-on-x

    (defthm
          sparseint-binary-bitop$inline-sparseint-equiv-congruence-on-x
      (implies (sparseint-equiv x x-equiv)
               (equal (sparseint-binary-bitop$inline op x y)
                      (sparseint-binary-bitop$inline op x-equiv y)))
      :rule-classes :congruence)

    Theorem: sparseint-binary-bitop$inline-of-sparseint-fix-y

    (defthm sparseint-binary-bitop$inline-of-sparseint-fix-y
      (equal (sparseint-binary-bitop$inline op x (sparseint-fix y))
             (sparseint-binary-bitop$inline op x y)))

    Theorem: sparseint-binary-bitop$inline-sparseint-equiv-congruence-on-y

    (defthm
          sparseint-binary-bitop$inline-sparseint-equiv-congruence-on-y
      (implies (sparseint-equiv y y-equiv)
               (equal (sparseint-binary-bitop$inline op x y)
                      (sparseint-binary-bitop$inline op x y-equiv)))
      :rule-classes :congruence)