• 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
          • Math-lemmas
          • Ihs-theories
          • Ihs-init
          • Logops
            • Logops-lemmas
              • Logops-recursive-definitions-theory
              • Ihs/logbitp-lemmas
              • Ihs/logtail-lemmas
              • Ihs/loghead-lemmas
              • Ihs/logrpl-lemmas
              • Ihs/logand-lemmas
                • Ihs/logapp-lemmas
                • Ihs/logcar-lemmas
                • Ihs/integer-length-lemmas
                • Ihs/unsigned-byte-p-lemmas
                • Ihs/logcons-lemmas
                • Signed-byte-p-logops
                • Ihs/logxor-lemmas
                • Ihs/logior-lemmas
                • Ihs/logext-lemmas
                • Ihs/logextu-lemmas
                • Ihs/signed-byte-p-lemmas
                • Ihs/lognotu-lemmas
                • Ihs/lognot-lemmas
                • Ihs/logmaskp-lemmas
                • Ihs/ash-lemmas
                • Logops-lemmas-theory
                • Ihs/wrb-lemmas
                • Ihs/logite-lemmas
          • Rtl
        • Algebra
      • Testing-utilities
    • Logand
    • Logops-lemmas

    Ihs/logand-lemmas

    Lemmas about logand from the logops-lemmas book.

    Definitions and Theorems

    Theorem: commutativity-of-logand

    (defthm commutativity-of-logand
      (equal (logand i j) (logand j i)))

    Theorem: simplify-logand

    (defthm simplify-logand
      (and (equal (logand 0 i) 0)
           (equal (logand -1 i) (ifix i))))

    Theorem: logand-=-minus-1

    (defthm logand-=-minus-1
      (equal (equal (logand i j) -1)
             (and (equal i -1) (equal j -1))))

    Theorem: unsigned-byte-p-logand

    (defthm unsigned-byte-p-logand
      (implies (and (or (unsigned-byte-p size i)
                        (unsigned-byte-p size j))
                    (force (integerp i))
                    (force (integerp j)))
               (unsigned-byte-p size (logand i j))))

    Theorem: logand-upper-bound

    (defthm logand-upper-bound
      (implies (and (>= i 0) (integerp j))
               (<= (logand i j) i))
      :rule-classes
      ((:linear :corollary (implies (and (>= i 0) (integerp j))
                                    (<= (logand i j) i)))
       (:linear :corollary (implies (and (>= i 0) (integerp j))
                                    (<= (logand j i) i)))))

    Theorem: logand-logior

    (defthm logand-logior
      (implies (and (integerp x)
                    (integerp y)
                    (integerp z))
               (equal (logand x (logior y z))
                      (logior (logand x y) (logand x z)))))

    Theorem: logand-logxor

    (defthm logand-logxor
      (implies (and (force (integerp i))
                    (force (integerp j))
                    (force (integerp k)))
               (equal (logand i (logxor j k))
                      (logxor (logand i j) (logand i k)))))