• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
        • Maybe-stringp
        • Maybe-natp
        • Two-nats-measure
        • Impossible
        • Bytep
        • Nat-list-measure
        • Maybe-posp
        • Nibblep
          • Nibble
            • Nibble-list
            • Nibble-fix
              • Nibblep-additional-theorems
            • Nibblep-additional-theorems
          • Organize-symbols-by-pkg
          • Organize-symbols-by-name
          • Lnfix
          • Good-valuep
          • Streqv
          • Chareqv
          • Symbol-package-name-non-cl
          • Arith-equivs
          • Induction-schemes
          • Maybe-integerp
          • Char-fix
          • Pos-fix
          • Symbol-package-name-lst
          • Mbt$
          • Maybe-bitp
          • Good-pseudo-termp
          • Str-fix
          • Maybe-string-fix
          • Nonkeyword-listp
          • Lifix
          • Bfix
          • Std/basic/if*
          • Impliez
          • Tuplep
          • Std/basic/intern-in-package-of-symbol
          • Lbfix
          • Std/basic/symbol-name-lst
          • True
          • Std/basic/rfix
          • Std/basic/realfix
          • Std/basic/member-symbol-name
          • Std/basic/fix
          • False
          • Std/basic/nfix
          • Std/basic/ifix
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Nibble

    Nibble-fix

    Fixer for nibble.

    Signature
    (nibble-fix x) → fixed-x
    Arguments
    x — Guard (nibblep x).
    Returns
    fixed-x — Type (nibblep fixed-x).

    Definitions and Theorems

    Function: nibble-fix

    (defun nibble-fix (x)
      (declare (xargs :guard (nibblep x)))
      (mbe :logic (if (nibblep x) x 0)
           :exec x))

    Theorem: nibblep-of-nibble-fix

    (defthm nibblep-of-nibble-fix
      (b* ((fixed-x (nibble-fix x)))
        (nibblep fixed-x))
      :rule-classes :rewrite)

    Theorem: nibble-fix-when-nibblep

    (defthm nibble-fix-when-nibblep
      (implies (nibblep x)
               (equal (nibble-fix x) x)))