• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defconst
        • Fast-alists
        • Defmacro
        • Loop$-primer
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Efficiency
        • Irrelevant-formals
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Strings
          • Std/strings
            • Pretty-printing
            • Printtree
            • Base64
              • Base64-impl
                • B64-bytes-from-vals
                • B64-vals-from-bytes
                • B64-dec3
                • B64-decode-str-impl
                • B64-dec2
                • B64-encode-last-group
                • B64-value-from-code
                • B64-enc3
                • B64-enc2
                • B64-decode-last-group
                • B64-dec1
                • B64-decode-list-impl
                  • B64-encode-str-impl
                  • B64-encode-last-group-str
                  • B64-enc1
                  • B64-char-from-value
                  • B64-encode-list-impl
                • Base64-decode-list
                • Base64-decode
                • Base64-encode-list
                • Base64-revappend-decode
                • Base64-revappend-encode
                • Base64-encode
              • Charset-p
              • Strtok!
              • Cases
              • Concatenation
              • Character-kinds
              • Html-encoding
              • Substrings
              • Strtok
              • Equivalences
              • Url-encoding
              • Lines
              • Explode-implode-equalities
              • Ordering
              • Numbers
              • Pad-trim
              • Coercion
              • Std/strings/digit-to-char
              • Substitution
              • Symbols
            • String-listp
            • Stringp
            • Length
            • Search
            • Remove-duplicates
            • Position
            • Coerce
            • Concatenate
            • Reverse
            • String
            • Subseq
            • Substitute
            • String-upcase
            • String-downcase
            • Count
            • Char
            • String<
            • String-equal
            • String-utilities
            • String-append
            • String>=
            • String<=
            • String>
            • Hex-digit-char-theorems
            • String-downcase-gen
            • String-upcase-gen
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Base64-impl

    B64-decode-list-impl

    Tail-recursive version of base64-decode-list.

    Signature
    (b64-decode-list-impl x acc) → (mv okp acc)
    Arguments
    x — Guard (character-listp x).
    Returns
    okp — Type (booleanp okp).
    acc — Type (character-listp acc), given (character-listp acc).

    Definitions and Theorems

    Function: b64-decode-list-impl

    (defun b64-decode-list-impl (x acc)
      (declare (xargs :guard (character-listp x)))
      (let ((acl2::__function__ 'b64-decode-list-impl))
        (declare (ignorable acl2::__function__))
        (b* (((when (atom x)) (mv t acc))
             ((when (atom (cdddr x))) (mv nil acc))
             (c1 (first x))
             (c2 (second x))
             (c3 (third x))
             (c4 (fourth x))
             (rest (cddddr x))
             ((when (atom rest))
              (b* (((mv okp last)
                    (b64-decode-last-group c1 c2 c3 c4)))
                (mv okp (revappend last acc))))
             ((mv okp x1 x2 x3)
              (b64-dec3 c1 c2 c3 c4))
             ((unless okp) (mv nil acc))
             (acc (list* x3 x2 x1 acc)))
          (b64-decode-list-impl (cddddr x) acc))))

    Theorem: booleanp-of-b64-decode-list-impl.okp

    (defthm booleanp-of-b64-decode-list-impl.okp
      (b* (((mv ?okp ?acc)
            (b64-decode-list-impl x acc)))
        (booleanp okp))
      :rule-classes :type-prescription)

    Theorem: character-listp-of-b64-decode-list-impl.acc

    (defthm character-listp-of-b64-decode-list-impl.acc
      (implies (character-listp acc)
               (b* (((mv ?okp ?acc)
                     (b64-decode-list-impl x acc)))
                 (character-listp acc)))
      :rule-classes :rewrite)