• Top
  • Identifier

Identifierp

Recognizer for identifier structures.

Signature
(identifierp x) → *

Definitions and Theorems

Function: identifierp

(defun identifierp (x)
  (declare (xargs :guard t))
  (let ((__function__ 'identifierp))
    (declare (ignorable __function__))
    (and (consp x)
         (eq (car x) :identifier)
         (mbe :logic (and (alistp (cdr x))
                          (equal (strip-cars (cdr x)) '(name)))
              :exec (fty::alist-with-carsp (cdr x) '(name)))
         (b* ((name (cdr (std::da-nth 0 (cdr x)))))
           (and (stringp name)
                (identifier-string-p name))))))

Theorem: consp-when-identifierp

(defthm consp-when-identifierp
  (implies (identifierp x) (consp x))
  :rule-classes :compound-recognizer)