• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • 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
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)