• Top
  • Finalizer

Finalizerp

Recognizer for finalizer structures.

Signature
(finalizerp x) → *

Definitions and Theorems

Function: finalizerp

(defun finalizerp (x)
 (declare (xargs :guard t))
 (let ((__function__ 'finalizerp))
  (declare (ignorable __function__))
  (and
      (consp x)
      (eq (car x) :finalizer)
      (mbe :logic (and (alistp (cdr x))
                       (equal (strip-cars (cdr x))
                              '(name inputs output body)))
           :exec (fty::alist-with-carsp (cdr x)
                                        '(name inputs output body)))
      (b* ((name (cdr (std::da-nth 0 (cdr x))))
           (inputs (cdr (std::da-nth 1 (cdr x))))
           (output (cdr (std::da-nth 2 (cdr x))))
           (body (cdr (std::da-nth 3 (cdr x)))))
        (and (identifierp name)
             (funparam-listp inputs)
             (type-optionp output)
             (statement-listp body))))))

Theorem: consp-when-finalizerp

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