Convert the first character of a character list to upper case.
(upcase-first-charlist x) → upcased
Function:
(defun upcase-first-charlist (x) (declare (xargs :guard (character-listp x))) (let ((acl2::__function__ 'upcase-first-charlist)) (declare (ignorable acl2::__function__)) (mbe :logic (if (atom x) nil (cons (upcase-char (car x)) (make-character-list (cdr x)))) :exec (cond ((atom x) nil) ((down-alpha-p (car x)) (cons (upcase-char (car x)) (cdr x))) (t x)))))
Theorem:
(defthm character-listp-of-upcase-first-charlist (b* ((upcased (upcase-first-charlist x))) (character-listp upcased)) :rule-classes :rewrite)
Theorem:
(defthm charlisteqv-implies-equal-upcase-first-charlist-1 (implies (charlisteqv x x-equiv) (equal (upcase-first-charlist x) (upcase-first-charlist x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm icharlisteqv-implies-icharlisteqv-upcase-first-charlist-1 (implies (icharlisteqv x x-equiv) (icharlisteqv (upcase-first-charlist x) (upcase-first-charlist x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm upcase-first-charlist-when-atom (implies (atom x) (equal (upcase-first-charlist x) nil)))
Theorem:
(defthm len-of-upcase-first-charlist (equal (len (upcase-first-charlist x)) (len x)))
Theorem:
(defthm consp-of-upcase-first-charlist (equal (consp (upcase-first-charlist x)) (consp x)))
Theorem:
(defthm upcase-first-charlist-under-iff (iff (upcase-first-charlist x) (consp x)))