• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
            • Nat-to-hex-chars
              • Basic-nat-to-hex-chars
              • Nat-to-hex-chars-aux
              • 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
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Nat-to-hex-chars

    Nat-to-hex-chars-aux

    Signature
    (nat-to-hex-chars-aux n acc) → *
    Arguments
    n — Guard (natp n).

    Definitions and Theorems

    Function: nat-to-hex-chars-aux

    (defun nat-to-hex-chars-aux (n acc)
     (declare (xargs :guard (natp n)))
     (let ((acl2::__function__ 'nat-to-hex-chars-aux))
      (declare (ignorable acl2::__function__))
      (mbe
       :logic
       (revappend (basic-nat-to-hex-chars n)
                  acc)
       :exec
       (if (zp n)
           acc
        (nat-to-hex-chars-aux
         (the unsigned-byte
              (ash (the unsigned-byte n) -4))
         (cons
             (hex-digit-to-char (the (unsigned-byte 4)
                                     (logand (the unsigned-byte n) 15)))
             acc))))))