Recognizer for label structures.
(labelp x) → *
Function:
(defun labelp (x) (declare (xargs :guard t)) (let ((__function__ 'labelp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :name)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (identp get)))) ((eq (car x) :cas) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (exprp get)))) (t (and (eq (car x) :default) (and (true-listp (cdr x)) (eql (len (cdr x)) 0)) (b* nil t)))))))
Theorem:
(defthm consp-when-labelp (implies (labelp x) (consp x)) :rule-classes :compound-recognizer)