Given some modscope, pop out n frames.
(modscope->nth n x) → top
Function:
(defun modscope->nth (n x) (declare (xargs :guard (and (natp n) (modscope-p x)))) (let ((__function__ 'modscope->nth)) (declare (ignorable __function__)) (if (zp n) (modscope-fix x) (modscope-case x :top (modscope-fix x) :nested (modscope->nth (1- n) x.upper)))))
Theorem:
(defthm modscope-p-of-modscope->nth (b* ((top (modscope->nth n x))) (modscope-p top)) :rule-classes :rewrite)
Theorem:
(defthm modscope-okp-of-modscope->nth (implies (modscope-okp x moddb) (modscope-okp (modscope->nth n x) moddb)))
Theorem:
(defthm modscope->top-of-nth (equal (modscope->top (modscope->nth n x)) (modscope->top x)))
Theorem:
(defthm modscope-okp-nth-wireoffset-lower-bound (implies (modscope-okp x moddb) (<= (modscope->wireoffset (modscope->top x)) (modscope->wireoffset (modscope->nth n x)))) :rule-classes (:rewrite :linear))
Theorem:
(defthm modscope-okp-nth-wireidx-bound (implies (and (modscope-okp x moddb) (moddb-ok moddb)) (<= (+ (modscope->wireoffset (modscope->nth n x)) (moddb-mod-totalwires (modscope->modidx (modscope->nth n x)) moddb)) (moddb-mod-totalwires (modscope->modidx (modscope->top x)) moddb))) :rule-classes (:rewrite :linear))
Theorem:
(defthm modscope->nth-of-nfix-n (equal (modscope->nth (nfix n) x) (modscope->nth n x)))
Theorem:
(defthm modscope->nth-nat-equiv-congruence-on-n (implies (nat-equiv n n-equiv) (equal (modscope->nth n x) (modscope->nth n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm modscope->nth-of-modscope-fix-x (equal (modscope->nth n (modscope-fix x)) (modscope->nth n x)))
Theorem:
(defthm modscope->nth-modscope-equiv-congruence-on-x (implies (modscope-equiv x x-equiv) (equal (modscope->nth n x) (modscope->nth n x-equiv))) :rule-classes :congruence)