Read a byte from the TTY.
(read-tty x86) → (mv byt x86)
This function reads a byte from the
Function:
(defun read-tty (x86) (declare (xargs :stobjs (x86))) (declare (xargs :guard t)) (let ((__function__ 'read-tty)) (declare (ignorable __function__)) (b* ((buf (tty-in x86)) ((when (null buf)) (mv nil x86)) (byt (car buf)) (x86 (!tty-in (cdr buf) x86))) (mv byt x86))))
Theorem:
(defthm x86p-of-read-tty.x86 (implies (x86p x86) (b* (((mv ?byt ?x86) (read-tty x86))) (x86p x86))) :rule-classes :rewrite)
Theorem:
(defthm unsigned-byte-p-8-non-nil-read-tty (implies (and (x86p x86) (mv-nth 0 (read-tty x86))) (unsigned-byte-p 8 (mv-nth 0 (read-tty x86)))))