• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
        • Specification
        • Executable
        • Specialized
          • Specialized-rv64im-le
          • Specialized-rv32im-le
            • Rv32im-le-semantics
            • Rv32im-le-states
            • Rv32im-le-execution
              • Step32
              • Step32n
              • Rv32im-le-features
          • Optimized
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Rv32im-le-execution

    Step32n

    Multi-step execution.

    Signature
    (step32n n stat) → new-stat
    Arguments
    n — Guard (natp n).
    stat — Guard (stat32p stat).
    Returns
    new-stat — Type (stat32p 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) (stat32p stat))))
      (cond ((zp n) (stat32-fix stat))
            ((error32p stat) (stat32-fix stat))
            (t (step32n (1- n) (step32 stat)))))

    Theorem: stat32p-of-step32n

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

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

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

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