FGL binder that finds a bound for the integer-length of X if possible.
(integer-length-bound ans x) → bound
Logically, this function returns either NIL or a natural number
greater than or equal to the integer length of
Function:
(defun integer-length-bound (ans x) (declare (xargs :guard (and (acl2::maybe-natp ans) (integerp x)))) (let ((__function__ 'integer-length-bound)) (declare (ignorable __function__)) (and (natp ans) (<= (integer-length x) ans) ans)))
Theorem:
(defthm maybe-natp-of-integer-length-bound (b* ((bound (integer-length-bound ans x))) (acl2::maybe-natp bound)) :rule-classes :type-prescription)
Theorem:
(defthm integer-length-bound-implies-integer-length (implies (integer-length-bound ans x) (<= (integer-length x) (integer-length-bound ans x))) :rule-classes :linear)