Recognizer for name structures.
(namep x) → *
Function:
(defun namep (x) (declare (xargs :guard t)) (let ((__function__ 'namep)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :simple)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((string (std::da-nth 0 (cdr x)))) (stringp string)))) (t (and (eq (car x) :indexed) (and (true-listp (cdr x)) (eql (len (cdr x)) 2)) (b* ((string (std::da-nth 0 (cdr x))) (index (std::da-nth 1 (cdr x)))) (and (stringp string) (natp index)))))))))
Theorem:
(defthm consp-when-namep (implies (namep x) (consp x)) :rule-classes :compound-recognizer)