• 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
          • Octal
          • Binary
            • Parse-bits-from-string
            • Parse-bits-from-charlist
            • Nat-to-bin-chars
            • Bin-digit-chars-value
            • Take-leading-bin-digit-chars
            • Bin-digit-char-listp
            • Skip-leading-bit-digits
            • Bin-digit-char-list*p
            • Bin-digit-string-p
            • Bin-digit-char-value
            • Strval2
            • Nat-to-bin-string
            • Bin-digit-char-p
            • Nat-to-bin-string-list
            • Nat-to-bin-string-size
            • Revappend-nat-to-bin-chars
              • Revappend-nat-to-bin-chars-aux
              • Binify-width
              • Binify
          • 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
    • Revappend-nat-to-bin-chars

    Revappend-nat-to-bin-chars-aux

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

    Definitions and Theorems

    Function: revappend-nat-to-bin-chars-aux

    (defun revappend-nat-to-bin-chars-aux (n acc)
      (declare (xargs :guard (natp n)))
      (let ((acl2::__function__ 'revappend-nat-to-bin-chars-aux))
        (declare (ignorable acl2::__function__))
        (mbe :logic
             (append (basic-nat-to-bin-chars n) acc)
             :exec
             (if (zp n)
                 acc
               (cons (if (eql (the bit (logand n 1)) 1)
                         #\1
                       #\0)
                     (revappend-nat-to-bin-chars-aux
                          (the unsigned-byte
                               (ash (the unsigned-byte n) -1))
                          acc))))))