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