Recognizer for closure structures.
(closurep x) → *
Function:
(defun closurep (x) (declare (xargs :guard t)) (let ((__function__ 'closurep)) (declare (ignorable __function__)) (and (consp x) (eq (car x) :closure) (mbe :logic (and (alistp (cdr x)) (equal (strip-cars (cdr x)) '(name inputs instrs outputs))) :exec (fty::alist-with-carsp (cdr x) '(name inputs instrs outputs))) (b* ((name (cdr (std::da-nth 0 (cdr x)))) (inputs (cdr (std::da-nth 1 (cdr x)))) (instrs (cdr (std::da-nth 2 (cdr x)))) (outputs (cdr (std::da-nth 3 (cdr x))))) (and (identifierp name) (closure-input-listp inputs) (instruction-listp instrs) (closure-output-listp outputs))))))
Theorem:
(defthm consp-when-closurep (implies (closurep x) (consp x)) :rule-classes :compound-recognizer)