• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
        • Charset-p
        • Strtok!
        • Cases
        • Concatenation
        • Character-kinds
        • Html-encoding
        • Substrings
        • Strtok
        • Equivalences
        • Url-encoding
        • Lines
        • Explode-implode-equalities
        • Ordering
        • Numbers
          • Decimal
          • Hex
            • Parse-hex-from-string
            • Hex-digit-char-p
            • 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

    Nonzero-hex-digit-char-p

    Recognizer for non-zero hexadecimal digit characters: 1-9, A-F, a-f.

    Signature
    (nonzero-hex-digit-char-p x) → bool

    Definitions and Theorems

    Function: nonzero-hex-digit-char-p$inline

    (defun nonzero-hex-digit-char-p$inline (x)
      (declare (xargs :guard t))
      (let ((acl2::__function__ 'nonzero-hex-digit-char-p))
        (declare (ignorable acl2::__function__))
        (mbe :logic
             (let ((code (char-code (char-fix x))))
               (or (and (<= (char-code #\1) code)
                        (<= code (char-code #\9)))
                   (and (<= (char-code #\a) code)
                        (<= code (char-code #\f)))
                   (and (<= (char-code #\A) code)
                        (<= code (char-code #\F)))))
             :exec (and (characterp x)
                        (b* (((the (unsigned-byte 8) code)
                              (char-code (the character x))))
                          (if (<= code 70)
                              (if (<= code 57)
                                  (<= 49 code)
                                (<= 65 code))
                            (and (<= code 102) (<= 97 code))))))))

    Theorem: ichareqv-implies-equal-nonzero-hex-digit-char-p-1

    (defthm ichareqv-implies-equal-nonzero-hex-digit-char-p-1
      (implies (ichareqv x x-equiv)
               (equal (nonzero-hex-digit-char-p x)
                      (nonzero-hex-digit-char-p x-equiv)))
      :rule-classes (:congruence))

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

    (defthm hex-digit-char-p-when-nonzero-hex-digit-char-p
      (implies (nonzero-hex-digit-char-p x)
               (hex-digit-char-p x)))