• 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
            • Decoding-left-inverse
            • Decoding-executable
            • Decoding-right-inverse
            • Execution-executable
              • Stepnx
                • Stepx
              • Decoding-correct
            • Specialized
            • 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
    • Execution-executable

    Stepnx

    Executable multi-step execution function.

    This is obtained from stepn via apt::simplify, passing step-is-stepx to propagate it. The result is the same as stepn, but with a call of stepx instead of step. The generated theorem that unconditionally rewrites stepn to stepnx is stepn-to-stepnx.

    We manually propagate the fixing and state validity preservation theorems that accompany stepn to stepnx.

    Definitions and Theorems

    Function: stepnx

    (defun stepnx (n stat feat)
      (declare (xargs :guard (and (natp n)
                                  (statp stat)
                                  (featp feat)
                                  (stat-validp stat feat))))
      (cond ((zp n) (stat-fix stat))
            ((errorp stat feat) (stat-fix stat))
            (t (stepnx (1- n)
                       (stepx stat feat)
                       feat))))

    Theorem: stepn-is-stepnx

    (defthm stepn-is-stepnx
      (equal (stepn n stat feat)
             (stepnx n stat feat)))

    Theorem: stepnx-of-nfix-n

    (defthm stepnx-of-nfix-n
      (equal (stepnx (nfix n) stat feat)
             (stepnx n stat feat)))

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

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

    Theorem: stepnx-of-stat-fix-stat

    (defthm stepnx-of-stat-fix-stat
      (equal (stepnx n (stat-fix stat) feat)
             (stepnx n stat feat)))

    Theorem: stepnx-stat-equiv-congruence-on-stat

    (defthm stepnx-stat-equiv-congruence-on-stat
      (implies (stat-equiv stat stat-equiv)
               (equal (stepnx n stat feat)
                      (stepnx n stat-equiv feat)))
      :rule-classes :congruence)

    Theorem: stepnx-of-feat-fix-feat

    (defthm stepnx-of-feat-fix-feat
      (equal (stepnx n stat (feat-fix feat))
             (stepnx n stat feat)))

    Theorem: stepnx-feat-equiv-congruence-on-feat

    (defthm stepnx-feat-equiv-congruence-on-feat
      (implies (feat-equiv feat feat-equiv)
               (equal (stepnx n stat feat)
                      (stepnx n stat feat-equiv)))
      :rule-classes :congruence)

    Theorem: stat-validp-of-stepnx

    (defthm stat-validp-of-stepnx
      (implies (stat-validp stat feat)
               (stat-validp (stepnx n stat feat)
                            feat)))