• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
          • Base64-impl
          • Base64-decode-list
          • Base64-decode
          • Base64-encode-list
            • Base64-revappend-decode
            • Base64-revappend-encode
            • Base64-encode
          • 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-extensions
          • Std/strings/digit-to-char
          • Substitution
          • Symbols
        • Std/io
        • Std/osets
        • Std/system
        • Std/basic
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Base64

    Base64-encode-list

    Base64 encode a character list.

    Signature
    (base64-encode-list x) → x-enc
    Arguments
    x — Character list to encode.
        Guard (character-listp x).
    Returns
    x-enc — Encoded version of x.
        Type (character-listp x-enc).

    Definitions and Theorems

    Function: base64-encode-list

    (defun base64-encode-list (x)
      (declare (xargs :guard (character-listp x)))
      (let ((acl2::__function__ 'base64-encode-list))
        (declare (ignorable acl2::__function__))
        (mbe :logic
             (b* (((when (atom x)) nil)
                  ((when (atom (cdddr x)))
                   (b* (((mv c1 c2 c3 c4)
                         (b64-encode-last-group x)))
                     (list c1 c2 c3 c4)))
                  ((mv c1 c2 c3 c4)
                   (b64-enc3 (first x)
                             (second x)
                             (third x))))
               (append (list c1 c2 c3 c4)
                       (base64-encode-list (cdddr x))))
             :exec (reverse (b64-encode-list-impl x nil)))))

    Theorem: character-listp-of-base64-encode-list

    (defthm character-listp-of-base64-encode-list
      (b* ((x-enc (base64-encode-list x)))
        (character-listp x-enc))
      :rule-classes :rewrite)

    Theorem: b64-encode-list-impl-removal

    (defthm b64-encode-list-impl-removal
      (equal (b64-encode-list-impl x acc)
             (revappend (base64-encode-list x) acc)))