• Top
  • Locator

Locatorp

Recognizer for locator structures.

Signature
(locatorp x) → *

Definitions and Theorems

Function: locatorp

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

Theorem: consp-when-locatorp

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