Function:
(defun name-fix (x) (declare (xargs :guard (name-p x))) (let ((__function__ 'name-fix)) (declare (ignorable __function__)) (mbe :logic (if (name-p x) x '(:anonymous)) :exec x)))
Theorem:
(defthm name-p-of-name-fix (b* ((xx (name-fix x))) (name-p xx)) :rule-classes :rewrite)
Theorem:
(defthm name-fix-when-name-p (implies (name-p x) (equal (name-fix x) x)))