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