Check if a symbol names a macro,
i.e. it has a
(macro-symbolp sym wrld) → yes/no
This function is named in analogy to the function-symbolp built-in system utility.
Function:
(defun macro-symbolp (sym wrld) (declare (xargs :guard (and (symbolp sym) (plist-worldp wrld)))) (let ((__function__ 'macro-symbolp)) (declare (ignorable __function__)) (not (eq (getpropc sym 'macro-args t wrld) t))))
Theorem:
(defthm booleanp-of-macro-symbolp (b* ((yes/no (macro-symbolp sym wrld))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm macro-symbolp-forward-to-symbolp (implies (and (macro-symbolp fn wrld) (plist-worldp wrld)) (symbolp fn)) :rule-classes :forward-chaining)