Write an unsigned 8-bit integer to memory.
The address is any integer, which we turn into a 32-bit unsigned address.
Function:
(defun write32-mem-ubyte8 (addr val stat) (declare (xargs :guard (and (integerp addr) (ubyte8p val) (stat32p stat)))) (change-stat32 stat :memory (update-nth (loghead 32 addr) (loghead 8 val) (stat32->memory stat))))
Theorem:
(defthm stat32p-of-write32-mem-ubyte8 (b* ((new-stat (write32-mem-ubyte8 addr val stat))) (stat32p new-stat)) :rule-classes :rewrite)
Theorem:
(defthm write32-mem-ubyte8-of-ifix-addr (equal (write32-mem-ubyte8 (ifix addr) val stat) (write32-mem-ubyte8 addr val stat)))
Theorem:
(defthm write32-mem-ubyte8-int-equiv-congruence-on-addr (implies (acl2::int-equiv addr addr-equiv) (equal (write32-mem-ubyte8 addr val stat) (write32-mem-ubyte8 addr-equiv val stat))) :rule-classes :congruence)
Theorem:
(defthm write32-mem-ubyte8-of-stat32-fix-stat (equal (write32-mem-ubyte8 addr val (stat32-fix stat)) (write32-mem-ubyte8 addr val stat)))
Theorem:
(defthm write32-mem-ubyte8-stat32-equiv-congruence-on-stat (implies (stat32-equiv stat stat-equiv) (equal (write32-mem-ubyte8 addr val stat) (write32-mem-ubyte8 addr val stat-equiv))) :rule-classes :congruence)