Recognizer for type-result structures.
(type-resultp x) → *
Function:
(defun type-resultp (x) (declare (xargs :guard t)) (let ((__function__ 'type-resultp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :ok)) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((types (std::da-nth 0 (cdr x))) (obligations (std::da-nth 1 (cdr x)))) (and (type-listp types) (proof-obligation-listp obligations))))) (t (and (eq (car x) :err) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((info (std::da-nth 0 (cdr x)))) (any-p info))))))))
Theorem:
(defthm consp-when-type-resultp (implies (type-resultp x) (consp x)) :rule-classes :compound-recognizer)