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