• 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
          • Bitops/merge
          • Bitops-compatibility
          • Bitops-books
          • Logbitp-reasoning
          • Bitops/signed-byte-p
          • Fast-part-select
          • Bitops/integer-length
          • Bitops/extra-defs
            • Abs-diff
            • Nth-slice512
            • Nth-slice128
            • Nth-slice8
            • Nth-slice64
            • Nth-slice4
            • Nth-slice32
            • Nth-slice256
            • Nth-slice2
            • Nth-slice16
            • Negate-slice8
            • Copybit
            • Negate-slice32
            • Negate-slice16
            • Negate-slice64
            • Bitscan-rev
            • Bitscan-fwd
            • Setbit
            • Notbit
              • Clearbit
            • Install-bit
            • Trailing-0-count
            • Bitops/defaults
            • Logbitp-mismatch
            • Trailing-1-count
            • Bitops/rotate
            • Bitops/equal-by-logbitp
            • Bitops/ash-bounds
            • Bitops/fast-logrev
            • Limited-shifts
            • Bitops/part-select
            • Bitops/parity
            • Bitops/saturate
            • Bitops/part-install
            • Bitops/logbitp-bounds
            • Bitops/ihsext-basics
            • Bitops/fast-rotate
            • Bitops/fast-logext
            • Bitops/ihs-extensions
          • Bv
          • Ihs
          • Rtl
        • Algebra
      • Testing-utilities
    • Bitops/extra-defs

    Notbit

    Set X[n] := ~X[n]

    Signature
    (notbit n x) → ans
    Arguments
    n — Bit position to negate.
        Guard (natp n).
    x — Starting value.
        Guard (integerp x).
    Returns
    ans — Type (integerp ans).

    Definitions and Theorems

    Function: notbit

    (defun notbit (n x)
      (declare (xargs :guard (and (natp n) (integerp x))))
      (let ((__function__ 'notbit))
        (declare (ignorable __function__))
        (if (logbitp n x)
            (clearbit n x)
          (setbit n x))))

    Theorem: integerp-of-notbit

    (defthm acl2::integerp-of-notbit
      (b* ((ans (notbit n x))) (integerp ans))
      :rule-classes :type-prescription)

    Theorem: nat-equiv-implies-equal-notbit-1

    (defthm nat-equiv-implies-equal-notbit-1
      (implies (nat-equiv n n-equiv)
               (equal (notbit n x) (notbit n-equiv x)))
      :rule-classes (:congruence))

    Theorem: int-equiv-implies-equal-notbit-2

    (defthm int-equiv-implies-equal-notbit-2
      (implies (int-equiv x x-equiv)
               (equal (notbit n x) (notbit n x-equiv)))
      :rule-classes (:congruence))