• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • 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
            • 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
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Linear-memory

    Program-at

    Predicate that makes a statement about a program's location in the memory

    Signature
    (program-at prog-addr bytes x86) → *

    We use program-at to state that a program, given by as a list of bytes, is located at contiguous addresses from prog-addr to (len bytes) + prog-addr - 1 in the memory of the x86 state. Note that this function is non-executable; we use it only for reasoning about machine-code.

    Definitions and Theorems

    Function: program-at

    (defun program-at (prog-addr bytes x86)
     (declare (xargs :stobjs (x86)))
     (declare
      (xargs
          :guard (and (canonical-address-p prog-addr)
                      (canonical-address-p (+ -1 (len bytes) prog-addr))
                      (byte-listp bytes))
          :non-executable t))
     (prog2$ (acl2::throw-nonexec-error 'program-at
                                        (list prog-addr bytes x86))
             (let ((__function__ 'program-at))
               (declare (ignorable __function__))
               (b* (((mv flg bytes-read ?x86)
                     (rb (len bytes) prog-addr :x x86)))
                 (and (equal flg nil)
                      (equal bytes-read
                             (combine-n-bytes 0 (len bytes)
                                              bytes)))))))

    Theorem: program-at-xw-in-app-view

    (defthm program-at-xw-in-app-view
      (implies (and (app-view x86)
                    (not (equal fld :mem))
                    (not (equal fld :app-view)))
               (equal (program-at addr bytes (xw fld index value x86))
                      (program-at addr bytes x86))))