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