• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
          • Evaluation
          • Program-equivalence
          • Functions
          • Packages
          • Programs
          • Interpreter
          • Evaluation-states
            • Eval-state
              • Eval-state-fix
              • Eval-state-case
              • Eval-state-p
                • Eval-state-equiv
                • Eval-state-init
                • Eval-state-trans
                • Eval-state-final
                • Eval-state-kind
                • Eval-state-error
              • Frame
              • Binding
              • Stack
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Eval-state

    Eval-state-p

    Recognizer for eval-state structures.

    Signature
    (eval-state-p x) → *

    Definitions and Theorems

    Function: eval-state-p

    (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: consp-when-eval-state-p

    (defthm consp-when-eval-state-p
      (implies (eval-state-p x) (consp x))
      :rule-classes :compound-recognizer)