• Top
  • Topdecl

Topdeclp

Recognizer for topdecl structures.

Signature
(topdeclp x) → *

Definitions and Theorems

Function: topdeclp

(defun topdeclp (x)
  (declare (xargs :guard t))
  (let ((__function__ 'topdeclp))
    (declare (ignorable __function__))
    (and (consp x)
         (cond ((or (atom x) (eq (car x) :function))
                (and (true-listp (cdr x))
                     (eql (len (cdr x)) 1)
                     (b* ((get (std::da-nth 0 (cdr x))))
                       (fundeclp get))))
               ((eq (car x) :struct)
                (and (true-listp (cdr x))
                     (eql (len (cdr x)) 1)
                     (b* ((get (std::da-nth 0 (cdr x))))
                       (structdeclp get))))
               (t (and (eq (car x) :mapping)
                       (and (true-listp (cdr x))
                            (eql (len (cdr x)) 1))
                       (b* ((get (std::da-nth 0 (cdr x))))
                         (mappingdeclp get))))))))

Theorem: consp-when-topdeclp

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