Generate Java code to build an ACL2 integer.
If the ACL2 integer is representable as a Java integer, we generate a Java integer literal. Otherwise, if it is representable as a Java long integer, we generate a Java long integer literal. Otherwise, we generate a Java big integer built out of the string representation of the ACL2 integer.
These are passed to the
Function:
(defun atj-gen-integer (integer) (declare (xargs :guard (integerp integer))) (let ((__function__ 'atj-gen-integer)) (declare (ignorable __function__)) (b* ((arg (cond ((sbyte32p integer) (atj-gen-jint integer)) ((sbyte64p integer) (atj-gen-jlong integer)) (t (atj-gen-jbigint integer))))) (jexpr-smethod *aij-type-int* "make" (list arg)))))
Theorem:
(defthm jexprp-of-atj-gen-integer (b* ((expr (atj-gen-integer integer))) (jexprp expr)) :rule-classes :rewrite)