(4veclist-from-bitlist-log-rec n origs bits) → (mv 4vecs rest-origs rest-bits)
Function:
(defun 4veclist-from-bitlist-log-rec (n origs bits) (declare (xargs :guard (and (natp n) (a4veclist-p origs) (true-listp bits)))) (declare (xargs :guard (<= (nfix n) (len origs)))) (let ((__function__ '4veclist-from-bitlist-log-rec)) (declare (ignorable __function__)) (b* (((when (zp n)) (mv nil origs bits)) ((a4vec x) (car origs)) (rest-origs (cdr origs)) ((mv 4vec1 rest-bits) (4vec-from-bitlist (len x.upper) (len x.lower) bits)) (n (1- n)) (halfn (ash n -1)) (restn (- n halfn)) ((mv 4vecs-half1 rest-origs rest-bits) (4veclist-from-bitlist-log-rec halfn rest-origs rest-bits)) ((mv 4vecs-half2 rest-origs rest-bits) (4veclist-from-bitlist-log-rec restn rest-origs rest-bits))) (mv (cons 4vec1 (append 4vecs-half1 4vecs-half2)) rest-origs rest-bits))))
Theorem:
(defthm true-listp-of-4veclist-from-bitlist-log-rec.4vecs (b* (((mv ?4vecs ?rest-origs ?rest-bits) (4veclist-from-bitlist-log-rec n origs bits))) (true-listp 4vecs)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-4veclist-from-bitlist-log-rec.rest-origs (b* (((mv ?4vecs ?rest-origs ?rest-bits) (4veclist-from-bitlist-log-rec n origs bits))) (implies (a4veclist-p origs) (a4veclist-p rest-origs))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-4veclist-from-bitlist-log-rec.rest-bits (b* (((mv ?4vecs ?rest-origs ?rest-bits) (4veclist-from-bitlist-log-rec n origs bits))) (implies (true-listp bits) (true-listp rest-bits))) :rule-classes :rewrite)
Theorem:
(defthm 4veclist-from-bitlist-log-rec-nthcdrs-origs (b* (((mv ?4vecs ?rest-origs ?rest-bits) (4veclist-from-bitlist-log-rec n origs bits))) (equal rest-origs (nthcdr n origs))))
Theorem:
(defthm 4veclist-from-bitlist-log-rec-rest-bits (b* (((mv ?4vecs ?rest-origs ?rest-bits) (4veclist-from-bitlist-log-rec n origs bits))) (equal rest-bits (nthcdr (a4veclist-length (take n origs)) bits))))
Theorem:
(defthm 4veclist-from-bitlist-log-rec-correct (b* (((mv ?4vecs ?rest-origs ?rest-bits) (4veclist-from-bitlist-log-rec n origs bits))) (implies (<= (nfix n) (len origs)) (equal 4vecs (4veclist-from-bitlist (take n origs) bits)))))
Theorem:
(defthm 4veclist-from-bitlist-in-terms-of-4veclist-from-bitlist-log-rec (b* ((n (len origs)) ((mv ?4vecs ?rest-origs ?rest-bits) (4veclist-from-bitlist-log-rec n origs bits))) (equal (4veclist-from-bitlist origs bits) 4vecs)))