Convert a natural number to its non-empty minimum-length little-endian list of digits.
(nat=>lendian+ base nat) → digits
The resulting list is never empty; it is
See also nat=>lendian* and nat=>lendian.
Function:
(defun nat=>lendian+ (base nat) (declare (xargs :guard (and (dab-basep base) (natp nat)))) (let ((__function__ 'nat=>lendian+)) (declare (ignorable __function__)) (b* ((digits (nat=>lendian* base nat))) (or digits (list 0)))))
Theorem:
(defthm return-type-of-nat=>lendian+ (b* ((digits (nat=>lendian+ base nat))) (dab-digit-listp base digits)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-nat=>lendian+ (b* ((digits (nat=>lendian+ base nat))) (nat-listp digits)) :rule-classes :rewrite)
Theorem:
(defthm nat=>lendian+-of-0 (equal (nat=>lendian+ base 0) (list 0)))
Theorem:
(defthm nat=>lendian+-of-dab-base-fix-base (equal (nat=>lendian+ (dab-base-fix base) nat) (nat=>lendian+ base nat)))
Theorem:
(defthm nat=>lendian+-dab-base-equiv-congruence-on-base (implies (dab-base-equiv base base-equiv) (equal (nat=>lendian+ base nat) (nat=>lendian+ base-equiv nat))) :rule-classes :congruence)
Theorem:
(defthm nat=>lendian+-of-nfix-nat (equal (nat=>lendian+ base (nfix nat)) (nat=>lendian+ base nat)))
Theorem:
(defthm nat=>lendian+-nat-equiv-congruence-on-nat (implies (nat-equiv nat nat-equiv) (equal (nat=>lendian+ base nat) (nat=>lendian+ base nat-equiv))) :rule-classes :congruence)