• Top
  • Mappingdecl

Mappingdeclp

Recognizer for mappingdecl structures.

Signature
(mappingdeclp x) → *

Definitions and Theorems

Function: mappingdeclp

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

Theorem: consp-when-mappingdeclp

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