Convert a character list into a string.
(implode x) → str
(implode x) is logically nothing more than
Even though coerce is built into ACL2, we prefer to use
Theorem:
(defthm coerce-to-string-removal (equal (coerce x 'string) (implode x)))
The basic rationale for this is that
We do the same thing for
Function:
(defun acl2::implode$inline (x) (declare (xargs :guard (character-listp x))) (let ((acl2::__function__ 'implode)) (declare (ignorable acl2::__function__)) (coerce x 'string)))
Theorem:
(defthm acl2::stringp-of-implode (b* ((str (acl2::implode$inline x))) (stringp str)) :rule-classes :type-prescription)
Theorem:
(defthm equal-of-implodes (implies (and (character-listp x) (character-listp y)) (equal (equal (implode x) (implode y)) (equal x y))))
Theorem:
(defthm implode-of-make-character-list (equal (implode (make-character-list x)) (implode x)))
Theorem:
(defthm equal-of-implode-with-empty-string (equal (equal "" (implode x)) (atom x)))
Theorem:
(defthm coerce-to-string-removal (equal (coerce x 'string) (implode x)))