In languages like C, this might be written as
Function:
(defun logtail$inline (pos i) (declare (type unsigned-byte pos)) (declare (xargs :guard (and (and (integerp pos) (<= 0 pos)) (integerp i)))) (declare (xargs :split-types t)) (let ((__function__ 'logtail)) (declare (ignorable __function__)) (mbe :logic (ifloor i (expt2 pos)) :exec (ash i (- (the unsigned-byte pos))))))
Theorem:
(defthm logtail-type (b* ((int (logtail$inline pos i))) (integerp int)) :rule-classes :type-prescription)