This is analogous to Common Lisp's
Function:
(defun bsp-position (bsp) (declare (xargs :guard (bspp bsp))) (let ((__function__ 'bsp-position)) (declare (ignorable __function__)) (cdr bsp)))
Theorem:
(defthm bsp-position-type (implies (bspp bsp) (b* ((pos (bsp-position bsp))) (and (integerp pos) (>= pos 0)))) :rule-classes :type-prescription)