Convert a list of characters to a list of bytes.
(charlist->bytes charlist) → bl
Function:
(defun charlist->bytes (charlist) (declare (xargs :guard (character-listp charlist))) (let ((__function__ 'charlist->bytes)) (declare (ignorable __function__)) (if (endp charlist) nil (cons (char-code (car charlist)) (charlist->bytes (cdr charlist))))))
Theorem:
(defthm byte-listp-of-charlist->bytes (implies (and (character-listp charlist)) (b* ((bl (charlist->bytes charlist))) (byte-listp bl))) :rule-classes :rewrite)
Theorem:
(defthm same-length-of-byte-and-character-lists (b* ((?bl (charlist->bytes charlist))) (implies (character-listp charlist) (equal (len bl) (len charlist)))))