• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
            • Addr-range
            • Read-from-physical-memory
            • Write-to-physical-memory
            • Rm-low-32
              • Wm-low-32
              • Rm-low-64
              • Create-physical-address-list
              • Wm-low-64
              • Physical-address-listp
              • Physical-address-p
            • Decoding-and-spec-utils
            • Instructions
            • Register-readers-and-writers
            • X86-modes
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Physical-memory

    Rm-low-32

    Signature
    (rm-low-32 addr x86) → *

    Definitions and Theorems

    Function: rm-low-32$inline

    (defun rm-low-32$inline (addr x86)
      (declare (xargs :stobjs (x86)))
      (declare (type (unsigned-byte 52) addr))
      (declare (xargs :guard (and (not (app-view x86))
                                  (integerp addr)
                                  (<= 0 addr)
                                  (< (+ 3 addr) *mem-size-in-bytes*))))
      (if (mbt (not (app-view x86)))
          (let ((addr (mbe :logic (ifix addr) :exec addr)))
            (b* (((the (unsigned-byte 8) byte0)
                  (mbe :logic (loghead 8 (memi addr x86))
                       :exec (memi addr x86)))
                 ((the (unsigned-byte 8) byte1)
                  (mbe :logic (loghead 8 (memi (1+ addr) x86))
                       :exec (memi (1+ addr) x86)))
                 ((the (unsigned-byte 16) word0)
                  (logior (the (unsigned-byte 16) (ash byte1 8))
                          byte0))
                 ((the (unsigned-byte 8) byte2)
                  (mbe :logic (loghead 8 (memi (+ 2 addr) x86))
                       :exec (memi (+ 2 addr) x86)))
                 ((the (unsigned-byte 8) byte3)
                  (mbe :logic (loghead 8 (memi (+ 3 addr) x86))
                       :exec (memi (+ 3 addr) x86)))
                 ((the (unsigned-byte 16) word1)
                  (the (unsigned-byte 16)
                       (logior (the (unsigned-byte 16) (ash byte3 8))
                               byte2)))
                 ((the (unsigned-byte 32) dword)
                  (logior (the (unsigned-byte 32) (ash word1 16))
                          word0)))
              dword))
        0))

    Theorem: rm-low-32-in-app-view

    (defthm rm-low-32-in-app-view
      (implies (app-view x86)
               (equal (rm-low-32 p-addr x86) 0)))

    Theorem: n32p-rm-low-32

    (defthm n32p-rm-low-32
     (unsigned-byte-p 32 (rm-low-32 addr x86))
     :rule-classes
     (:rewrite
      (:type-prescription
          :corollary (natp (rm-low-32 addr x86))
          :hints
          (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp))))
      (:linear
       :corollary (and (<= 0 (rm-low-32 addr x86))
                       (< (rm-low-32 addr x86) 4294967296))
       :hints
       (("Goal"
            :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))

    Theorem: rm-low-32-xw

    (defthm rm-low-32-xw
      (implies (and (not (equal fld :mem))
                    (not (equal fld :app-view)))
               (equal (rm-low-32 addr (xw fld index val x86))
                      (rm-low-32 addr x86))))