• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
          • Functions
            • 4vec-operations
            • 3vec-operations
              • 3vec-bit?
              • 3vec-?*
              • 3vec-?
              • 3vec-reduction-or
              • 3vec-reduction-and
              • 3vec-==
              • 3vec-bitxor
                • 3vec-bitor
                • 3vec-bitand
                • 3vec-bitnot
              • *svex-op-table*
            • 4vmask
            • Why-infinite-width
            • Svex-vars
            • Evaluation
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • 3vec-operations

    3vec-bitxor

    Bitwise logical XOR of 3vecs.

    Signature
    (3vec-bitxor x y) → x^y
    Arguments
    x — Guard (4vec-p x).
    y — Guard (4vec-p y).
    Returns
    x^y — Type (4vec-p x^y).

    Definitions and Theorems

    Function: 3vec-bitxor

    (defun 3vec-bitxor (x y)
      (declare (xargs :guard (and (4vec-p x) (4vec-p y))))
      (let ((__function__ '3vec-bitxor))
        (declare (ignorable __function__))
        (if-2vec-p
             (x y)
             (2vec (logxor (2vec->val x) (2vec->val y)))
             (b* (((4vec x))
                  ((4vec y))
                  (xmask (logior (logand x.upper (lognot x.lower))
                                 (logand y.upper (lognot y.lower)))))
               (4vec (logior xmask (logxor x.upper y.upper))
                     (logand (lognot xmask)
                             (logxor x.lower y.lower)))))))

    Theorem: 4vec-p-of-3vec-bitxor

    (defthm 4vec-p-of-3vec-bitxor
      (b* ((x^y (3vec-bitxor x y)))
        (4vec-p x^y))
      :rule-classes :rewrite)

    Theorem: 3vec-p-of-3vec-bitxor

    (defthm 3vec-p-of-3vec-bitxor
      (b* ((?x^y (3vec-bitxor x y)))
        (implies (and (3vec-p x) (3vec-p y))
                 (3vec-p x^y))))

    Theorem: 3vec-bitxor-bits

    (defthm 3vec-bitxor-bits
      (implies (and (3vec-p! x) (3vec-p! y))
               (equal (4vec-idx->4v n (3vec-bitxor x y))
                      (acl2::4v-xor (4vec-idx->4v n (3vec-fix x))
                                    (4vec-idx->4v n (3vec-fix y))))))

    Theorem: 3vec-bitxor-of-4vec-fix-x

    (defthm 3vec-bitxor-of-4vec-fix-x
      (equal (3vec-bitxor (4vec-fix x) y)
             (3vec-bitxor x y)))

    Theorem: 3vec-bitxor-4vec-equiv-congruence-on-x

    (defthm 3vec-bitxor-4vec-equiv-congruence-on-x
      (implies (4vec-equiv x x-equiv)
               (equal (3vec-bitxor x y)
                      (3vec-bitxor x-equiv y)))
      :rule-classes :congruence)

    Theorem: 3vec-bitxor-of-4vec-fix-y

    (defthm 3vec-bitxor-of-4vec-fix-y
      (equal (3vec-bitxor x (4vec-fix y))
             (3vec-bitxor x y)))

    Theorem: 3vec-bitxor-4vec-equiv-congruence-on-y

    (defthm 3vec-bitxor-4vec-equiv-congruence-on-y
      (implies (4vec-equiv y y-equiv)
               (equal (3vec-bitxor x y)
                      (3vec-bitxor x y-equiv)))
      :rule-classes :congruence)