• 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
      • Riscv
        • Specification
        • Executable
        • Specialized
          • Specialized-features
          • Rv64im
          • Rv32im
          • Specialized-states
            • States32i
              • Stat32i
              • Memory32i
              • Xregs32i
              • Stat32i-iso
              • Stat-rv32i-p
              • Read32i-xreg-unsigned
              • Read32i-xreg-unsigned{2}
                • Read32i-xreg-unsigned{0}
                • Read32i-xreg-unsigned{1}
                • Stat32i-from-stat
                • Stat-from-stat32i
                • Read-xreg-unsigned-to-read32i-xreg-unsigned
              • States64i
              • States64e
              • States32e
          • Optimized
        • Taspi
        • Bitcoin
        • 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
        • 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
    • States32i

    Read32i-xreg-unsigned{2}

    Refine read32i-xreg-unsigned{1} to use the isomorphic states stat32i.

    Definitions and Theorems

    Function: read32i-xreg-unsigned{2}

    (defun read32i-xreg-unsigned{2} (reg stat)
     (declare
      (xargs
         :guard (and (stat32ip stat)
                     (natp reg)
                     (statp (stat-from-stat32i stat))
                     (stat-validp (stat-from-stat32i stat)
                                  '((base :rv32i) (endian :little) (m)))
                     (< reg 32))))
     (if (acl2::mbt$ (stat32ip stat))
         (if (= reg 0)
             0
           (nth (+ -1 reg)
                (stat->xregs (stat-from-stat32i stat))))
       0))

    Theorem: read32i-xreg-unsigned{2}-to-read32i-xreg-unsigned{1}

    (defthm read32i-xreg-unsigned{2}-to-read32i-xreg-unsigned{1}
     (implies
        (stat32ip stat)
        (equal (read32i-xreg-unsigned{2} reg stat)
               (read32i-xreg-unsigned{1} reg (stat-from-stat32i stat))))
     :rule-classes :rewrite)

    Theorem: read32i-xreg-unsigned{1}-to-read32i-xreg-unsigned{2}

    (defthm read32i-xreg-unsigned{1}-to-read32i-xreg-unsigned{2}
     (implies
        (stat-rv32i-p stat)
        (equal (read32i-xreg-unsigned{1} reg stat)
               (read32i-xreg-unsigned{2} reg (stat32i-from-stat stat))))
     :rule-classes :rewrite)