• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
      • Apt
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Prime-field-constraint-systems
      • Proof-checker-array
      • Soft
      • Rp-rewriter
      • Farray
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Bigmem
        • Bigmem-concrete-stobj
        • Get-mem-aux
        • Get-mem
          • Write-mem$a
          • Read-mem$a
        • Regex
        • ACL2-programming-language
        • Java
        • C
        • Jfkr
        • X86isa
        • Equational
        • Cryptography
        • Where-do-i-place-my-book
        • Json
        • Built-ins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Bigmem

    Get-mem

    Get the entire contents of the memory in the form of a linear list

    Signature
    (get-mem mem) → memlist
    Arguments
    mem — Guard (memp mem).
    Returns
    memlist — Type (acl2::unsigned-byte-listp 8 memlist), given (memp mem).

    Definitions and Theorems

    Function: get-mem

    (defun
         get-mem (mem)
         (declare (xargs :stobjs (mem)))
         (declare (xargs :guard (memp mem)))
         (declare (xargs :non-executable t))
         (prog2$ (acl2::throw-nonexec-error 'get-mem
                                            (list mem))
                 (let ((__function__ 'get-mem))
                      (declare (ignorable __function__))
                      (acl2::rev (get-mem-aux (1- (expt 2 64)) mem)))))

    Theorem: return-type-of-get-mem

    (defthm return-type-of-get-mem
            (implies (memp mem)
                     (b* ((memlist (get-mem mem)))
                         (acl2::unsigned-byte-listp 8 memlist)))
            :rule-classes :rewrite)

    Theorem: rewrite-read-mem-to-nth-of-get-mem

    (defthm rewrite-read-mem-to-nth-of-get-mem
            (implies (and (unsigned-byte-p 64 i) (memp mem))
                     (equal (read-mem i mem)
                            (nth i (get-mem mem)))))

    Theorem: get-mem-after-write-mem

    (defthm get-mem-after-write-mem
            (implies (unsigned-byte-p 64 i)
                     (equal (get-mem (write-mem i v mem))
                            (update-nth i (loghead 8 v)
                                        (get-mem mem)))))