Evaluate a string element to a list of bytes.
(eval-string-element elem) → bytes
The evaluation of plain string literals involves first turning the string into a sequence of bytes. An escape is turned into a list of bytes as formalized in eval-escape. A single character is turned into a singleton list consisting of the character's code.
Function:
(defun eval-string-element (elem) (declare (xargs :guard (string-elementp elem))) (let ((__function__ 'eval-string-element)) (declare (ignorable __function__)) (string-element-case elem :char (list (char-code elem.get)) :escape (eval-escape elem.get))))
Theorem:
(defthm ubyte8-listp-of-eval-string-element (b* ((bytes (eval-string-element elem))) (acl2::ubyte8-listp bytes)) :rule-classes :rewrite)
Theorem:
(defthm eval-string-element-of-string-element-fix-elem (equal (eval-string-element (string-element-fix elem)) (eval-string-element elem)))
Theorem:
(defthm eval-string-element-string-element-equiv-congruence-on-elem (implies (string-element-equiv elem elem-equiv) (equal (eval-string-element elem) (eval-string-element elem-equiv))) :rule-classes :congruence)