• 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
            • Logops-byte-functions
            • Defword
            • Defbytetype
            • Logext
            • Logrev
            • Loghead
            • 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
              • Logtail
              • Logapp
              • Logsat
              • Binary--
              • Logcdr
              • Logcar
              • Logbit
              • Logextu
              • Logcons
              • Lshu
              • Logrpl
              • Ashu
              • Logmaskp
              • Lognotu
              • Logmask
              • Imod
              • Ifloor
              • Bfix
              • Bitmaskp
              • Logite
              • Expt2
              • Zbp
              • *logops-functions*
              • Word/bit-macros
              • Logops-definitions-theory
              • Logops-functions
              • Lbfix
              • Logextu-guard
              • Lshu-guard
              • Logtail-guard
              • Logrpl-guard
              • Logrev-guard
              • Lognotu-guard
              • Logmask-guard
              • Loghead-guard
              • Logext-guard
              • Logbit-guard
              • Logapp-guard
              • Ashu-guard
            • Math-lemmas
            • Ihs-theories
            • Ihs-init
            • Logops
          • Rtl
        • Algebra
      • Testing-utilities
    • Logops-bit-functions

    B-ite

    If-then-else for bitps.

    Signature
    (b-ite test then else) → bit
    Arguments
    test — Guard (bitp test).
    then — Guard (bitp then).
    else — Guard (bitp else).
    Returns
    bit — Type (bitp bit).

    Definitions and Theorems

    Function: b-ite$inline

    (defun b-ite$inline (test then else)
      (declare (xargs :guard (and (bitp test)
                                  (bitp then)
                                  (bitp else))))
      (let ((__function__ 'b-ite))
        (declare (ignorable __function__))
        (if (zbp test)
            (bfix else)
          (bfix then))))

    Theorem: bitp-of-b-ite

    (defthm bitp-of-b-ite
      (b* ((bit (b-ite$inline test then else)))
        (bitp bit))
      :rule-classes :type-prescription)