• 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
          • Octal
            • Parse-octal-from-string
            • Parse-octal-from-charlist
            • Nat-to-oct-chars
            • Oct-digit-chars-value
            • Oct-digit-char-p
            • Take-leading-oct-digit-chars
            • Oct-digit-char-value
            • Oct-digit-char-list*p
            • Oct-digit-char-listp
            • Skip-leading-octal-digits
            • Oct-digit-string-p
            • Nat-to-oct-string
            • Strval8
            • Nat-to-oct-string-list
            • Revappend-nat-to-oct-chars
              • Revappend-nat-to-oct-chars-aux
            • Nonzero-oct-digit-char-p
            • Nat-to-oct-string-size
            • Octal-digit-to-char
          • 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
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Octal

Revappend-nat-to-oct-chars

More efficient version of (revappend (nat-to-oct-chars n) acc).

Signature
(revappend-nat-to-oct-chars n acc) → new-acc
Arguments
n — Guard (natp n).

This strange operation can be useful when building strings by consing together characters in reverse order.

Definitions and Theorems

Function: revappend-nat-to-oct-chars$inline

(defun revappend-nat-to-oct-chars$inline (n acc)
  (declare (xargs :guard (natp n)))
  (let ((acl2::__function__ 'revappend-nat-to-oct-chars))
    (declare (ignorable acl2::__function__))
    (mbe :logic
         (revappend (nat-to-oct-chars n) acc)
         :exec
         (if (zp n)
             (cons #\0 acc)
           (revappend-nat-to-oct-chars-aux n acc)))))

Subtopics

Revappend-nat-to-oct-chars-aux