Count the trailing consecutive 0s of a sparseint.
(sparseint-trailing-0-count x) → count
Function:
(defun sparseint-trailing-0-count (x) (declare (xargs :guard (sparseint-p x))) (let ((__function__ 'sparseint-trailing-0-count)) (declare (ignorable __function__)) (b* ((count (sparseint$-trailing-0-count-rec 0 0 (sparseint-fix x)))) (or count 0))))
Theorem:
(defthm natp-of-sparseint-trailing-0-count (b* ((count (sparseint-trailing-0-count x))) (natp count)) :rule-classes :type-prescription)
Theorem:
(defthm sparseint-trailing-0-count-correct (b* ((common-lisp::?count (sparseint-trailing-0-count x))) (equal count (trailing-0-count (sparseint-val x)))))
Theorem:
(defthm sparseint-trailing-0-count-of-sparseint-fix-x (equal (sparseint-trailing-0-count (sparseint-fix x)) (sparseint-trailing-0-count x)))
Theorem:
(defthm sparseint-trailing-0-count-sparseint-equiv-congruence-on-x (implies (sparseint-equiv x x-equiv) (equal (sparseint-trailing-0-count x) (sparseint-trailing-0-count x-equiv))) :rule-classes :congruence)