• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
      • Solidity
        • Values
          • Integer-values
            • Integer-operations
              • Def-uint/int-binary-op
              • Def-uint/int-unary-op
              • Def-uint/int-comparison
              • Uint-mod
              • Uint-div
              • Uint-shr
              • Uint-shl
              • Int-mod
              • Int-div
              • Uint-xor
              • Uint-sub
              • Uint-mul
              • Uint-ior
              • Uint-exp
              • Uint-and
              • Uint-add
              • Int-xor
              • Int-sub
              • Int-mul
              • Int-ior
              • Int-and
                • Int-add
                • Uint-le
                • Uint-ge
                • Uint-ne
                • Uint-lt
                • Uint-gt
                • Uint-eq
                • Int-ne
                • Int-lt
                • Int-le
                • Int-gt
                • Int-ge
                • Int-eq
                • Uint-minus
                • Uint-not
                • Int-not
                • Int-minus
              • Bit-size
              • Uint
              • Int
            • Boolean-values
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Integer-operations

    Int-and

    Bitwise conjunction of signed integer values.

    Signature
    (int-and left-operand right-operand) → result
    Arguments
    left-operand — Guard (intp left-operand).
    right-operand — Guard (intp right-operand).
    Returns
    result — Type (intp result).

    Definitions and Theorems

    Function: int-and

    (defun int-and (left-operand right-operand)
      (declare (xargs :guard (and (intp left-operand)
                                  (intp right-operand))))
      (b* ((size (int->size left-operand))
           (x (int->value left-operand))
           (y (int->value right-operand)))
        (make-int :size (int->size left-operand)
                  :value (logext size (logand x y)))))

    Theorem: intp-of-int-and

    (defthm intp-of-int-and
      (b* ((result (int-and left-operand right-operand)))
        (intp result))
      :rule-classes :rewrite)

    Theorem: int-and-of-int-fix-left-operand

    (defthm int-and-of-int-fix-left-operand
      (equal (int-and (int-fix left-operand)
                      right-operand)
             (int-and left-operand right-operand)))

    Theorem: int-and-int-equiv-congruence-on-left-operand

    (defthm int-and-int-equiv-congruence-on-left-operand
      (implies (int-equiv left-operand left-operand-equiv)
               (equal (int-and left-operand right-operand)
                      (int-and left-operand-equiv right-operand)))
      :rule-classes :congruence)

    Theorem: int-and-of-int-fix-right-operand

    (defthm int-and-of-int-fix-right-operand
      (equal (int-and left-operand (int-fix right-operand))
             (int-and left-operand right-operand)))

    Theorem: int-and-int-equiv-congruence-on-right-operand

    (defthm int-and-int-equiv-congruence-on-right-operand
      (implies (int-equiv right-operand right-operand-equiv)
               (equal (int-and left-operand right-operand)
                      (int-and left-operand right-operand-equiv)))
      :rule-classes :congruence)