A combination in functionality of x86-run-steps and x86-run-halt
Run
Function:
(defun x86-run-halt-count (halt-address n x86 n0) (declare (xargs :stobjs (x86))) (declare (type (signed-byte 48) halt-address) (type (unsigned-byte 59) n) (type (unsigned-byte 59) n0)) (declare (xargs :guard (<= n n0))) (let ((__function__ 'x86-run-halt-count)) (declare (ignorable __function__)) (if (mbt (<= n n0)) (cond ((or (fault x86) (ms x86) (mbe :logic (zp n) :exec (equal 0 n))) (mv (the (unsigned-byte 59) (- n0 n)) x86)) (t (let* ((x86 (x86-fetch-decode-execute-halt halt-address x86)) (n (the (unsigned-byte 59) (1- n)))) (x86-run-halt-count halt-address n x86 n0)))) (mv 0 x86))))
Theorem:
(defthm natp-of-x86-run-halt-count.steps (implies (and (natp n0) (natp n)) (b* (((mv ?steps ?x86) (x86-run-halt-count halt-address n x86 n0))) (natp steps))) :rule-classes :type-prescription)
Theorem:
(defthm x86p-of-x86-run-halt-count.x86 (implies (x86p x86) (b* (((mv ?steps ?x86) (x86-run-halt-count halt-address n x86 n0))) (x86p x86))) :rule-classes :rewrite)