Recognizer for tag-declon structures.
(tag-declonp x) → *
Function:
(defun tag-declonp (x) (declare (xargs :guard t)) (let ((__function__ 'tag-declonp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :struct)) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((tag (std::da-nth 0 (cdr x))) (members (std::da-nth 1 (cdr x)))) (and (identp tag) (struct-declon-listp members))))) ((eq (car x) :union) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((tag (std::da-nth 0 (cdr x))) (members (std::da-nth 1 (cdr x)))) (and (identp tag) (struct-declon-listp members))))) (t (and (eq (car x) :enum) (and (true-listp (cdr x)) (eql (len (cdr x)) 2)) (b* ((tag (std::da-nth 0 (cdr x))) (enumerators (std::da-nth 1 (cdr x)))) (and (identp tag) (ident-listp enumerators)))))))))
Theorem:
(defthm consp-when-tag-declonp (implies (tag-declonp x) (consp x)) :rule-classes :compound-recognizer)