• 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
            • Rv32im
              • Semantics32
              • States32
              • Execution32
                • Step32
                • Step32n
              • 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
    • Execution32

    Step32n

    Multi-step execution.

    Signature
    (step32n n stat) → new-stat
    Arguments
    n — Guard (natp n).
    stat — Guard (stat32ip stat).
    Returns
    new-stat — Type (stat32ip 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: step32n

    (defun step32n (n stat)
      (declare (xargs :guard (and (natp n) (stat32ip stat))))
      (let ((__function__ 'step32n))
        (declare (ignorable __function__))
        (cond ((zp n) (stat32i-fix stat))
              ((error32p stat) (stat32i-fix stat))
              (t (step32n (1- n) (step32 stat))))))

    Theorem: stat32ip-of-step32n

    (defthm stat32ip-of-step32n
      (b* ((new-stat (step32n n stat)))
        (stat32ip new-stat))
      :rule-classes :rewrite)

    Theorem: step32n-of-nfix-n

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

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

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

    Theorem: step32n-of-stat32i-fix-stat

    (defthm step32n-of-stat32i-fix-stat
      (equal (step32n n (stat32i-fix stat))
             (step32n n stat)))

    Theorem: step32n-stat32i-equiv-congruence-on-stat

    (defthm step32n-stat32i-equiv-congruence-on-stat
      (implies (stat32i-equiv stat stat-equiv)
               (equal (step32n n stat)
                      (step32n n stat-equiv)))
      :rule-classes :congruence)