• Top
  • Vardecl

Vardeclp

Recognizer for vardecl structures.

Signature
(vardeclp x) → *

Definitions and Theorems

Function: vardeclp

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

Theorem: consp-when-vardeclp

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