• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
        • Instructions
        • States
        • Decoding
        • Encoding
        • Features
        • Semantics
        • Execution
          • Execution64
          • Execution32
            • Step32
            • Step32n
              • Feat-rv32i
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Execution32

    Step32n

    Multi-step execution.

    Signature
    (step32n n stat) → new-stat
    Arguments
    n — Guard (natp n).
    stat — Guard (state32p stat).
    Returns
    new-stat — Type (state32p 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) (state32p stat))))
      (let ((__function__ 'step32n))
        (declare (ignorable __function__))
        (cond ((zp n) (state32-fix stat))
              ((error32p stat) (state32-fix stat))
              (t (step32n (1- n) (step32 stat))))))

    Theorem: state32p-of-step32n

    (defthm state32p-of-step32n
      (b* ((new-stat (step32n n stat)))
        (state32p 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-state32-fix-stat

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

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

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