An initial version of a Java Push Genetic Programming system is available as a zip file.
Briefly, Push is a stack-based language developed for genetic programming by Lee Spector. (See Push-GP for details.) A Push world (as implemented here) consists of agents, each of which has a number of stacks that are operated on by postfix-like programs. For example, when executed, the program (3 4 +) produces the following trace.
1. INTEGER.3: [] -> [3]
2. INTEGER.4: [3] -> [3, 4]
3. INTEGER.+: [3, 4] -> [7]
Finished executing: (3 4 +)Agent: Agent_2 {}INTEGER: [7]
CODE: [(3 4 +)]
NAME: []
FLOAT: []
BOOLEAN: []
TYPE: [NAME, TYPE, CODE, BOOLEAN, INTEGER]
The integers 3 and then 4 are pushed onto the Integer Stack. The operation + pops and then adds the top two elements of the Integer Stack and pushes the result back onto the Integer stack.
The Code Stack contains the program being executed.
As the example shows, Push agents have a separate stack for each of number of types. This facilitates type-safe programs without the need for implicit casting. Again, see Push-GP for details.
The Java code is organized into two packages: pushInterpreter and gp.