Number of characters in the binary representation of a natural.
Function:
(defun nat-to-bin-string-size$inline (x) (declare (xargs :guard (natp x))) (let ((acl2::__function__ 'nat-to-bin-string-size)) (declare (ignorable acl2::__function__)) (if (zp x) 1 (integer-length x))))
Theorem:
(defthm posp-of-nat-to-bin-string-size (b* ((size (nat-to-bin-string-size$inline x))) (posp size)) :rule-classes :type-prescription)
Theorem:
(defthm len-of-nat-to-bin-chars (equal (len (nat-to-bin-chars x)) (nat-to-bin-string-size x)))
Theorem:
(defthm length-of-nat-to-bin-string (equal (length (nat-to-bin-string x)) (nat-to-bin-string-size x)))