Find the exponent
(defdigit-grouping-find-exp smaller larger) → exp?
This is the logarithm to base
Function:
(defun defdigit-grouping-find-exp (smaller larger) (declare (xargs :guard (and (dab-basep smaller) (dab-basep larger)))) (let ((__function__ 'defdigit-grouping-find-exp)) (declare (ignorable __function__)) (b* (((unless (mbt (and (dab-basep smaller) (dab-basep larger)))) nil) (larger2 (/ larger smaller)) ((unless (posp larger2)) nil) ((when (= larger2 1)) 1) (exp2? (defdigit-grouping-find-exp smaller larger2)) ((unless exp2?) nil)) (1+ exp2?))))
Theorem:
(defthm maybe-posp-of-defdigit-grouping-find-exp (b* ((exp? (defdigit-grouping-find-exp smaller larger))) (maybe-posp exp?)) :rule-classes :rewrite)