• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
          • Specification
          • Executable
          • Specialized
            • Specialized-rv64im-le
              • Rv64im-le-semantics
              • Rv64im-le-states
                • Write64-xreg
                • Write64-xreg-32
                • Xregfile64
                • State64
                • Memory64
                • Write64-mem-ubyte64-lendian
                • Write64-mem-ubyte16-lendian
                • Write64-pc
                • Write64-mem-ubyte32-lendian
                  • Read64-mem-ubyte64-lendian
                  • Read64-mem-ubyte16-lendian
                  • Read64-xreg-unsigned
                  • Read64-mem-ubyte8
                  • Read64-mem-ubyte32-lendian
                  • Read64-xreg-unsigned32
                  • Write64-mem-ubyte8
                  • Read64-xreg-signed32
                  • Read64-xreg-signed
                  • Inc64-pc
                  • Read64-pc
                  • Error64p
                  • Error64
                  • Stat-rv64im-le-p
                  • *mem64-size*
                • Rv64im-le-execution
                • Rv64im-le-features
              • Specialized-rv32im-le
            • Optimized
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Rv64im-le-states

    Write64-mem-ubyte32-lendian

    Write an unsigned 32-bit little endian integer to memory.

    Signature
    (write64-mem-ubyte32-lendian addr val stat) → new-stat
    Arguments
    addr — Guard (integerp addr).
    val — Guard (ubyte32p val).
    stat — Guard (state64p stat).
    Returns
    new-stat — Type (state64p new-stat).

    This is similar to write64-mem-ubyte16-lendian, but with 4 bytes instead of 2.

    Definitions and Theorems

    Function: write64-mem-ubyte32-lendian

    (defun write64-mem-ubyte32-lendian (addr val stat)
      (declare (xargs :guard (and (integerp addr)
                                  (ubyte32p val)
                                  (state64p stat))))
      (b* ((val (loghead 32 val))
           (b0 (logand val 255))
           (b1 (logand (ash val -8) 255))
           (b2 (logand (ash val -16) 255))
           (b3 (ash val -24))
           (stat (write64-mem-ubyte8 addr b0 stat))
           (stat (write64-mem-ubyte8 (+ 1 (ifix addr))
                                     b1 stat))
           (stat (write64-mem-ubyte8 (+ 2 (ifix addr))
                                     b2 stat))
           (stat (write64-mem-ubyte8 (+ 3 (ifix addr))
                                     b3 stat)))
        stat))

    Theorem: state64p-of-write64-mem-ubyte32-lendian

    (defthm state64p-of-write64-mem-ubyte32-lendian
      (b* ((new-stat (write64-mem-ubyte32-lendian addr val stat)))
        (state64p new-stat))
      :rule-classes :rewrite)

    Theorem: write64-mem-ubyte32-lendian-of-ifix-addr

    (defthm write64-mem-ubyte32-lendian-of-ifix-addr
      (equal (write64-mem-ubyte32-lendian (ifix addr)
                                          val stat)
             (write64-mem-ubyte32-lendian addr val stat)))

    Theorem: write64-mem-ubyte32-lendian-int-equiv-congruence-on-addr

    (defthm write64-mem-ubyte32-lendian-int-equiv-congruence-on-addr
     (implies (acl2::int-equiv addr addr-equiv)
              (equal (write64-mem-ubyte32-lendian addr val stat)
                     (write64-mem-ubyte32-lendian addr-equiv val stat)))
     :rule-classes :congruence)

    Theorem: write64-mem-ubyte32-lendian-of-state64-fix-stat

    (defthm write64-mem-ubyte32-lendian-of-state64-fix-stat
      (equal (write64-mem-ubyte32-lendian addr val (state64-fix stat))
             (write64-mem-ubyte32-lendian addr val stat)))

    Theorem: write64-mem-ubyte32-lendian-state64-equiv-congruence-on-stat

    (defthm write64-mem-ubyte32-lendian-state64-equiv-congruence-on-stat
     (implies (state64-equiv stat stat-equiv)
              (equal (write64-mem-ubyte32-lendian addr val stat)
                     (write64-mem-ubyte32-lendian addr val stat-equiv)))
     :rule-classes :congruence)