(merge-unsigneds-aux width elts acc) → packed
Function:
(defun merge-unsigneds-aux (width elts acc) (declare (xargs :guard (and (natp width) (integer-listp elts) (natp acc)))) (let ((__function__ 'merge-unsigneds-aux)) (declare (ignorable __function__)) (if (atom elts) (lnfix acc) (merge-unsigneds-aux width (cdr elts) (logapp width (car elts) (lnfix acc))))))
Theorem:
(defthm natp-of-merge-unsigneds-aux (b* ((packed (merge-unsigneds-aux width elts acc))) (natp packed)) :rule-classes :type-prescription)
Theorem:
(defthm width-of-merge-unsigneds-aux (b* ((?packed (merge-unsigneds-aux width elts acc))) (unsigned-byte-p (+ (integer-length (nfix acc)) (* (nfix width) (len elts))) packed)))
Theorem:
(defthm merge-unsigneds-aux-of-nil (equal (merge-unsigneds-aux width nil acc) (nfix acc)))
Theorem:
(defthm merge-unsigneds-aux-of-cons (equal (merge-unsigneds-aux width (cons a b) acc) (merge-unsigneds-aux width b (logapp width a (nfix acc)))))