• Top
  • Compdecl

Compdeclp

Recognizer for compdecl structures.

Signature
(compdeclp x) → *

Definitions and Theorems

Function: compdeclp

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

Theorem: consp-when-compdeclp

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