Recognize expression terms returning booleans.
(atc-boolean-termp term) → yes/no
We just check whether the term is
a call of a
Function:
(defun atc-boolean-termp (term) (declare (xargs :guard (pseudo-termp term))) (let ((__function__ 'atc-boolean-termp)) (declare (ignorable __function__)) (b* (((mv andp & &) (check-and-call term)) ((when andp) t) ((mv orp & &) (check-or-call term)) ((when orp) t)) (case-match term ((fn . &) (if (member-eq fn *atc-boolean-from-type-fns*) t nil)) (& nil)))))
Theorem:
(defthm booleanp-of-atc-boolean-termp (b* ((yes/no (atc-boolean-termp term))) (booleanp yes/no)) :rule-classes :rewrite)