• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
        • Charset-p
        • Strtok!
        • Cases
        • Concatenation
        • Html-encoding
        • Character-kinds
        • Substrings
        • Strtok
        • Equivalences
        • Url-encoding
        • Lines
        • Explode-implode-equalities
        • Ordering
        • Numbers
          • Decimal
          • Hex
            • Parse-hex-from-string
            • Hex-digit-char-p
              • Hex-digit-char
                • Hex-digit-char-fix
                  • Hex-digit-char-list
              • Nat-to-hex-chars
              • Parse-hex-from-charlist
              • Hex-digit-chars-value
              • Hex-digit-char-value
              • Take-leading-hex-digit-chars
              • Hexify
              • Hex-digit-char-listp
              • Hex-digit-char-list*p
              • Hex-digit-string-p
              • Strval16
              • Skip-leading-hex-digits
              • Nat-to-hex-string
              • Hexify-width
              • Nonzero-hex-digit-char-p
              • Nat-to-hex-string-list
              • Revappend-nat-to-hex-chars
              • Hex-digit-to-char
              • Nat-to-hex-string-size
            • Octal
            • Binary
          • Pad-trim
          • Coercion
          • Std/strings/digit-to-char
          • Substitution
          • Symbols
        • Std/osets
        • Std/io
        • Std/basic
        • 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
    • Hex-digit-char

    Hex-digit-char-fix

    Fixer for hex-digit-char.

    Signature
    (hex-digit-char-fix x) → fixed-x
    Arguments
    x — Guard (hex-digit-char-p x).
    Returns
    fixed-x — Type (hex-digit-char-p fixed-x).

    Definitions and Theorems

    Function: hex-digit-char-fix

    (defun hex-digit-char-fix (x)
      (declare (xargs :guard (hex-digit-char-p x)))
      (mbe :logic (if (hex-digit-char-p x) x #\0)
           :exec x))

    Theorem: hex-digit-char-p-of-hex-digit-char-fix

    (defthm hex-digit-char-p-of-hex-digit-char-fix
      (b* ((fixed-x (hex-digit-char-fix x)))
        (hex-digit-char-p fixed-x))
      :rule-classes :rewrite)

    Theorem: hex-digit-char-fix-when-hex-digit-char-p

    (defthm hex-digit-char-fix-when-hex-digit-char-p
      (implies (hex-digit-char-p x)
               (equal (hex-digit-char-fix x) x)))