• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Defresult
        • Deffixtype
        • Deffixequiv
        • Fty-discipline
        • Defoption
        • Fty-extensions
        • Defsubtype
        • Deftypes
        • Defflatsum
        • Deflist-of-len
        • Defbytelist
        • Defset
        • Fty::basetypes
          • Any-p
          • Symbol-fix
          • Maybe-integerp-fix
          • Maybe-natp-fix
          • Maybe-integer-equiv
          • Maybe-posp-fix
          • Maybe-pos-equiv
          • Maybe-nat-equiv
          • Maybe-bit-fix
            • Maybe-bit-equiv
            • Bool-fix
            • Symbol-equiv
            • Maybe-lit-fix
            • True-equiv
            • Pos-equiv
            • Lposfix
            • True-p
            • True-fix
          • Specific-types
          • Defvisitors
          • Deffixtype-alias
          • Defomap
          • Deffixequiv-sk
          • Defunit
          • Deffixequiv-mutual
          • Fty::baselists
          • Defmap
        • Std/util
        • Apt
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Fty::basetypes
    • Maybe-bitp

    Maybe-bit-fix

    (maybe-bit-fix x) is the identity for maybe-bitps, or coerces any non-bitp to nil.

    Performance note. In the execution this is just an inlined identity function, i.e., it should have zero runtime cost.

    Definitions and Theorems

    Function: maybe-bit-fix$inline

    (defun maybe-bit-fix$inline (x)
           (declare (xargs :guard (maybe-bitp x)))
           (mbe :logic (if x (bfix x) nil)
                :exec x))

    Theorem: maybe-bitp-of-maybe-bit-fix

    (defthm maybe-bitp-of-maybe-bit-fix
            (maybe-bitp (maybe-bit-fix x))
            :rule-classes (:rewrite :type-prescription))

    Theorem: maybe-bit-fix-when-maybe-bitp

    (defthm maybe-bit-fix-when-maybe-bitp
            (implies (maybe-bitp x)
                     (equal (maybe-bit-fix x) x)))

    Theorem: maybe-bit-fix-under-iff

    (defthm maybe-bit-fix-under-iff
            (iff (maybe-bit-fix x) x))

    Theorem: maybe-bit-fix-under-bit-equiv

    (defthm maybe-bit-fix-under-bit-equiv
            (bit-equiv (maybe-bit-fix x) x))