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