Convert an ACL2 list of signed 8-bit integers to a Java
(byte-array-from-sbyte8-list list) → array
Function:
(defun byte-array-from-sbyte8-list-aux (list) (declare (xargs :guard (sbyte8-listp list))) (let ((__function__ 'byte-array-from-sbyte8-list-aux)) (declare (ignorable __function__)) (cond ((endp list) nil) (t (cons (byte-value (car list)) (byte-array-from-sbyte8-list-aux (cdr list)))))))
Theorem:
(defthm byte-value-listp-of-byte-array-from-sbyte8-list-aux (b* ((comps (byte-array-from-sbyte8-list-aux list))) (byte-value-listp comps)) :rule-classes :rewrite)
Theorem:
(defthm len-of-byte-array-from-sbyte8-list-aux (b* ((?comps (byte-array-from-sbyte8-list-aux list))) (equal (len comps) (len list))))
Function:
(defun byte-array-from-sbyte8-list (list) (declare (xargs :guard (sbyte8-listp list))) (declare (xargs :guard (< (len list) (expt 2 31)))) (let ((__function__ 'byte-array-from-sbyte8-list)) (declare (ignorable __function__)) (byte-array (byte-array-from-sbyte8-list-aux list))))
Theorem:
(defthm byte-arrayp-of-byte-array-from-sbyte8-list (b* ((array (byte-array-from-sbyte8-list list))) (byte-arrayp array)) :rule-classes :rewrite)