Given a term
(make-mv-nth-calls term n) → terms
Function:
(defun make-mv-nth-calls-aux (term i n) (declare (xargs :guard (and (pseudo-termp term) (natp i) (natp n)))) (let ((__function__ 'make-mv-nth-calls-aux)) (declare (ignorable __function__)) (if (or (not (mbt (natp i))) (not (mbt (natp n))) (>= i n)) nil (cons (cons 'mv-nth (cons (cons 'quote (cons i 'nil)) (cons term 'nil))) (make-mv-nth-calls-aux term (1+ i) n)))))
Theorem:
(defthm pseudo-term-listp-of-make-mv-nth-calls-aux (implies (pseudo-termp term) (b* ((terms (make-mv-nth-calls-aux term i n))) (pseudo-term-listp terms))) :rule-classes :rewrite)
Theorem:
(defthm len-of-make-mv-nth-calls-aux (b* ((?terms (make-mv-nth-calls-aux term i n))) (equal (len terms) (if (natp i) (nfix (- (nfix n) i)) 0))))
Function:
(defun make-mv-nth-calls (term n) (declare (xargs :guard (and (pseudo-termp term) (natp n)))) (let ((__function__ 'make-mv-nth-calls)) (declare (ignorable __function__)) (make-mv-nth-calls-aux term 0 n)))
Theorem:
(defthm pseudo-term-listp-of-make-mv-nth-calls (implies (pseudo-termp term) (b* ((terms (make-mv-nth-calls term n))) (pseudo-term-listp terms))) :rule-classes :rewrite)
Theorem:
(defthm len-of-make-mv-nth-calls (b* ((?terms (make-mv-nth-calls term n))) (equal (len terms) (nfix n))))