• 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
        • Bitops
        • Bv
        • Ihs
          • Logops-definitions
            • Logops-byte-functions
            • Defword
            • Defbytetype
            • Logext
            • Logrev
            • Loghead
            • Logops-bit-functions
              • Simplify-bit-functions
              • B-eqv
              • B-orc2
              • B-orc1
              • B-nor
              • B-nand
              • B-ite
              • B-ior
              • B-andc2
              • B-andc1
              • B-and
              • B-xor
                • B-not
              • Logtail
              • Logapp
              • Logsat
              • Binary--
              • Logcdr
              • Logcar
              • Logbit
              • Logextu
              • Logcons
              • Lshu
              • Logrpl
              • Ashu
              • Logmaskp
              • Lognotu
              • Logmask
              • Imod
              • Ifloor
              • Bfix
              • Bitmaskp
              • Logite
              • Expt2
              • Zbp
              • *logops-functions*
              • Word/bit-macros
              • Logops-definitions-theory
              • Logops-functions
              • Lbfix
              • Logextu-guard
              • Lshu-guard
              • Logtail-guard
              • Logrpl-guard
              • Logrev-guard
              • Lognotu-guard
              • Logmask-guard
              • Loghead-guard
              • Logext-guard
              • Logbit-guard
              • Logapp-guard
              • Ashu-guard
            • Math-lemmas
            • Ihs-theories
            • Ihs-init
            • Logops
          • Rtl
        • Algebra
      • Testing-utilities
    • Logops-bit-functions

    B-xor

    Exclusive or for bitps.

    Signature
    (b-xor i j) → bit
    Arguments
    i — Guard (bitp i).
    j — Guard (bitp j).
    Returns
    bit — Type (bitp bit).

    Definitions and Theorems

    Function: b-xor$inline

    (defun b-xor$inline (i j)
      (declare (xargs :guard (and (bitp i) (bitp j))))
      (let ((__function__ 'b-xor))
        (declare (ignorable __function__))
        (mbe :logic
             (if (zbp i)
                 (if (zbp j) 0 1)
               (if (zbp j) 1 0))
             :exec (the (unsigned-byte 1)
                        (logxor (the (unsigned-byte 1) i)
                                (the (unsigned-byte 1) j))))))

    Theorem: bitp-of-b-xor

    (defthm bitp-of-b-xor
      (b* ((bit (b-xor$inline i j)))
        (bitp bit))
      :rule-classes :type-prescription)