Base64 decode a string.
(base64-decode x) → (mv okp ans)
Function:
(defun base64-decode (x) (declare (xargs :guard (stringp x))) (declare (type string x)) (let ((acl2::__function__ 'base64-decode)) (declare (ignorable acl2::__function__)) (mbe :logic (b* (((mv okp chars) (base64-decode-list (explode x)))) (mv okp (implode chars))) :exec (b* (((mv okp rchars) (b64-decode-str-impl x 0 (length x) nil))) (mv okp (rchars-to-string rchars))))))
Theorem:
(defthm booleanp-of-base64-decode.okp (b* (((mv ?okp ?ans) (base64-decode x))) (booleanp okp)) :rule-classes :type-prescription)
Theorem:
(defthm stringp-of-base64-decode.ans (b* (((mv ?okp ?ans) (base64-decode x))) (stringp ans)) :rule-classes :type-prescription)
Theorem:
(defthm base64-decode-of-base64-encode (equal (base64-decode (base64-encode x)) (mv t (if (stringp x) x ""))))