• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
            • Reasoning-about-memory-reads-and-writes
              • Las-to-pas
              • Rb
              • Create-canonical-address-list
              • Rb-1
              • Read-from-physical-memory
              • Write-to-physical-memory
              • Wb
              • Wb-1
                • Canonical-address-listp
              • Wml256
              • Rml256
              • Wml512
              • Rml512
              • Rml128
              • Rml80
              • Program-location
              • Rml64
              • Wml128
              • Rml48
              • Rml32
              • Rml08
              • Rml16
              • Wml80
              • Wml64
              • Wml08
              • Byte-listp
              • Wml48
              • Parametric-memory-reads-and-writes
              • Combine-n-bytes
              • Wml32
              • Program-at
              • Wml16
              • Combine-bytes
              • Write-canonical-address-to-memory-user-exec
              • Write-canonical-address-to-memory
              • Riml64
              • Wml-size
              • Rml-size
              • Riml32
              • Riml16
              • Riml08
              • Wiml64
              • Wiml32
              • Wiml16
              • Wiml08
              • Wiml-size
              • Generate-xr-over-write-thms
              • Generate-write-fn-over-xw-thms
              • Generate-read-fn-over-xw-thms
              • Riml-size
            • Rflag-specifications
            • Characterizing-undefined-behavior
            • Top-level-memory
            • App-view
            • X86-decoder
            • Physical-memory
            • 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
    • Reasoning-about-memory-reads-and-writes

    Wb-1

    Signature
    (wb-1 n addr w value x86) → (mv * x86)
    Arguments
    n — Number of bytes to be written.
        Guard (natp n).
    addr — First linear address.
        Guard (integerp addr).
    w — Type of memory access: write.
    value — Guard (natp value).

    Definitions and Theorems

    Function: wb-1

    (defun wb-1 (n addr w value x86)
      (declare (xargs :stobjs (x86)))
      (declare (type (member :w) w))
      (declare (xargs :guard (and (natp n)
                                  (integerp addr)
                                  (natp value))))
      (declare (xargs :guard (canonical-address-p (+ -1 n addr))))
      (let ((__function__ 'wb-1))
        (declare (ignorable __function__))
        (if (zp n)
            (mv nil x86)
          (b* (((unless (canonical-address-p addr))
                (mv t x86))
               ((mv flg0 x86)
                (wvm08 addr (loghead 8 value) x86))
               ((when flg0) (mv flg0 x86))
               ((mv rest-flg x86)
                (wb-1 (1- n)
                      (1+ addr)
                      w (logtail 8 value)
                      x86)))
            (mv rest-flg x86)))))

    Theorem: wb-1-returns-x86p

    (defthm wb-1-returns-x86p
      (implies (x86p x86)
               (x86p (mv-nth 1 (wb-1 n addr w value x86)))))

    Theorem: wb-1-returns-no-error

    (defthm wb-1-returns-no-error
      (implies (and (canonical-address-p addr)
                    (canonical-address-p (+ -1 n addr)))
               (equal (mv-nth 0 (wb-1 n addr w value x86))
                      nil)))