Recognizer for topdecl structures.
(topdeclp x) → *
Function:
(defun topdeclp (x) (declare (xargs :guard t)) (let ((__function__ 'topdeclp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :function)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (fundeclp get)))) ((eq (car x) :struct) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (structdeclp get)))) (t (and (eq (car x) :mapping) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((get (std::da-nth 0 (cdr x)))) (mappingdeclp get))))))))
Theorem:
(defthm consp-when-topdeclp (implies (topdeclp x) (consp x)) :rule-classes :compound-recognizer)