(combine-n-bytes low num bytes) → *
Function:
(defun combine-n-bytes (low num bytes) (declare (xargs :guard (and (natp low) (natp num) (byte-listp bytes)))) (declare (xargs :guard (<= (+ low num) (len bytes)))) (let ((__function__ 'combine-n-bytes)) (declare (ignorable __function__)) (if (mbt (and (<= (+ low num) (len bytes)) (byte-listp bytes) (natp low) (natp num))) (combine-bytes (take num (nthcdr low bytes))) 0)))
Theorem:
(defthm combine-bytes-and-take-degenerate-case-1 (implies (zp n) (equal (combine-bytes (take n bytes)) 0)))
Theorem:
(defthm combine-bytes-and-take-degenerate-case-2 (equal (combine-bytes (take n nil)) 0))
Theorem:
(defthm natp-of-combine-bytes-of-take (implies (byte-listp bytes) (<= 0 (combine-bytes (take num bytes)))))
Theorem:
(defthm natp-combine-n-bytes (implies (force (byte-listp bytes)) (natp (combine-n-bytes low num bytes))) :rule-classes ((:type-prescription) (:linear :corollary (implies (byte-listp bytes) (<= 0 (combine-n-bytes low num bytes))))))
Theorem:
(defthm unsigned-byte-p-of-combine-n-bytes (implies (and (equal n (ash num 3)) (natp num)) (unsigned-byte-p n (combine-n-bytes low num bytes))))
Theorem:
(defthm size-of-combine-n-bytes (< (combine-n-bytes low num bytes) (expt 2 (ash num 3))) :rule-classes :linear)