Recognizer for context structures.
(contextp x) → *
Function:
(defun contextp (x) (declare (xargs :guard t)) (let ((__function__ 'contextp)) (declare (ignorable __function__)) (and (mbe :logic (and (alistp x) (equal (strip-cars x) '(tops types functions variables obligation-vars obligation-hyps))) :exec (fty::alist-with-carsp x '(tops types functions variables obligation-vars obligation-hyps))) (b* ((tops (cdr (std::da-nth 0 x))) (types (cdr (std::da-nth 1 x))) (functions (cdr (std::da-nth 2 x))) (variables (cdr (std::da-nth 3 x))) (obligation-vars (cdr (std::da-nth 4 x))) (obligation-hyps (cdr (std::da-nth 5 x)))) (and (toplevel-listp tops) (identifier-listp types) (function-header-listp functions) (variable-contextp variables) (typed-variable-listp obligation-vars) (obligation-hyp-listp obligation-hyps))))))
Theorem:
(defthm consp-when-contextp (implies (contextp x) (consp x)) :rule-classes :compound-recognizer)