Variables that will occur in the Java expression generated from an ACL2 term.
(atj-vars-in-jexpr term) → vars
In the shallow embedding approach,
each Java term is translated to a Java expression
preceded by a Java block (which may be empty or not).
The block is non-empty when the term involves
lambda expressions, which become local variable assignments in Java,
and if calls, which become
A quoted constant has no variables,
and is always translated to a Java expression without variables.
Thus, we return
An ACL2 variable is translated to a corresponding variable in Java, and thus in this case we return the singleton list of the variable.
An if call is translated to a block with an
A call of a named function different from if is translated
to an expression that has subexpressions obtained by translating
the arguments of the ACL2 function call.
The expression is often a method call,
with the subexpressions being its actual arguments,
but it may also be an expression involving a Java operator (e.g.
A call of a lambda expression is translated to a Java block that assigns expressions to local variables that correspond to the formal parameters of the lambda expression, and to a Java expression obtained by translating the body of the lambda expression. Thus, in this case we return the variables recursively computed for the body of the lambda expression.
Theorem:
(defthm return-type-of-atj-vars-in-jexpr.vars (b* ((?vars (atj-vars-in-jexpr term))) (symbol-listp vars)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-atj-vars-in-jexpr-list.vars (b* ((?vars (atj-vars-in-jexpr-list terms))) (symbol-listp vars)) :rule-classes :rewrite)