• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
          • Df
          • Unsigned-byte-p
          • Posp
          • Natp
          • <
          • +
          • Bitp
            • Bit-listp
            • Logops-bit-functions
              • Simplify-bit-functions
                • B-eqv
                • B-orc2
                • B-orc1
                • B-nor
                • B-nand
                • B-ite
                • B-ior
                • B-andc2
                • B-andc1
                • B-and
                • B-xor
                • B-not
              • Bits-as-digits-in-base-2
              • Maybe-bitp
              • Bfix
              • Zbp
              • Lbfix
              • Bitp-basics
            • Zero-test-idioms
            • Nat-listp
            • Integerp
            • *
            • -
            • Zp
            • Signed-byte-p
            • Logbitp
            • Sharp-f-reader
            • Expt
            • <=
            • Ash
            • Rationalp
            • =
            • Nfix
            • Logand
            • Floor
            • Random$
            • Integer-listp
            • Complex
            • Numbers-introduction
            • Truncate
            • Code-char
            • Char-code
            • Integer-length
            • Zip
            • Logior
            • Sharp-u-reader
            • Mod
            • Unary--
            • Boole$
            • /
            • Logxor
            • Ifix
            • Lognot
            • Integer-range-p
            • Allocate-fixnum-range
            • ACL2-numberp
            • Sharp-d-reader
            • Mod-expt
            • Ceiling
            • Round
            • Logeqv
            • Fix
            • Explode-nonnegative-integer
            • Max
            • Evenp
            • Zerop
            • Abs
            • Nonnegative-integer-quotient
            • Rfix
            • 1+
            • Pos-listp
            • Signum
            • Rem
            • Real/rationalp
            • Rational-listp
            • >=
            • >
            • Logcount
            • ACL2-number-listp
            • /=
            • Unary-/
            • Realfix
            • Complex/complex-rationalp
            • Logtest
            • Logandc1
            • Logorc1
            • Logandc2
            • Denominator
            • 1-
            • Numerator
            • Logorc2
            • The-number
            • Int=
            • Complex-rationalp
            • Min
            • Lognor
            • Zpf
            • Oddp
            • Minusp
            • Lognand
            • Imagpart
            • Conjugate
            • Realpart
            • Plusp
          • Efficiency
          • Irrelevant-formals
          • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
          • Redefining-programs
          • Lists
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Logops-bit-functions

    Simplify-bit-functions

    Rewrite: Simplification rules for all binary b- functions including commutative rules, reductions with 1 explicit value, and reductions for identical agruments and complemented arguments.

    Definitions and Theorems

    Theorem: simplify-bit-functions

    (defthm simplify-bit-functions
      (and (equal (b-and x y) (b-and y x))
           (equal (b-and 0 x) 0)
           (equal (b-and 1 x) (bfix x))
           (equal (b-and x x) (bfix x))
           (equal (b-and x (b-not x)) 0)
           (equal (b-ior x y) (b-ior y x))
           (equal (b-ior 0 x) (bfix x))
           (equal (b-ior 1 x) 1)
           (equal (b-ior x x) (bfix x))
           (equal (b-ior x (b-not x)) 1)
           (equal (b-xor x y) (b-xor y x))
           (equal (b-xor 0 x) (bfix x))
           (equal (b-xor 1 x) (b-not x))
           (equal (b-xor x x) 0)
           (equal (b-xor x (b-not x)) 1)
           (equal (b-eqv x y) (b-eqv y x))
           (equal (b-eqv 0 x) (b-not x))
           (equal (b-eqv 1 x) (bfix x))
           (equal (b-eqv x x) 1)
           (equal (b-eqv x (b-not x)) 0)
           (equal (b-nand x y) (b-nand y x))
           (equal (b-nand 0 x) 1)
           (equal (b-nand 1 x) (b-not x))
           (equal (b-nand x x) (b-not x))
           (equal (b-nand x (b-not x)) 1)
           (equal (b-nor x y) (b-nor y x))
           (equal (b-nor 0 x) (b-not x))
           (equal (b-nor 1 x) 0)
           (equal (b-nor x x) (b-not x))
           (equal (b-nor x (b-not x)) 0)
           (equal (b-andc1 0 x) (bfix x))
           (equal (b-andc1 x 0) 0)
           (equal (b-andc1 1 x) 0)
           (equal (b-andc1 x 1) (b-not x))
           (equal (b-andc1 x x) 0)
           (equal (b-andc1 x (b-not x)) (b-not x))
           (equal (b-andc1 (b-not x) x) (bfix x))
           (equal (b-andc2 0 x) 0)
           (equal (b-andc2 x 0) (bfix x))
           (equal (b-andc2 1 x) (b-not x))
           (equal (b-andc2 x 1) 0)
           (equal (b-andc2 x x) 0)
           (equal (b-andc2 x (b-not x)) (bfix x))
           (equal (b-andc2 (b-not x) x) (b-not x))
           (equal (b-orc1 0 x) 1)
           (equal (b-orc1 x 0) (b-not x))
           (equal (b-orc1 1 x) (bfix x))
           (equal (b-orc1 x 1) 1)
           (equal (b-orc1 x x) 1)
           (equal (b-orc1 x (b-not x)) (b-not x))
           (equal (b-orc1 (b-not x) x) (bfix x))
           (equal (b-orc2 0 x) (b-not x))
           (equal (b-orc2 x 0) 1)
           (equal (b-orc2 1 x) 1)
           (equal (b-orc2 x 1) (bfix x))
           (equal (b-orc2 x x) 1)
           (equal (b-orc2 x (b-not x)) (bfix x))
           (equal (b-orc2 (b-not x) x) (b-not x))
           (equal (b-ite 1 then else) (bfix then))
           (equal (b-ite 0 then else) (bfix else))
           (equal (b-ite test 1 0) (bfix test))
           (equal (b-ite test 0 1) (b-not test))
           (equal (b-ite test then then)
                  (bfix then))
           (equal (b-ite test then 0)
                  (b-and test then))
           (equal (b-ite test then 1)
                  (b-ior (b-not test) then))
           (equal (b-ite test then test)
                  (b-and test then))
           (equal (b-ite test 1 else)
                  (b-ior test else))
           (equal (b-ite test 0 else)
                  (b-and (b-not test) else))
           (equal (b-ite test test else)
                  (b-ior test else))))