Convert a vl-bitlist into the corresponding character list,
e.g.,
(vl-bitlist->charlist x) → chars
This is an ordinary defprojection.
Function:
(defun vl-bitlist->charlist-exec (x acc) (declare (xargs :guard (vl-bitlist-p x))) (declare (xargs :guard t)) (let ((__function__ 'vl-bitlist->charlist-exec)) (declare (ignorable __function__)) (if (consp x) (vl-bitlist->charlist-exec (cdr x) (cons (vl-bit->char (car x)) acc)) acc)))
Function:
(defun vl-bitlist->charlist-nrev (x nrev) (declare (xargs :stobjs (nrev))) (declare (xargs :guard (vl-bitlist-p x))) (declare (xargs :guard t)) (let ((__function__ 'vl-bitlist->charlist-nrev)) (declare (ignorable __function__)) (if (atom x) (nrev-fix nrev) (let ((nrev (nrev-push (vl-bit->char (car x)) nrev))) (vl-bitlist->charlist-nrev (cdr x) nrev)))))
Function:
(defun vl-bitlist->charlist (x) (declare (xargs :guard (vl-bitlist-p x))) (declare (xargs :guard t)) (let ((__function__ 'vl-bitlist->charlist)) (declare (ignorable __function__)) (mbe :logic (if (consp x) (cons (vl-bit->char (car x)) (vl-bitlist->charlist (cdr x))) nil) :exec (if (atom x) nil (with-local-nrev (vl-bitlist->charlist-nrev x nrev))))))
Theorem:
(defthm character-listp-of-vl-bitlist->charlist (b* ((chars (vl-bitlist->charlist x))) (character-listp chars)) :rule-classes :rewrite)
Theorem:
(defthm vl-bitlist->charlist-of-vl-bitlist-fix-x (equal (vl-bitlist->charlist (vl-bitlist-fix x)) (vl-bitlist->charlist x)))
Theorem:
(defthm vl-bitlist->charlist-vl-bitlist-equiv-congruence-on-x (implies (vl-bitlist-equiv x x-equiv) (equal (vl-bitlist->charlist x) (vl-bitlist->charlist x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vl-bitlist->charlist-nrev-removal (equal (vl-bitlist->charlist-nrev acl2::x nrev) (append nrev (vl-bitlist->charlist acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-bitlist->charlist-exec-removal (equal (vl-bitlist->charlist-exec acl2::x acl2::acc) (revappend (vl-bitlist->charlist acl2::x) acl2::acc)) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-bitlist->charlist-of-rev (equal (vl-bitlist->charlist (rev acl2::x)) (rev (vl-bitlist->charlist acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-bitlist->charlist-of-list-fix (equal (vl-bitlist->charlist (list-fix acl2::x)) (vl-bitlist->charlist acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-bitlist->charlist-of-append (equal (vl-bitlist->charlist (append acl2::a acl2::b)) (append (vl-bitlist->charlist acl2::a) (vl-bitlist->charlist acl2::b))) :rule-classes ((:rewrite)))
Theorem:
(defthm cdr-of-vl-bitlist->charlist (equal (cdr (vl-bitlist->charlist acl2::x)) (vl-bitlist->charlist (cdr acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm car-of-vl-bitlist->charlist (equal (car (vl-bitlist->charlist acl2::x)) (and (consp acl2::x) (vl-bit->char (car acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-bitlist->charlist-under-iff (iff (vl-bitlist->charlist acl2::x) (consp acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm consp-of-vl-bitlist->charlist (equal (consp (vl-bitlist->charlist acl2::x)) (consp acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm len-of-vl-bitlist->charlist (equal (len (vl-bitlist->charlist acl2::x)) (len acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-of-vl-bitlist->charlist (true-listp (vl-bitlist->charlist acl2::x)) :rule-classes :type-prescription)
Theorem:
(defthm vl-bitlist->charlist-when-not-consp (implies (not (consp acl2::x)) (equal (vl-bitlist->charlist acl2::x) nil)) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-bitlist->charlist-of-cons (equal (vl-bitlist->charlist (cons acl2::a acl2::b)) (cons (vl-bit->char acl2::a) (vl-bitlist->charlist acl2::b))) :rule-classes ((:rewrite)))