• 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-bitand

    Bitwise logical AND of 3vecs.

    Signature
    (3vec-bitand 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-bitand

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

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

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

    Theorem: 3vec-p-of-3vec-bitand

    (defthm 3vec-p-of-3vec-bitand
      (b* ((?x&y (3vec-bitand x y)))
        (implies (and (3vec-p x) (3vec-p y))
                 (3vec-p x&y))))

    Theorem: 3vec-bitand-bits

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

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

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

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

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

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

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

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

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