Recognizer for program structures.
(programp x) → *
Function:
(defun programp (x) (declare (xargs :guard t)) (let ((__function__ 'programp)) (declare (ignorable __function__)) (and (consp x) (eq (car x) :program) (mbe :logic (and (alistp (cdr x)) (equal (strip-cars (cdr x)) '(name imports defs))) :exec (fty::alist-with-carsp (cdr x) '(name imports defs))) (b* ((name (cdr (std::da-nth 0 (cdr x)))) (imports (cdr (std::da-nth 1 (cdr x)))) (defs (cdr (std::da-nth 2 (cdr x))))) (and (identifierp name) (import-listp imports) (programdef-listp defs))))))
Theorem:
(defthm consp-when-programp (implies (programp x) (consp x)) :rule-classes :compound-recognizer)