Collect any leading digits from the start of a character list.
(take-leading-dec-digit-chars x) → head
Function:
(defun take-leading-dec-digit-chars (x) (declare (xargs :guard t)) (let ((acl2::__function__ 'take-leading-dec-digit-chars)) (declare (ignorable acl2::__function__)) (cond ((atom x) nil) ((dec-digit-char-p (car x)) (cons (car x) (take-leading-dec-digit-chars (cdr x)))) (t nil))))
Theorem:
(defthm character-listp-of-take-leading-dec-digit-chars (implies (character-listp x) (b* ((head (take-leading-dec-digit-chars x))) (character-listp head))) :rule-classes :rewrite)
Theorem:
(defthm icharlisteqv-implies-equal-take-leading-dec-digit-chars-1 (implies (icharlisteqv x x-equiv) (equal (take-leading-dec-digit-chars x) (take-leading-dec-digit-chars x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm dec-digit-char-list*p-of-take-leading-dec-digit-chars (dec-digit-char-list*p (take-leading-dec-digit-chars x)))
Theorem:
(defthm bound-of-len-of-take-leading-dec-digit-chars (<= (len (take-leading-dec-digit-chars x)) (len x)) :rule-classes :linear)
Theorem:
(defthm equal-of-take-leading-dec-digit-chars-and-length (equal (equal (len (take-leading-dec-digit-chars x)) (len x)) (dec-digit-char-list*p x)))
Theorem:
(defthm take-leading-dec-digit-chars-when-dec-digit-char-list*p (implies (dec-digit-char-list*p x) (equal (take-leading-dec-digit-chars x) (list-fix x))))
Theorem:
(defthm consp-of-take-leading-dec-digit-chars (equal (consp (take-leading-dec-digit-chars x)) (dec-digit-char-p (car x))))