• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Deffixequiv
        • Defresult
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
        • Fty-extensions
        • Defsubtype
        • Defset
        • Deftypes
        • Specific-types
        • Defflatsum
        • Deflist-of-len
        • Defbytelist
        • Fty::basetypes
          • Any-p
          • Symbol-fix
          • Maybe-integerp-fix
          • Maybe-integer-equiv
          • Maybe-posp-fix
          • Maybe-natp-fix
          • Maybe-bit-fix
          • Bool-fix
          • Maybe-pos-equiv
          • Maybe-nat-equiv
          • Maybe-bit-equiv
          • Maybe-lit-fix
            • Symbol-equiv
            • True-equiv
            • Pos-equiv
            • Lposfix
            • True-p
            • True-fix
          • Defomap
          • Defvisitors
          • Deffixtype-alias
          • Deffixequiv-sk
          • Defunit
          • Multicase
          • Deffixequiv-mutual
          • Fty::baselists
          • Def-enumcase
          • Defmap
        • Apt
        • Std/util
        • 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
      • Math
      • Testing-utilities
    • Fty::basetypes
    • Maybe-litp

    Maybe-lit-fix

    (maybe-lit-fix x) is the identity for maybe-litps, or coerces any non-litp 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-lit-fix$inline

    (defun maybe-lit-fix$inline (x)
      (declare (xargs :guard (maybe-litp x)))
      (mbe :logic (if x (lit-fix x) nil)
           :exec x))

    Theorem: maybe-litp-of-maybe-lit-fix

    (defthm maybe-litp-of-maybe-lit-fix
      (maybe-litp (maybe-lit-fix x))
      :rule-classes (:rewrite :type-prescription))

    Theorem: maybe-lit-fix-when-maybe-litp

    (defthm maybe-lit-fix-when-maybe-litp
      (implies (maybe-litp x)
               (equal (maybe-lit-fix x) x)))

    Theorem: maybe-lit-fix-under-iff

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

    Theorem: maybe-lit-fix-under-lit-equiv

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