• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
          • Pretty-printing-implementation
            • Missing-functionality
            • Printconfig
            • Cons-ppr1
            • Print-escaped-charlist
            • Atom-size
            • Print-escaped-str
              • Print-escaped-str-aux
              • Obj-size
              • Maybe-merge-flat
              • Ppr
              • Printer-instructions
              • Keyword-param-valuep
              • Print-flat-objs
              • Radix-print-int
              • Print-escaped-atom
              • Print-atom
              • Print-escaped-symbol
              • Radix-print-complex
              • Basic-print-complex
              • Radix-print-rat
              • Spaces1
              • Basic-print-rat
              • Basic-print-nat
              • Basic-print-int
              • Spaces
              • My-needs-slashes
              • Pinstlist->max-width
              • Nat-size
              • Special-term-num
              • Print-column
              • Print-base-fix
              • Int-size
              • Keyword-fix
              • Print-instruction
              • Pinst->width
              • In-home-package-p
              • Eviscerated->guts
              • Evisceratedp
              • Pprdot
            • Eviscerate
            • Pretty
            • Revappend-pretty
            • Pretty-list
          • Printtree
          • Base64
          • Charset-p
          • Strtok!
          • Cases
          • Concatenation
          • Html-encoding
          • Character-kinds
          • Substrings
          • Strtok
          • Equivalences
          • Url-encoding
          • Lines
          • Explode-implode-equalities
          • Ordering
          • Numbers
          • 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
    • Print-escaped-str

    Print-escaped-str-aux

    Implementation of print-escaped-str.

    Signature
    (print-escaped-str-aux x n xl slash-char acc) → *

    Definitions and Theorems

    Function: print-escaped-str-aux

    (defun print-escaped-str-aux (x n xl slash-char acc)
     (declare (type string x)
              (type unsigned-byte n)
              (type unsigned-byte xl)
              (type character slash-char))
     (declare (xargs :guard (and (eql xl (length x)) (<= n xl))))
     (let ((acl2::__function__ 'print-escaped-str-aux))
      (declare (ignorable acl2::__function__))
      (b* (((when (mbe :logic (zp (- (length x) (nfix n)))
                       :exec (eql n xl)))
            acc)
           ((the character c1) (char x n))
           ((the unsigned-byte n)
            (+ 1
               (the unsigned-byte
                    (mbe :logic (nfix n) :exec n)))))
        (print-escaped-str-aux x n xl slash-char
                               (if (or (eql c1 #\\) (eql c1 slash-char))
                                   (list* c1 #\\ acc)
                                 (cons c1 acc))))))

    Theorem: print-escaped-str-aux-removal

    (defthm print-escaped-str-aux-removal
      (implies (and (stringp x)
                    (natp n)
                    (equal xl (length x))
                    (<= n xl))
               (equal (print-escaped-str-aux x n xl slash-char acc)
                      (print-escaped-charlist (nthcdr n (explode x))
                                              slash-char acc))))