Convert a Java ASCII character list to an ACL2 string.
(ascii=>string ascii) → string
This is the inverse of string=>unicode for the ASCII subset of Unicode. It converts lists of ASCII codes to Java strings, using the library function nats=>string.
Function:
(defun ascii=>string (ascii) (declare (xargs :guard (ascii-listp ascii))) (let ((__function__ 'ascii=>string)) (declare (ignorable __function__)) (b* ((ascii (mbe :logic (ascii-list-fix ascii) :exec ascii))) (nats=>string ascii))))
Theorem:
(defthm stringp-of-ascii=>string (b* ((string (ascii=>string ascii))) (stringp string)) :rule-classes :rewrite)
Theorem:
(defthm ascii=>string-of-string=>unicode (implies (ascii-listp (string=>unicode string)) (equal (ascii=>string (string=>unicode string)) (str-fix string))))
Theorem:
(defthm string=>unicode-of-ascii=>string (equal (string=>unicode (ascii=>string ascii)) (ascii-list-fix ascii)))
Theorem:
(defthm equal-of-ascii=>string-to-equal-of-string=>unicode (implies (and (ascii-listp x) (stringp y)) (equal (equal (ascii=>string x) y) (equal (string=>unicode y) x))))
Theorem:
(defthm equal-of-string=>unicode-to-equal-of-ascii=>string (implies (and (ascii-listp x) (stringp y)) (equal (equal (string=>unicode x) y) (equal (ascii=>string y) x))))
Theorem:
(defthm ascii=>string-of-ascii-list-fix-ascii (equal (ascii=>string (ascii-list-fix ascii)) (ascii=>string ascii)))
Theorem:
(defthm ascii=>string-ascii-list-equiv-congruence-on-ascii (implies (ascii-list-equiv ascii ascii-equiv) (equal (ascii=>string ascii) (ascii=>string ascii-equiv))) :rule-classes :congruence)