• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
          • Evaluation
          • Program-equivalence
          • Functions
          • Packages
          • Programs
          • Interpreter
            • Interpret-loop
              • Interpret
            • Evaluation-states
          • Prime-fields
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Interpreter

    Interpret-loop

    Exhaustively apply step to an evaluation state.

    Signature
    (interpret-loop estate program) → value?
    Arguments
    estate — Guard (eval-state-p estate).
    program — Guard (programp program).
    Returns
    value? — A value-optionp.

    We stop when we reach a final state or an error state. In the first case, we return the value in the final state. In the second case, we return nil. Or we may not terminate.

    This is a program-mode executable counterpart of the logic-mode non-executable function step*.

    Definitions and Theorems

    Function: interpret-loop

    (defun
      interpret-loop (estate program)
      (declare (xargs :guard (and (eval-state-p estate)
                                  (programp program))))
      (let ((__function__ 'interpret-loop))
           (declare (ignorable __function__))
           (eval-state-case estate
                            :init (interpret-loop (step estate program)
                                                  program)
                            :trans (interpret-loop (step estate program)
                                                   program)
                            :final estate.result
                            :error nil)))