Enhanced variant of definedp.
(definedp+ fn wrld) → yes/no
This returns the same result as definedp,
but it causes an error if called on a symbol
that does not name a logic-mode function.
The reason for ensuring logic mode is that this utility
checks whether the function has an
Function:
(defun definedp+ (fn wrld) (declare (xargs :guard (and (symbolp fn) (plist-worldp wrld)))) (let ((__function__ 'definedp+)) (declare (ignorable __function__)) (cond ((not (function-symbolp fn wrld)) (raise "The symbol ~x0 does not name a function." fn)) ((not (logicp fn wrld)) (raise "The function ~x0 is not in logic mode." fn)) (t (definedp fn wrld)))))
Theorem:
(defthm booleanp-of-definedp+ (b* ((yes/no (definedp+ fn wrld))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm function-symbolp-when-definedp+ (implies (definedp+ fn wrld) (function-symbolp fn wrld)))
Theorem:
(defthm logicp-when-definedp+ (implies (definedp+ fn wrld) (logicp fn wrld)))