In languages like C, this might be written as
Function:
(defun logcons$inline (b i) (declare (xargs :guard (and (bitp b) (integerp i)))) (let ((__function__ 'logcons)) (declare (ignorable __function__)) (mbe :logic (let ((b (bfix b)) (i (ifix i))) (+ b (* 2 i))) :exec (the integer (+ (the (unsigned-byte 1) b) (the integer (ash i 1)))))))
Theorem:
(defthm logcons-type (b* ((int (logcons$inline b i))) (integerp int)) :rule-classes :type-prescription)