Read an unsigned 8-bit integer from memory.
The address is any integer, which we turn into a 64-bit unsigned address. We return the byte at that memory address, directly.
Function:
(defun read64-mem-ubyte8 (addr stat) (declare (xargs :guard (and (integerp addr) (state64p stat)))) (let ((__function__ 'read64-mem-ubyte8)) (declare (ignorable __function__)) (b* ((addr (loghead 64 addr))) (nth addr (state64->mem stat)))))
Theorem:
(defthm ubyte8p-of-read64-mem-ubyte8 (b* ((val (read64-mem-ubyte8 addr stat))) (ubyte8p val)) :rule-classes :rewrite)
Theorem:
(defthm natp-of-read64-mem-ubyte8 (b* ((val (read64-mem-ubyte8 addr stat))) (natp val)) :rule-classes :type-prescription)
Theorem:
(defthm read64-mem-ubyte8-upper-bound (b* ((?val (read64-mem-ubyte8 addr stat))) (< val 256)) :rule-classes :linear)
Theorem:
(defthm read64-mem-ubyte8-of-ifix-addr (equal (read64-mem-ubyte8 (ifix addr) stat) (read64-mem-ubyte8 addr stat)))
Theorem:
(defthm read64-mem-ubyte8-int-equiv-congruence-on-addr (implies (acl2::int-equiv addr addr-equiv) (equal (read64-mem-ubyte8 addr stat) (read64-mem-ubyte8 addr-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm read64-mem-ubyte8-of-state64-fix-stat (equal (read64-mem-ubyte8 addr (state64-fix stat)) (read64-mem-ubyte8 addr stat)))
Theorem:
(defthm read64-mem-ubyte8-state64-equiv-congruence-on-stat (implies (state64-equiv stat stat-equiv) (equal (read64-mem-ubyte8 addr stat) (read64-mem-ubyte8 addr stat-equiv))) :rule-classes :congruence)