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) (stat32ip stat)))) (let ((__function__ 'write32-mem-ubyte8)) (declare (ignorable __function__)) (change-stat32i stat :memory (update-nth (loghead 32 addr) (ubyte8-fix val) (stat32i->memory stat)))))
Theorem:
(defthm stat32ip-of-write32-mem-ubyte8 (b* ((new-stat (write32-mem-ubyte8 addr val stat))) (stat32ip 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-ubyte8-fix-val (equal (write32-mem-ubyte8 addr (ubyte8-fix val) stat) (write32-mem-ubyte8 addr val stat)))
Theorem:
(defthm write32-mem-ubyte8-ubyte8-equiv-congruence-on-val (implies (acl2::ubyte8-equiv val val-equiv) (equal (write32-mem-ubyte8 addr val stat) (write32-mem-ubyte8 addr val-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm write32-mem-ubyte8-of-stat32i-fix-stat (equal (write32-mem-ubyte8 addr val (stat32i-fix stat)) (write32-mem-ubyte8 addr val stat)))
Theorem:
(defthm write32-mem-ubyte8-stat32i-equiv-congruence-on-stat (implies (stat32i-equiv stat stat-equiv) (equal (write32-mem-ubyte8 addr val stat) (write32-mem-ubyte8 addr val stat-equiv))) :rule-classes :congruence)