Encode the last group of (up to three) characters.
(b64-encode-last-group x) → (mv e1 e2 e3 e4)
Function:
(defun b64-encode-last-group (x) (declare (xargs :guard (character-listp x))) (declare (xargs :guard (consp x))) (let ((acl2::__function__ 'b64-encode-last-group)) (declare (ignorable acl2::__function__)) (cond ((atom (cdr x)) (b* (((mv c1 c2) (b64-enc1 (first x)))) (mv c1 c2 #\= #\=))) ((atom (cddr x)) (b* (((mv c1 c2 c3) (b64-enc2 (first x) (second x)))) (mv c1 c2 c3 #\=))) (t (b64-enc3 (first x) (second x) (third x))))))
Theorem:
(defthm characterp-of-b64-encode-last-group.e1 (b* (((mv ?e1 ?e2 ?e3 ?e4) (b64-encode-last-group x))) (characterp e1)) :rule-classes :type-prescription)
Theorem:
(defthm characterp-of-b64-encode-last-group.e2 (b* (((mv ?e1 ?e2 ?e3 ?e4) (b64-encode-last-group x))) (characterp e2)) :rule-classes :type-prescription)
Theorem:
(defthm characterp-of-b64-encode-last-group.e3 (b* (((mv ?e1 ?e2 ?e3 ?e4) (b64-encode-last-group x))) (characterp e3)) :rule-classes :type-prescription)
Theorem:
(defthm characterp-of-b64-encode-last-group.e4 (b* (((mv ?e1 ?e2 ?e3 ?e4) (b64-encode-last-group x))) (characterp e4)) :rule-classes :type-prescription)