Installing

Build it in its own project, and have your project reference that project.

Copy the source into your own project.

Make a .jar file yourself, and use that.

Pre-requisites

Groovy Science has been successfully built and used under Java 1.6.0 Update 7 and Groovy 1.5.1.

Documentation

Building SymbolicExpressions

The centerpiece of the library is the SymbolicExpression class. A SymbolicExpression is a representation of the "application" of an operator object to a list of other SymbolicExpressions. This makes for a simple tree structure, and it is not unlike the way Lisp code is represented in s-expressions.

The SymbolicExpression class overloads almost all of the operators that can be overloaded in Groovy. So, instead of building all expressions using expr, you can sometimes take advantage of Groovy's own syntax:

If you wanted to represent an expression like "1 + 1", you could do so as follows:

If you do that, though, you might run the risk of confusing your constants with your other operators. To help keep your constants clearly identified, you can use the ConstantOperator class: