Recognizer for eval-state structures.
(eval-state-p x) → *
Function:
(defun eval-state-p (x) (declare (xargs :guard t)) (let ((__function__ 'eval-state-p)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :init)) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((function (std::da-nth 0 (cdr x))) (arguments (std::da-nth 1 (cdr x)))) (and (symbol-valuep function) (value-listp arguments))))) ((eq (car x) :trans) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((stack (std::da-nth 0 (cdr x)))) (stackp stack)))) ((eq (car x) :final) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((result (std::da-nth 0 (cdr x)))) (valuep result)))) (t (and (eq (car x) :error) (and (true-listp (cdr x)) (eql (len (cdr x)) 0)) (b* nil t)))))))
Theorem:
(defthm consp-when-eval-state-p (implies (eval-state-p x) (consp x)) :rule-classes :compound-recognizer)