Logically simple definition that is similar to nat-to-dec-chars.
(basic-nat-to-dec-chars n) → chars
This almost computes
Function:
(defun basic-nat-to-dec-chars (n) (declare (xargs :guard (natp n))) (let ((acl2::__function__ 'basic-nat-to-dec-chars)) (declare (ignorable acl2::__function__)) (if (zp n) nil (cons (digit-to-char (mod n 10)) (basic-nat-to-dec-chars (floor n 10))))))
Theorem:
(defthm dec-digit-char-list*p-of-basic-nat-to-dec-chars (b* ((chars (basic-nat-to-dec-chars n))) (dec-digit-char-list*p chars)) :rule-classes :rewrite)
Theorem:
(defthm basic-nat-to-dec-chars-when-zp (implies (zp n) (equal (basic-nat-to-dec-chars n) nil)))
Theorem:
(defthm true-listp-of-basic-nat-to-dec-chars (true-listp (basic-nat-to-dec-chars n)) :rule-classes :type-prescription)
Theorem:
(defthm character-listp-of-basic-nat-to-dec-chars (character-listp (basic-nat-to-dec-chars n)))
Theorem:
(defthm basic-nat-to-dec-chars-under-iff (iff (basic-nat-to-dec-chars n) (not (zp n))))
Theorem:
(defthm consp-of-basic-nat-to-dec-chars (equal (consp (basic-nat-to-dec-chars n)) (if (basic-nat-to-dec-chars n) t nil)))
Theorem:
(defthm basic-nat-to-dec-chars-one-to-one (equal (equal (basic-nat-to-dec-chars n) (basic-nat-to-dec-chars m)) (equal (nfix n) (nfix m))))