Recognizer for svex-context structures.
(svex-context-p x) → *
Function:
(defun svex-context-p (x) (declare (xargs :guard t)) (let ((__function__ 'svex-context-p)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :call)) (and (std::prod-consp (cdr x)) (std::prod-consp (std::prod-cdr (cdr x))) (b* ((argnum (std::prod-car (cdr x))) (fn (std::prod-car (std::prod-cdr (cdr x)))) (args (std::prod-cdr (std::prod-cdr (cdr x))))) (and (natp argnum) (fnsym-p fn) (svexlist-p args))))) (t (and (eq (car x) :top) (and (true-listp (cdr x)) (eql (len (cdr x)) 0)) (b* nil t)))))))
Theorem:
(defthm consp-when-svex-context-p (implies (svex-context-p x) (consp x)) :rule-classes :compound-recognizer)