• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • Riscv
          • Specification
          • Executable
          • Specialized
            • Specialized-features
            • Rv64im
              • Semantics64
              • States64
              • Execution64
                • Step64
                • Step64n
              • Rv32im
              • Specialized-states
            • Optimized
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • 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
    • Execution64

    Step64n

    Multi-step execution.

    Signature
    (step64n n stat) → new-stat
    Arguments
    n — Guard (natp n).
    stat — Guard (state64p stat).
    Returns
    new-stat — Type (state64p new-stat).

    We perform n steps, or fewer if the error flag is or gets set. If n is 0, we return the state unchanged.

    Definitions and Theorems

    Function: step64n

    (defun step64n (n stat)
      (declare (xargs :guard (and (natp n) (state64p stat))))
      (let ((__function__ 'step64n))
        (declare (ignorable __function__))
        (cond ((zp n) (state64-fix stat))
              ((error64p stat) (state64-fix stat))
              (t (step64n (1- n) (step64 stat))))))

    Theorem: state64p-of-step64n

    (defthm state64p-of-step64n
      (b* ((new-stat (step64n n stat)))
        (state64p new-stat))
      :rule-classes :rewrite)

    Theorem: step64n-of-nfix-n

    (defthm step64n-of-nfix-n
      (equal (step64n (nfix n) stat)
             (step64n n stat)))

    Theorem: step64n-nat-equiv-congruence-on-n

    (defthm step64n-nat-equiv-congruence-on-n
      (implies (acl2::nat-equiv n n-equiv)
               (equal (step64n n stat)
                      (step64n n-equiv stat)))
      :rule-classes :congruence)

    Theorem: step64n-of-state64-fix-stat

    (defthm step64n-of-state64-fix-stat
      (equal (step64n n (state64-fix stat))
             (step64n n stat)))

    Theorem: step64n-state64-equiv-congruence-on-stat

    (defthm step64n-state64-equiv-congruence-on-stat
      (implies (state64-equiv stat stat-equiv)
               (equal (step64n n stat)
                      (step64n n stat-equiv)))
      :rule-classes :congruence)