• 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
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • States32i

    Read32i-xreg-unsigned{0}

    Partially evaluate read-xreg-unsigned for the RV32I base.

    We pick feat-rv32i-le, but we could have picked any of the variants for RV32I.

    Definitions and Theorems

    Function: read32i-xreg-unsigned{0}

    (defun read32i-xreg-unsigned{0} (reg stat)
      (declare (xargs :guard (and (natp reg)
                                  (statp stat)
                                  (featp (feat-rv32i-le))
                                  (stat-validp stat (feat-rv32i-le))
                                  (< (lnfix reg)
                                     (feat->xnum (feat-rv32i-le))))))
      (let ((feat (feat-rv32i-le)))
        (b* ((reg (lnfix reg)))
          (if (= reg 0)
              0
            (unsigned-byte-fix (feat->xlen feat)
                               (nth (1- reg) (stat->xregs stat)))))))

    Theorem: read-xreg-unsigned-becomes-read32i-xreg-unsigned{0}

    (defthm read-xreg-unsigned-becomes-read32i-xreg-unsigned{0}
      (implies (equal feat (feat-rv32i-le))
               (equal (read-xreg-unsigned reg stat feat)
                      (read32i-xreg-unsigned{0} reg stat)))
      :rule-classes :rewrite)