Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.Cli/Program.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.Cli/Program.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.Cli/Program.cs	(revision 14602)
@@ -26,19 +26,19 @@
 
       Console.WriteLine("\nPress any key to continue...");
+
+      //if (args.Length == 0) return;
+
+      //var code = args[0];
+      //EvaluateStepwise(code).Wait();
+
       Console.ReadKey();
     }
 
-    static void SimpleTest() {
-      var interpreter = new PushGpInterpreter();
-
-      interpreter.Interpret("5 INTEGER.DUP INTEGER.+");
-
-      interpreter.PrintStacks();
-    }
-
-    static async Task Stepwise() {
-      var interpreter = new PushGpInterpreter();
-
-      interpreter.InterpretAsync("( 0 2 CODE.QUOTE ( 1 INTEGER.+ 0 3 CODE.QUOTE ( 1 INTEGER.+ INTEGER.* ) CODE.DO*RANGE INTEGER.+ ) CODE.DO*RANGE )", true).Wait();
+    static async Task EvaluateStepwise(string code) {
+      var interpreter = new PushGpInterpreter(new Configuration {
+        TopLevelPushCode = false
+      });
+
+      interpreter.RunAsync(code, true).Wait();
 
       while (!interpreter.IsCompleted) {
@@ -59,4 +59,34 @@
     }
 
+    static void SimpleTest() {
+      var interpreter = new PushGpInterpreter();
+
+      interpreter.Run("5 INTEGER.DUP INTEGER.+");
+
+      interpreter.PrintStacks();
+    }
+
+    static async Task Stepwise() {
+      var interpreter = new PushGpInterpreter();
+
+      interpreter.RunAsync("( 0 2 CODE.QUOTE ( 1 INTEGER.+ 0 3 CODE.QUOTE ( 1 INTEGER.+ INTEGER.* ) CODE.DO*RANGE INTEGER.+ ) CODE.DO*RANGE )", true).Wait();
+
+      while (!interpreter.IsCompleted) {
+        Console.Clear();
+        interpreter.PrintStacks();
+        interpreter.Step();
+
+        var input = Console.ReadKey();
+        if (input.Key == ConsoleKey.Escape) {
+          break;
+        } else if (input.Key == ConsoleKey.Spacebar) {
+          await interpreter.ResumeAsync();
+        }
+      }
+
+      Console.Clear();
+      interpreter.PrintStacks();
+    }
+
     static void PerformanceTestInterpreter() {
       var program = PushGPParser.Parse("( 5 INTEGER.DUP INTEGER.+ )");
@@ -67,5 +97,5 @@
       sw.Start();
       for (var i = 0; i < 60000000; i++) {
-        interpreter.Interpret(program);
+        interpreter.Run(program);
         interpreter.Clear();
       }
@@ -94,5 +124,5 @@
 
           for (var j = 0; j < amount; j++) {
-            interpreter.Interpret(program);
+            interpreter.Run(program);
             interpreter.Clear();
           }
@@ -111,5 +141,5 @@
       sw.Stop();
 
-      Console.WriteLine(string.Format("Generated {0} in {1}", expressions.Count(), sw.Elapsed));
+      Console.WriteLine("Generated {0} in {1}", expressions.Count(), sw.Elapsed);
     }
 
@@ -131,5 +161,5 @@
             var program = CodeGenerator.RandomProgram(maxProgramSizeLimit);
 
-            interpreter.Interpret(program);
+            interpreter.Run(program);
 
             execCounters[i] += interpreter.ExecCounter;
@@ -150,5 +180,5 @@
 
       using (var interpreter = pool.GetInstance()) {
-        interpreter.Interpret("( 1 2 INTEGER.+ )");
+        interpreter.Run("( 1 2 INTEGER.+ )");
 
         id = interpreter.GetHashCode();
@@ -158,5 +188,5 @@
       using (var interpreter = pool.GetInstance())
       using (var interpreter2 = pool.GetInstance()) {
-        interpreter.Interpret("( 1 2 INTEGER.+ )");
+        interpreter.Run("( 1 2 INTEGER.+ )");
         if (id == interpreter.GetHashCode()) Console.WriteLine("equal 2");
         if (id == interpreter2.GetHashCode()) Console.WriteLine("equal 3");
@@ -198,5 +228,5 @@
         solution => {
           interpreter.Clear();
-          interpreter.Interpret(solution);
+          interpreter.Run(solution);
           return interpreter.IntegerStack.Top == 10;
         });
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Attributes/PushExpressionAttriubte.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Attributes/PushExpressionAttriubte.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Attributes/PushExpressionAttriubte.cs	(revision 14602)
@@ -0,0 +1,14 @@
+﻿using System;
+
+namespace HeuristicLab.Algorithms.PushGP.Attributes {
+  [AttributeUsage(AttributeTargets.Class)]
+  public class PushExpressionAttribute : Attribute {
+    public readonly string StackName;
+    public readonly string ExpressionName;
+
+    public PushExpressionAttribute(string stackName, string expressionName) {
+      this.StackName = stackName;
+      this.ExpressionName = expressionName;
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Data/Pool/ObjectPool.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Data/Pool/ObjectPool.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Data/Pool/ObjectPool.cs	(revision 14602)
@@ -25,5 +25,5 @@
   ///    If there is no intent for reusing the object, do not use pool - just use "new".
   /// </summary>
-  internal sealed class ObjectPool<T> where T : class, IRecyclable {
+  internal sealed class ObjectPool<T> where T : class {
     private struct Element {
       internal T Value;
@@ -71,5 +71,4 @@
         if (inst != null) {
           if (inst == Interlocked.CompareExchange(ref items[i].Value, null, inst)) {
-            inst.Recycle();
             goto gotInstance;
           }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Data/Random/RandomFactory.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Data/Random/RandomFactory.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Data/Random/RandomFactory.cs	(revision 14602)
@@ -1,4 +1,5 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Data.Random {
   using System;
+  using System.Collections.Generic;
   using System.Threading;
 
@@ -9,12 +10,27 @@
     public static readonly RandomFactory Instance = new RandomFactory();
 
+    private static int seed;
+    private static IList<IRandom> randoms = new List<IRandom>();
+
     static RandomFactory() {
       Seed = Environment.TickCount;
     }
 
-    public static int Seed;
+    public static int Seed
+    {
+      get { return seed; }
+      set
+      {
+        seed = value;
+
+        for (var i = 0; i < randoms.Count; i++) {
+          randoms[i].Reset(seed);
+        }
+      }
+    }
 
     public static ThreadLocal<IRandom> GetRandom() {
-      return new ThreadLocal<IRandom>(() => new FastRandom(Seed/*Interlocked.Increment(ref Seed)*/));
+      /*Interlocked.Increment(ref Seed)*/
+      return new ThreadLocal<IRandom>(() => new FastRandom(Seed));
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/BooleanExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/BooleanExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/BooleanExpressions.cs	(revision 14602)
@@ -5,9 +5,7 @@
   ///     Pushes the logical AND of the top two BOOLEANs.
   /// </summary>
+  //[PushExpression("BOOLEAN", "AND")]
   public class BooleanAndExpression : PushResultExpression<bool> {
-    protected override string InitStringRepresentation() {
-      return "BOOLEAN.AND";
-    }
-
+    public BooleanAndExpression() : base("BOOLEAN.AND") { }
     public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(interpreter.BooleanStack, 2, values => values[0] && values[1]);
@@ -18,8 +16,7 @@
   ///     Pushes the logical OR of the top two BOOLEANs.
   /// </summary>
+  //[PushExpression("BOOLEAN", "OR")]
   public class BooleanOrExpression : PushResultExpression<bool> {
-    protected override string InitStringRepresentation() {
-      return "BOOLEAN.OR";
-    }
+    public BooleanOrExpression() : base("BOOLEAN.OR") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -31,8 +28,7 @@
   ///     Pushes the logical NOT of the top BOOLEAN.
   /// </summary>
+  //[PushExpression("BOOLEAN", "NOT")]
   public class BooleanNotExpression : PushResultExpression<bool> {
-    protected override string InitStringRepresentation() {
-      return "BOOLEAN.NOT";
-    }
+    public BooleanNotExpression() : base("BOOLEAN.NOT") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -45,7 +41,5 @@
   /// </summary>
   public class BooleanFromFloatExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "BOOLEAN.FROMFLOAT";
-    }
+    public BooleanFromFloatExpression() : base("BOOLEAN.FROMFLOAT") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -62,7 +56,5 @@
   /// </summary>
   public class BooleanFromIntegerExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "BOOLEAN.FROMINTEGER";
-    }
+    public BooleanFromIntegerExpression() : base("BOOLEAN.FROMINTEGER") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/CodeExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/CodeExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/CodeExpressions.cs	(revision 14602)
@@ -5,802 +5,888 @@
 /// </summary>
 
-namespace HeuristicLab.Algorithms.PushGP.Expressions {
-  using System;
-  using System.Collections.Generic;
-  using System.Linq;
-
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-
-  /// <summary>
-  ///     Recursively invokes the interpreter on the program on top of the CODE stack. After evaluation the
-  ///     CODE stack is popped; normally this pops the program that was just executed, but if the expression itself
-  ///     manipulates the stack then this final pop may end up popping something else.
-  /// </summary>
-  public class CodeDoExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.DO";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      // not enough arguments on stack
-      if (interpreter.CodeStack.Count == 0) return;
-
-      interpreter.ExecStack.Push(new CodePopExpression(), interpreter.CodeStack.Top);
-    }
-  }
-
-  /// <summary>
-  ///     Like CODE.DO but pops the stack before, rather than after, the recursive execution
-  /// </summary>
-  public class CodeDoXExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.DO*";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      // not enough arguments on stack
-      if (interpreter.CodeStack.Count == 0) return;
-
-      var expression = interpreter.CodeStack.Pop();
-      interpreter.ExecStack.Push(expression);
-    }
-  }
-
-  /// <summary>
-  ///     Does nothing.
-  /// </summary>
-  public class CodeNoopExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.NOOP";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      // nothing to do
-    }
-  }
-
-  /// <summary>
-  ///     Specifies that the next expression submitted for execution will instead be pushed literally onto the CODE stack.
-  ///     This can be implemented by moving the top item on the EXEC stack onto the CODE stack.
-  /// </summary>
-  public class CodeQuoteExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.QUOTE";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      // not enough arguments on stack
-      if (interpreter.ExecStack.Count == 0) return;
-
-      var expression = interpreter.ExecStack.Pop();
-      interpreter.CodeStack.Push(expression);
-    }
-  }
-
-  /// <summary>
-  ///     If the top item of the BOOLEAN stack is TRUE this recursively executes the second item of the CODE stack;
-  ///     otherwise it recursively executes the first item of the CODE stack. Either way both elements of the CODE stack
-  ///     (and the BOOLEAN value upon which the decision was made) are popped.
-  /// </summary>
-  public class CodeIfExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.IF";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      // not enough arguments on stack
-      if ((interpreter.BooleanStack.Count == 0) || (interpreter.CodeStack.Count < 2)) return;
-
-      var condition = interpreter.BooleanStack.Pop();
-      var items = interpreter.CodeStack.Pop(2);
-
-      interpreter.ExecStack.Push(condition ? items[0] : items[1]);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the result of appending the top two pieces of code. If one of the pieces of code is a single instruction or
-  ///     literal (that is, something not surrounded by parentheses) then it is surrounded by parentheses first.
-  /// </summary>
-  public class CodeAppendExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.APPEND";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count < 2) return;
-
-      var first = interpreter.CodeStack.Pop();
-      var second = interpreter.CodeStack.Top;
-
-      var isFirstList = first.GetType() == typeof(ExecExpandExpression);
-      var isSecondList = second.GetType() == typeof(ExecExpandExpression);
-
-      Expression[] result = null;
-
-      if (isFirstList) {
-        var expand1 = first as ExecExpandExpression;
-
-        if (isSecondList) {
-          var expand2 = second as ExecExpandExpression;
-          var size = expand2.Expressions.Count + expand1.Expressions.Count;
-
-          // if size > maxPointsInProgram this expressions results in a NOOP
-          if (size > interpreter.Configuration.MaxPointsInProgram) return;
-
-          result = new Expression[size];
-
-          Array.Copy(expand2.Expressions as Expression[], result, expand2.Expressions.Count);
-          Array.Copy(
-            expand1.Expressions as Expression[],
-            0,
-            result,
-            expand2.Expressions.Count,
-            expand1.Expressions.Count);
-        } else {
-          var size = expand1.Expressions.Count + 1;
-
-          // if size > maxPointsInProgram this expressions results in a NOOP
-          if (size > interpreter.Configuration.MaxPointsInProgram) return;
-
-          result = new Expression[size];
-          result[0] = second;
-
-          Array.Copy(expand1.Expressions as Expression[], 0, result, 1, expand1.Expressions.Count);
-        }
-      } else if (isSecondList) {
-        var expand2 = second as ExecExpandExpression;
-
-        var size = expand2.Expressions.Count + 1;
-
-        // if size > maxPointsInProgram this expressions results in a NOOP
-        if (size > interpreter.Configuration.MaxPointsInProgram) return;
-
-        result = new Expression[size];
-        result[0] = first;
-
-        Array.Copy(expand2.Expressions as Expression[], 0, result, 1, expand2.Expressions.Count);
-      } else {
-        result = new[] { second, first };
-      }
-
-      var expression = new ExecExpandExpression(result);
-
-      interpreter.CodeStack.SetTop(expression);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the top piece of code is a single instruction or a literal,
-  ///     and FALSE otherwise (that is, if it is something surrounded by parentheses).
-  /// </summary>
-  public class CodeAtomExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.ATOM";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count == 0) return;
-
-      var expression = interpreter.CodeStack.Pop();
-      var isExpandExpression = expression.GetType() != typeof(ExecExpandExpression);
-
-      interpreter.BooleanStack.Push(isExpandExpression);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the first item of the list on top of the CODE stack. For example, if the top piece of code is "( A B )"
-  ///     then this pushes "A" (after popping the argument). If the code on top of the stack is not a list then this has no
-  ///     effect.
-  ///     The name derives from the similar Lisp function; a more generic name would be "FIRST".
-  /// </summary>
-  public class CodeCarExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.CAR";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.CodeStack.Count == 0) || (interpreter.CodeStack.Top.GetType() != typeof(ExecExpandExpression))) return;
-
-      var expand = interpreter.CodeStack.Top as ExecExpandExpression;
-
-      if (!expand.IsEmpty) {
-        var first = expand.Expressions[expand.Expressions.Count - 1];
-
-        interpreter.CodeStack.SetTop(first);
-      }
-    }
-  }
-
-  /// <summary>
-  ///     Pushes a version of the list from the top of the CODE stack without its first element.
-  ///     For example, if the top piece of code is "( A B )" then this pushes "( B )" (after popping the argument).
-  ///     If the code on top of the stack is not a list then this pushes the empty list ("( )"). The name derives from
-  ///     the similar Lisp function; a more generic name would be "REST".
-  /// </summary>
-  public class CodeCdrExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.CDR";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count == 0) return;
-
-      Expression expandExpression = null;
-      var top = interpreter.CodeStack.Top;
-
-      if (top.GetType() == typeof(ExecExpandExpression)) {
-        var expand = top as ExecExpandExpression;
-
-        if (expand.IsEmpty) return;
-        var length = expand.Expressions.Count - 1;
-        var newExpressions = new Expression[length];
-
-        Array.Copy(expand.Expressions as Expression[], 0, newExpressions, 0, length);
-
-        expandExpression = new ExecExpandExpression(newExpressions);
-      } else {
-        expandExpression = ExecExpandExpression.Empty;
-      }
-
-      interpreter.CodeStack.SetTop(expandExpression);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the result of "consing" (in the Lisp sense) the second stack item onto the first stack item
-  ///     (which is coerced to a list if necessary). For example, if the top piece of code is "( A B )" and the
-  ///     second piece of code is "X" then this pushes "( X A B )" (after popping the argument).
-  /// </summary>
-  public class CodeConsExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.CONS";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.CodeStack.Count < 2)
-          || (interpreter.CodeStack[interpreter.CodeStack.Count - 1].GetType() != typeof(ExecExpandExpression))) return;
-
-      var first = interpreter.CodeStack.Pop() as ExecExpandExpression;
-
-      var size = first.Expressions.Count + 1;
-
-      if (size > interpreter.Configuration.MaxPointsInProgram) return;
-
-      var expressions = new Expression[size];
-
-      expressions[first.Expressions.Count] = interpreter.CodeStack.Top;
-      Array.Copy(first.Expressions as Expression[], expressions, first.Expressions.Count);
-
-      var result = new ExecExpandExpression(expressions);
-      interpreter.CodeStack.SetTop(result);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the "container" of the second CODE stack item within the first CODE stack item onto the CODE stack.
-  ///     If second item contains the first anywhere (i.e. in any nested list) then the container is the smallest sub-list
-  ///     that contains but is not equal to the first instance. For example, if the top piece of code is "( B ( C ( A ) ) ( D
-  ///     ( A ) ) )"
-  ///     and the second piece of code is "( A )" then this pushes ( C ( A ) ). Pushes an empty list if there is no such
-  ///     container.
-  /// </summary>
-  public class CodeContainerExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.CONTAINER";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.CodeStack.Count < 2)
-          || (interpreter.CodeStack[interpreter.CodeStack.Count - 2].GetType() != typeof(ExecExpandExpression))) return;
-
-      var target = interpreter.CodeStack.Pop();
-      var source = interpreter.CodeStack.Top;
-
-      var container = this.GetContainer(null, source as ExecExpandExpression, target);
-      var result = container == null ? ExecExpandExpression.Empty : container;
-
-      interpreter.CodeStack.SetTop(result);
-    }
-
-    private ExecExpandExpression GetContainer(
-      ExecExpandExpression parent,
-      ExecExpandExpression current,
-      Expression target) {
-      var subContainer =
-        current.Expressions.Where(e => e.GetType() == typeof(ExecExpandExpression))
-          .Select(e => this.GetContainer(current, e as ExecExpandExpression, target))
-          .Where(e => e != null);
-
-      if (subContainer.Any()) return subContainer.OrderBy(c => c.Expressions.Count).LastOrDefault();
-      return current.Expressions.Contains(target) ? current : null;
-    }
-  }
-
-  /// <summary>
-  ///     Pushes TRUE on the BOOLEAN stack if the second CODE stack item contains the first CODE stack
-  ///     item anywhere (e.g. in a sub-list).
-  /// </summary>
-  public class CodeContainsExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.CONTAINS";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.CodeStack.Count < 2)
-          || (interpreter.CodeStack[interpreter.CodeStack.Count - 2].GetType() != typeof(ExecExpandExpression))) return;
-
-      var values = interpreter.CodeStack.Pop(2);
-      var second = values[0] as ExecExpandExpression;
-
-      interpreter.BooleanStack.Push(second.Expressions.Contains(values[1]));
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the definition associated with the top NAME on the NAME stack (if any) onto the CODE stack.
-  ///     This extracts the definition for inspection/manipulation, rather than for immediate execution (although it
-  ///     may then be executed with a call to CODE.DO or a similar instruction).
-  /// </summary>
-  public class CodeDefinitionExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.DEFINITION";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.NameStack.Count == 0) || !interpreter.CustomExpressions.ContainsKey(interpreter.NameStack.Top)) return;
-
-      var name = interpreter.NameStack.Pop();
-      var definition = interpreter.CustomExpressions[name];
-
-      interpreter.CodeStack.Push(definition);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes a measure of the discrepancy between the top two CODE stack items onto the INTEGER stack. This will be zero
-  ///     if the top
-  ///     two items are equivalent, and will be higher the 'more different' the items are from one another. The calculation
-  ///     is as follows:
-  ///     <list type="bullet">
-  ///         <item>
-  ///             <description>
-  ///                 Construct a list of all of the unique items in both of the lists(where uniqueness is determined by
-  ///                 equalp).
-  ///                 Sub-lists and atoms all count as items.
-  ///         </item>
-  ///         <item>
-  ///             <description>Initialize the result to zero.
-  ///         </item>
-  ///         <item>
-  ///             <description>
-  ///                 For each unique item increment the result by the difference between the number of occurrences of the
-  ///                 item in
-  ///                 the two pieces of code.
-  ///         </item>
-  ///         <item>
-  ///             <description>Push the result.
-  ///         </item>
-  ///     </list>
-  /// </summary>
-  public class CodeDiscrepancyExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.DISCREPANCY";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count < 2) return;
-
-      var expressions = interpreter.CodeStack.Pop(2);
-      var firstItems = new Dictionary<int, int>();
-      var secondItems = new Dictionary<int, int>();
-
-      this.DetermineUniqueItems(expressions[0], secondItems);
-      this.DetermineUniqueItems(expressions[1], firstItems);
-
-      var discrepancy = this.GetDiscrepancy(firstItems, secondItems);
-
-      interpreter.IntegerStack.Push(discrepancy);
-    }
-
-    private int GetDiscrepancy(IDictionary<int, int> first, IDictionary<int, int> second) {
-      var discrepancy = 0;
-      var keys = first.Keys.Concat(second.Keys).Distinct();
-
-      foreach (var key in keys)
-        if (first.ContainsKey(key) && second.ContainsKey(key)) discrepancy += Math.Abs(first[key] - second[key]);
-        else if (first.ContainsKey(key)) discrepancy += first[key];
-        else discrepancy += second[key];
-
-      return discrepancy;
-    }
-
-    private void DetermineUniqueItems(Expression source, IDictionary<int, int> items) {
-      if (source.GetType() == typeof(ExecExpandExpression)) {
-        var expand = source as ExecExpandExpression;
-
-        foreach (var e in expand.Expressions) {
-          var id = e.GetHashCode();
-          if (!items.ContainsKey(id)) items.Add(id, 1);
-          else items[id]++;
-        }
-      } else {
-        items.Add(source.GetHashCode(), 1);
-      }
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the sub-expression of the top item of the CODE stack that is indexed by the top item of the INTEGER stack.
-  ///     The indexing here counts "points," where each parenthesized expression and each literal/instruction is considered a
-  ///     point,
-  ///     and it proceeds in depth first order. The entire piece of code is at index 0; if it is a list then the first item
-  ///     in the list
-  ///     is at index 1, etc. The integer used as the index is taken modulo the number of points in the overall expression
-  ///     (and its
-  ///     absolute value is taken in case it is negative) to ensure that it is within the meaningful range.
-  /// </summary>
-  public class CodeExtractExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.EXTRACT";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.IntegerStack.Count == 0) || (interpreter.CodeStack.Count == 0)
-          || (interpreter.CodeStack.Top.GetType() != typeof(ExecExpandExpression))) return;
-
-      var expression = interpreter.CodeStack.Top as ExecExpandExpression;
-      var index = (int)Math.Abs(interpreter.IntegerStack.Pop() % expression.TotalCount);
-      var result = expression.GetFromTree(index);
-
-      interpreter.CodeStack.SetTop(result);
-    }
-  }
-
-  /// <summary>
-  ///     Pops the BOOLEAN stack and pushes the popped item (TRUE or FALSE) onto the CODE stack.
-  /// </summary>
-  public class CodeFromBooleanExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.FROMBOOLEAN";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.BooleanStack.Count == 0) return;
-
-      var value = interpreter.BooleanStack.Pop();
-      var expression = new BooleanPushExpression(value);
-
-      interpreter.CodeStack.Push(expression);
-    }
-  }
-
-  /// <summary>
-  ///     Pops the FLOAT stack and pushes the popped item onto the CODE stack.
-  /// </summary>
-  public class CodeFromFloatExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.FROMFLOAT";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.FloatStack.Count == 0) return;
-
-      var value = interpreter.FloatStack.Pop();
-      var expression = new FloatPushExpression(value);
-
-      interpreter.CodeStack.Push(expression);
-    }
-  }
-
-  /// <summary>
-  ///     Pops the INTEGER stack and pushes the popped integer onto the CODE stack.
-  /// </summary>
-  public class CodeFromIntegerExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.FROMINTEGER";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.IntegerStack.Count == 0) return;
-
-      var value = interpreter.IntegerStack.Pop();
-      var expression = new IntegerPushExpression(value);
-
-      interpreter.CodeStack.Push(expression);
-    }
-  }
-
-  /// <summary>
-  ///     Pops the NAME stack and pushes the popped item onto the CODE stack.
-  /// </summary>
-  public class CodeFromNameExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.FROMNAME";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.NameStack.Count == 0) return;
-
-      var value = interpreter.NameStack.Pop();
-      var expression = new NameDefineXExecExpression(value);
-
-      interpreter.CodeStack.Push(expression);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the result of inserting the second item of the CODE stack into the first item, at the position indexed
-  ///     by the top item of the INTEGER stack (and replacing whatever was there formerly).
-  /// </summary>
-  public class CodeInsertExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.INSERT";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.IntegerStack.Count == 0) || (interpreter.CodeStack.Count < 2)
-          || (interpreter.CodeStack.Top.GetType() != typeof(ExecExpandExpression))) return;
-
-      var source = interpreter.CodeStack[interpreter.CodeStack.Count - 2];
-      var target = interpreter.CodeStack.Pop() as ExecExpandExpression;
-      var index = (int)interpreter.IntegerStack.Pop();
-
-      Expression[] newExpressions;
-      if (target.Expressions.Count > 0) {
-        index = target.Expressions.Count - 1 - Math.Abs(index % target.Expressions.Count);
-
-        newExpressions = target.CopyExpressions();
-        newExpressions[index] = source.GetType() == typeof(ExecExpandExpression)
-          ? (source as ExecExpandExpression).Copy()
-          : source;
-      } else {
-        newExpressions = new[] { source };
-      }
-
-      var result = new ExecExpandExpression(newExpressions);
-      interpreter.CodeStack.SetTop(result);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the length of the top item on the CODE stack onto the INTEGER stack.
-  ///     If the top item is not a list then this pushes a 1. If the top item is a list then this pushes the
-  ///     number of items in the top level of the list; that is, nested lists contribute only 1 to this count, no
-  ///     matter what they contain.
-  /// </summary>
-  public class CodeLengthExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.LENGTH";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count == 0) return;
-
-      var expression = interpreter.CodeStack.Pop();
-      var count = 1;
-
-      if (expression.GetType() == typeof(ExecExpandExpression)) count = (expression as ExecExpandExpression).Expressions.Count;
-
-      interpreter.IntegerStack.Push(count);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes a list of the top two items of the CODE stack onto the CODE stack.
-  /// </summary>
-  public class CodeListExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.LIST";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count < 2) return;
-
-      var first = interpreter.CodeStack.Pop();
-      var second = interpreter.CodeStack.Top;
-
-      var expandExpression = new ExecExpandExpression(new[] { second, first });
-
-      interpreter.CodeStack.SetTop(expandExpression);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the second item of the CODE stack is a member of the first item
-  ///     (which is coerced to a list if necessary). Pushes FALSE onto the BOOLEAN stack otherwise.
-  /// </summary>
-  public class CodeMemberExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.MEMBER";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count < 2) return;
-
-      var expressions = interpreter.CodeStack.Pop(2);
-
-      var contains = expressions[1].GetType() == typeof(ExecExpandExpression)
-                       ? (expressions[1] as ExecExpandExpression).Expressions.Contains(expressions[0])
-                       : expressions[1].Equals(expressions[0]);
-
-      interpreter.BooleanStack.Push(contains);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the nth element of the expression on top of the CODE stack (which is coerced to a list first if necessary).
-  ///     If the expression is an empty list then the result is an empty list. N is taken from the INTEGER stack and is taken
-  ///     modulo the length of the expression into which it is indexing.
-  /// </summary>
-  public class CodeNthExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.NTH";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.CodeStack.Count == 0) || (interpreter.IntegerStack.Count == 0)) return;
-
-      var n = interpreter.IntegerStack.Pop();
-      var expression = interpreter.CodeStack.Top;
-
-      Expression nthExpression = null;
-
-      if (expression.GetType() == typeof(ExecExpandExpression)) {
-        var subExpression = expression as ExecExpandExpression;
-
-        if (subExpression.IsEmpty) {
-          nthExpression = ExecExpandExpression.Empty;
-        } else {
-          var index = (int)(subExpression.Expressions.Count - 1 - Math.Abs(n % subExpression.Expressions.Count));
-
-          nthExpression = subExpression.Expressions[index];
-        }
-      } else {
-        nthExpression = expression;
-      }
-
-      interpreter.CodeStack.SetTop(nthExpression);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the nth "CDR" (in the Lisp sense) of the expression on top of the CODE stack (which is coerced to a list
-  ///     first if necessary). If the expression is an empty list then the result is an empty list. N is taken from the
-  ///     INTEGER
-  ///     stack and is taken modulo the length of the expression into which it is indexing. A "CDR" of a list is the list
-  ///     without
-  ///     its first element.
-  /// </summary>
-  public class CodeNthCdrExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.NTHCDR";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.CodeStack.Count == 0) || (interpreter.IntegerStack.Count == 0)) return;
-
-      var n = interpreter.IntegerStack.Pop();
-      var expression = interpreter.CodeStack.Top;
-
-      Expression nthExpression = null;
-
-      if (expression.GetType() == typeof(ExecExpandExpression)) {
-        var subExpressions = (expression as ExecExpandExpression).Expressions;
-
-        if (subExpressions.Count < 2) {
-          nthExpression = ExecExpandExpression.Empty;
-        } else {
-          var index = (int)(subExpressions.Count - 2 - Math.Abs(n % (subExpressions.Count - 1)));
-
-          nthExpression = subExpressions[index];
-        }
-      } else {
-        nthExpression = expression;
-      }
-
-      interpreter.CodeStack.SetTop(nthExpression);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the top item of the CODE stack is an empty list, or FALSE otherwise.
-  /// </summary>
-  public class CodeNullExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.NULL";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count == 0) return;
-
-      var result = interpreter.CodeStack.Pop().Equals(ExecExpandExpression.Empty);
-
-      interpreter.BooleanStack.Push(result);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes onto the INTEGER stack the position of the second item on the CODE stack within the first item
-  ///     (which is coerced to a list if necessary). Pushes -1 if no match is found.
-  /// </summary>
-  public class CodePositionExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.POSITION";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count < 2) return;
-
-      var expressions = interpreter.CodeStack.Pop(2);
-      var first = expressions[1];
-      var second = expressions[0];
-
-      var position = -1;
-      if (first.GetType() == typeof(ExecExpandExpression)) {
-        var expand = first as ExecExpandExpression;
-        position = expand.Expressions.Count - 1
-                   - Array.FindIndex(expand.Expressions as Expression[], e => e.Equals(second));
-      } else if (first.Equals(second)) {
-        position = 0;
-      }
-
-      interpreter.IntegerStack.Push(position);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the number of "points" in the top piece of CODE onto the INTEGER stack. Each instruction, literal,
-  ///     and pair of parentheses counts as a point.
-  /// </summary>
-  public class CodeSizeExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.SIZE";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (interpreter.CodeStack.Count == 0) return;
-
-      var expression = interpreter.CodeStack.Pop();
-      var points = expression.GetType() == typeof(ExecExpandExpression)
-                     ? (expression as ExecExpandExpression).Expressions.Count
-                     : 1;
-
-      interpreter.IntegerStack.Push(points);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the result of substituting the third item on the code stack for the second item in the first item.
-  ///     As of this writing this is implemented only in the Lisp implementation, within which it relies on the Lisp "subst"
-  ///     function. As such, there are several problematic possibilities; for example "dotted-lists" can result in certain
-  ///     cases with empty-list arguments. If any of these problematic possibilities occurs the stack is left unchanged.
-  /// </summary>
-  public class CodeSubstitutionExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.SUBST";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if ((interpreter.CodeStack.Count < 3) || (interpreter.CodeStack.Top.GetType() != typeof(ExecExpandExpression))) return;
-
-      var expressions = interpreter.CodeStack.Pop(2);
-      var third = interpreter.CodeStack.Top;
-      var second = expressions[0];
-      var first = expressions[1] as ExecExpandExpression;
-      var newExpressions = new Expression[first.Expressions.Count];
-
-      for (var i = 0; i < first.Expressions.Count; i++)
-        newExpressions[i] = first.Expressions[i].Equals(third)
-                              ? second
-                              /* no cloning needed here because first is removed and therefore newExpression is the
-             only container of sub expressions */
-                              : first.Expressions[i];
-
-      var result = new ExecExpandExpression(newExpressions);
-
-      interpreter.CodeStack.SetTop(result);
-    }
-  }
+namespace HeuristicLab.Algorithms.PushGP.Expressions
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using Interpreter;
+
+    /// <summary>
+    ///     Recursively invokes the interpreter on the program on top of the CODE stack. After evaluation the
+    ///     CODE stack is popped; normally this pops the program that was just executed, but if the expression itself
+    ///     manipulates the stack then this final pop may end up popping something else.
+    /// </summary>
+    public class CodeDoExpression : StatelessExpression
+    {
+        public CodeDoExpression() : base("CODE.DO")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            // not enough arguments on stack
+            if (interpreter.CodeStack.Count == 0) return;
+
+            interpreter.ExecStack.Push(new CodePopExpression(), interpreter.CodeStack.Top);
+        }
+    }
+
+    /// <summary>
+    ///     Like CODE.DO but pops the stack before, rather than after, the recursive execution
+    /// </summary>
+    public class CodeDoXExpression : StatelessExpression
+    {
+        public CodeDoXExpression() : base("CODE.DO*")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            // not enough arguments on stack
+            if (interpreter.CodeStack.Count == 0) return;
+
+            var expression = interpreter.CodeStack.Pop();
+            interpreter.ExecStack.Push(expression);
+        }
+    }
+
+    /// <summary>
+    ///     Does nothing.
+    /// </summary>
+    public class CodeNoopExpression : StatelessExpression
+    {
+        public CodeNoopExpression() : base("CODE.NOOP")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            // nothing to do
+        }
+    }
+
+    /// <summary>
+    ///     Specifies that the next expression submitted for execution will instead be pushed literally onto the CODE stack.
+    ///     This can be implemented by moving the top item on the EXEC stack onto the CODE stack.
+    /// </summary>
+    public class CodeQuoteExpression : StatelessExpression
+    {
+        public CodeQuoteExpression() : base("CODE.QUOTE")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            // not enough arguments on stack
+            if (interpreter.ExecStack.Count == 0) return;
+
+            var expression = interpreter.ExecStack.Pop();
+            interpreter.CodeStack.Push(expression);
+        }
+    }
+
+    /// <summary>
+    ///     If the top item of the BOOLEAN stack is TRUE this recursively executes the second item of the CODE stack;
+    ///     otherwise it recursively executes the first item of the CODE stack. Either way both elements of the CODE stack
+    ///     (and the BOOLEAN value upon which the decision was made) are popped.
+    /// </summary>
+    public class CodeIfExpression : StatelessExpression
+    {
+        public CodeIfExpression() : base("CODE.IF")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            // not enough arguments on stack
+            if ((interpreter.BooleanStack.Count == 0) || (interpreter.CodeStack.Count < 2)) return;
+
+            var condition = interpreter.BooleanStack.Pop();
+            var items = interpreter.CodeStack.Pop(2);
+
+            interpreter.ExecStack.Push(condition ? items[0] : items[1]);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the result of appending the top two pieces of code. If one of the pieces of code is a single instruction or
+    ///     literal (that is, something not surrounded by parentheses) then it is surrounded by parentheses first.
+    /// </summary>
+    public class CodeAppendExpression : StatelessExpression
+    {
+        public CodeAppendExpression() : base("CODE.APPEND") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count < 2) return;
+
+            var first = interpreter.CodeStack.Pop();
+            var second = interpreter.CodeStack.Top;
+
+            var isFirstList = first.GetType() == typeof(ExecExpandExpression);
+            var isSecondList = second.GetType() == typeof(ExecExpandExpression);
+
+            Expression[] result = null;
+
+            if (isFirstList)
+            {
+                var expand1 = first as ExecExpandExpression;
+
+                if (isSecondList)
+                {
+                    var expand2 = second as ExecExpandExpression;
+                    var size = expand2.Expressions.Count + expand1.Expressions.Count;
+
+                    // if size > maxPointsInProgram this expressions results in a NOOP
+                    if (size > interpreter.Configuration.MaxPointsInProgram) return;
+
+                    result = new Expression[size];
+
+                    Array.Copy(expand2.Expressions as Expression[], result, expand2.Expressions.Count);
+                    Array.Copy(
+                        expand1.Expressions as Expression[],
+                        0,
+                        result,
+                        expand2.Expressions.Count,
+                        expand1.Expressions.Count);
+                }
+                else
+                {
+                    var size = expand1.Expressions.Count + 1;
+
+                    // if size > maxPointsInProgram this expressions results in a NOOP
+                    if (size > interpreter.Configuration.MaxPointsInProgram) return;
+
+                    result = new Expression[size];
+                    result[0] = second;
+
+                    Array.Copy(expand1.Expressions as Expression[], 0, result, 1, expand1.Expressions.Count);
+                }
+            }
+            else if (isSecondList)
+            {
+                var expand2 = second as ExecExpandExpression;
+
+                var size = expand2.Expressions.Count + 1;
+
+                // if size > maxPointsInProgram this expressions results in a NOOP
+                if (size > interpreter.Configuration.MaxPointsInProgram) return;
+
+                result = new Expression[size];
+                result[0] = first;
+
+                Array.Copy(expand2.Expressions as Expression[], 0, result, 1, expand2.Expressions.Count);
+            }
+            else
+            {
+                result = new[] {second, first};
+            }
+
+            var expression = new ExecExpandExpression(result);
+
+            interpreter.CodeStack.SetTop(expression);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the top piece of code is a single instruction or a literal,
+    ///     and FALSE otherwise (that is, if it is something surrounded by parentheses).
+    /// </summary>
+    public class CodeAtomExpression : StatelessExpression
+    {
+        public CodeAtomExpression() : base("CODE.ATOM")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count == 0) return;
+
+            var expression = interpreter.CodeStack.Pop();
+            var isExpandExpression = expression.GetType() != typeof(ExecExpandExpression);
+
+            interpreter.BooleanStack.Push(isExpandExpression);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the first item of the list on top of the CODE stack. For example, if the top piece of code is "( A B )"
+    ///     then this pushes "A" (after popping the argument). If the code on top of the stack is not a list then this has no
+    ///     effect.
+    ///     The name derives from the similar Lisp function; a more generic name would be "FIRST".
+    /// </summary>
+    public class CodeCarExpression : StatelessExpression
+    {
+        public CodeCarExpression() : base("CODE.CAR")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if ((interpreter.CodeStack.Count == 0) || (interpreter.CodeStack.Top.GetType() !=
+                                                       typeof(ExecExpandExpression))) return;
+
+            var expand = interpreter.CodeStack.Top as ExecExpandExpression;
+
+            if (expand.IsEmpty) return;
+            var first = expand.Expressions[expand.Expressions.Count - 1];
+
+            interpreter.CodeStack.SetTop(first);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes a version of the list from the top of the CODE stack without its first element.
+    ///     For example, if the top piece of code is "( A B )" then this pushes "( B )" (after popping the argument).
+    ///     If the code on top of the stack is not a list then this pushes the empty list ("( )"). The name derives from
+    ///     the similar Lisp function; a more generic name would be "REST".
+    /// </summary>
+    public class CodeCdrExpression : StatelessExpression
+    {
+        public CodeCdrExpression() : base("CODE.CDR")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count == 0) return;
+
+            Expression expandExpression = null;
+            var top = interpreter.CodeStack.Top;
+
+            if (top.GetType() == typeof(ExecExpandExpression))
+            {
+                var expand = top as ExecExpandExpression;
+
+                if (expand.IsEmpty) return;
+                var length = expand.Expressions.Count - 1;
+                var newExpressions = new Expression[length];
+
+                Array.Copy(expand.Expressions as Expression[], 0, newExpressions, 0, length);
+
+                expandExpression = new ExecExpandExpression(newExpressions);
+            }
+            else
+            {
+                expandExpression = ExecExpandExpression.Empty;
+            }
+
+            interpreter.CodeStack.SetTop(expandExpression);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the result of "consing" (in the Lisp sense) the second stack item onto the first stack item
+    ///     (which is coerced to a list if necessary). For example, if the top piece of code is "( A B )" and the
+    ///     second piece of code is "X" then this pushes "( X A B )" (after popping the argument).
+    /// </summary>
+    public class CodeConsExpression : StatelessExpression
+    {
+        public CodeConsExpression() : base("CODE.CONS") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count < 2 ||
+                interpreter.CodeStack[interpreter.CodeStack.Count - 1].GetType() != typeof(ExecExpandExpression))
+                return;
+
+            var first = interpreter.CodeStack.Pop() as ExecExpandExpression;
+            var size = first.Expressions.Count + 1;
+
+            if (size > interpreter.Configuration.MaxPointsInProgram) return;
+
+            var expressions = new Expression[size];
+//            var second = interpreter.CodeStack.Top.GetType() == typeof(ExecExpandExpression)
+//                ? (interpreter.CodeStack.Top as ExecExpandExpression).Copy()
+//                : interpreter.CodeStack.Top;
+
+            expressions[first.Expressions.Count] = interpreter.CodeStack.Top;
+            Array.Copy(first.Expressions as Expression[], expressions, first.Expressions.Count);
+
+            var result = new ExecExpandExpression(expressions);
+            interpreter.CodeStack.SetTop(result);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the "container" of the second CODE stack item within the first CODE stack item onto the CODE stack.
+    ///     If second item contains the first anywhere (i.e. in any nested list) then the container is the smallest sub-list
+    ///     that contains but is not equal to the first instance. For example, if the top piece of code is "( B ( C ( A ) ) ( D
+    ///     ( A ) ) )"
+    ///     and the second piece of code is "( A )" then this pushes ( C ( A ) ). Pushes an empty list if there is no such
+    ///     container.
+    /// </summary>
+    public class CodeContainerExpression : StatelessExpression
+    {
+        public CodeContainerExpression() : base("CODE.CONTAINER") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if ((interpreter.CodeStack.Count < 2) ||
+                (interpreter.CodeStack[interpreter.CodeStack.Count - 2].GetType() !=
+                 typeof(ExecExpandExpression))) return;
+
+            var target = interpreter.CodeStack.Pop();
+            var source = interpreter.CodeStack.Top;
+
+            var container = GetContainer(source as ExecExpandExpression, target);
+            var result = container ?? ExecExpandExpression.Empty;
+
+            interpreter.CodeStack.SetTop(result);
+        }
+
+        private static ExecExpandExpression GetContainer(ExecExpandExpression current, Expression target)
+        {
+            if (current == target)
+                return null;
+
+            var subContainer =
+                current.Expressions.Where(e => e.GetType() == typeof(ExecExpandExpression))
+                    .Select(e => GetContainer(e as ExecExpandExpression, target))
+                    .Where(e => e != null);
+
+            var execExpandExpressions = subContainer as IList<ExecExpandExpression> ?? subContainer.ToList();
+            return execExpandExpressions.Any()
+                ? execExpandExpressions.OrderBy(c => c.Expressions.Count).LastOrDefault()
+                : current.Expressions.Contains(target)
+                    ? current
+                    : null;
+        }
+    }
+
+    /// <summary>
+    ///     Pushes TRUE on the BOOLEAN stack if the second CODE stack item contains the first CODE stack
+    ///     item anywhere (e.g. in a sub-list).
+    /// </summary>
+    public class CodeContainsExpression : StatelessExpression
+    {
+        public CodeContainsExpression() : base("CODE.CONTAINS") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count < 2 ||
+                interpreter.CodeStack[interpreter.CodeStack.Count - 2].GetType() != typeof(ExecExpandExpression))
+                return;
+
+            var values = interpreter.CodeStack.Pop(2);
+            var second = values[0] as ExecExpandExpression;
+            var contains = second.Expressions.Contains(values[1]);
+
+            interpreter.BooleanStack.Push(contains);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the definition associated with the top NAME on the NAME stack (if any) onto the CODE stack.
+    ///     This extracts the definition for inspection/manipulation, rather than for immediate execution (although it
+    ///     may then be executed with a call to CODE.DO or a similar instruction).
+    /// </summary>
+    public class CodeDefinitionExpression : StatelessExpression
+    {
+        public CodeDefinitionExpression() : base("CODE.DEFINITION") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if ((interpreter.NameStack.Count == 0) ||
+                !interpreter.CustomExpressions.ContainsKey(interpreter.NameStack.Top)) return;
+
+            var name = interpreter.NameStack.Pop();
+            var definition = interpreter.CustomExpressions[name];
+
+            interpreter.CodeStack.Push(definition);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes a measure of the discrepancy between the top two CODE stack items onto the INTEGER stack. This will be zero
+    ///     if the top two items are equivalent, and will be higher the 'more different' the items are from one another. The calculation
+    ///     is as follows:
+    ///     <list type="bullet">
+    ///         <item>
+    ///             <description>
+    ///                 Construct a list of all of the unique items in both of the lists(where uniqueness is determined by equalp).
+    ///                 Sub-lists and atoms all count as items.
+    ///         </item>
+    ///         <item>
+    ///             <description>Initialize the result to zero.
+    ///         </item>
+    ///         <item>
+    ///             <description>
+    ///                 For each unique item increment the result by the difference between the number of occurrences of the
+    ///                 item in the two pieces of code.
+    ///         </item>
+    ///         <item>
+    ///             <description>Push the result.
+    ///         </item>
+    ///     </list>
+    /// </summary>
+    public class CodeDiscrepancyExpression : StatelessExpression
+    {
+        public CodeDiscrepancyExpression() : base("CODE.DISCREPANCY") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count < 2) return;
+
+            var expressions = interpreter.CodeStack.Pop(2);
+            var firstItems = new Dictionary<int, int>();
+            var secondItems = new Dictionary<int, int>();
+
+            DetermineUniqueItems(expressions[0], secondItems);
+            DetermineUniqueItems(expressions[1], firstItems);
+
+            var discrepancy = GetDiscrepancy(firstItems, secondItems);
+
+            interpreter.IntegerStack.Push(discrepancy);
+        }
+
+        private int GetDiscrepancy(IDictionary<int, int> first, IDictionary<int, int> second)
+        {
+            var discrepancy = 0;
+            var keys = first.Keys.Concat(second.Keys).Distinct();
+
+            foreach (var key in keys)
+                if (first.ContainsKey(key) && second.ContainsKey(key))
+                    discrepancy += Math.Abs(first[key] - second[key]);
+                else if (first.ContainsKey(key)) discrepancy += first[key];
+                else discrepancy += second[key];
+
+            return discrepancy;
+        }
+
+        private void DetermineUniqueItems(Expression source, IDictionary<int, int> items)
+        {
+            if (source.GetType() == typeof(ExecExpandExpression))
+            {
+                var expand = source as ExecExpandExpression;
+
+                foreach (var e in expand.Expressions)
+                {
+                    var id = e.GetHashCode();
+                    if (!items.ContainsKey(id)) items.Add(id, 1);
+                    else items[id]++;
+                }
+            }
+            else
+            {
+                items.Add(source.GetHashCode(), 1);
+            }
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the sub-expression of the top item of the CODE stack that is indexed by the top item of the INTEGER stack.
+    ///     The indexing here counts "points," where each parenthesized expression and each literal/instruction is considered a
+    ///     point,
+    ///     and it proceeds in depth first order. The entire piece of code is at index 0; if it is a list then the first item
+    ///     in the list
+    ///     is at index 1, etc. The integer used as the index is taken modulo the number of points in the overall expression
+    ///     (and its
+    ///     absolute value is taken in case it is negative) to ensure that it is within the meaningful range.
+    /// </summary>
+    public class CodeExtractExpression : StatelessExpression
+    {
+        public CodeExtractExpression() : base("CODE.EXTRACT") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.IntegerStack.Count == 0 ||
+                interpreter.CodeStack.Count == 0 ||
+                interpreter.CodeStack.Top.GetType() != typeof(ExecExpandExpression))
+                return;
+
+            var expression = interpreter.CodeStack.Top as ExecExpandExpression;
+            var index = (int) Math.Abs(interpreter.IntegerStack.Pop() % expression.TotalCount);
+            var result = expression.GetFromTree(index);
+
+            interpreter.CodeStack.SetTop(result);
+        }
+    }
+
+    /// <summary>
+    ///     Pops the BOOLEAN stack and pushes the popped item (TRUE or FALSE) onto the CODE stack.
+    /// </summary>
+    public class CodeFromBooleanExpression : StatelessExpression
+    {
+        public CodeFromBooleanExpression() : base("CODE.FROMBOOLEAN")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.BooleanStack.Count == 0) return;
+
+            var value = interpreter.BooleanStack.Pop();
+            var expression = new BooleanPushExpression(value);
+
+            interpreter.CodeStack.Push(expression);
+        }
+    }
+
+    /// <summary>
+    ///     Pops the FLOAT stack and pushes the popped item onto the CODE stack.
+    /// </summary>
+    public class CodeFromFloatExpression : StatelessExpression
+    {
+        public CodeFromFloatExpression() : base("CODE.FROMFLOAT")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.FloatStack.Count == 0) return;
+
+            var value = interpreter.FloatStack.Pop();
+            var expression = new FloatPushExpression(value);
+
+            interpreter.CodeStack.Push(expression);
+        }
+    }
+
+    /// <summary>
+    ///     Pops the INTEGER stack and pushes the popped integer onto the CODE stack.
+    /// </summary>
+    public class CodeFromIntegerExpression : StatelessExpression
+    {
+        public CodeFromIntegerExpression() : base("CODE.FROMINTEGER")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.IntegerStack.Count == 0) return;
+
+            var value = interpreter.IntegerStack.Pop();
+            var expression = new IntegerPushExpression(value);
+
+            interpreter.CodeStack.Push(expression);
+        }
+    }
+
+    /// <summary>
+    ///     Pops the NAME stack and pushes the popped item onto the CODE stack.
+    /// </summary>
+    public class CodeFromNameExpression : StatelessExpression
+    {
+        public CodeFromNameExpression() : base("CODE.FROMNAME")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.NameStack.Count == 0) return;
+
+            var value = interpreter.NameStack.Pop();
+            var expression = new NameDefineXExecExpression(value);
+
+            interpreter.CodeStack.Push(expression);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the result of inserting the second item of the CODE stack into the first item, at the position indexed
+    ///     by the top item of the INTEGER stack (and replacing whatever was there formerly).
+    /// </summary>
+    public class CodeInsertExpression : StatelessExpression
+    {
+        public CodeInsertExpression() : base("CODE.CODEINSERT")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if ((interpreter.IntegerStack.Count == 0) || (interpreter.CodeStack.Count < 2)
+                || (interpreter.CodeStack.Top.GetType() != typeof(ExecExpandExpression))) return;
+
+            var source = interpreter.CodeStack[interpreter.CodeStack.Count - 2];
+            var target = interpreter.CodeStack.Pop() as ExecExpandExpression;
+            var index = (int) interpreter.IntegerStack.Pop();
+
+            Expression[] newExpressions;
+            if (target.Expressions.Count > 0)
+            {
+                index = target.Expressions.Count - 1 - Math.Abs(index % target.Expressions.Count);
+
+                newExpressions = target.CopyExpressions();
+                newExpressions[index] = source.GetType() == typeof(ExecExpandExpression)
+                    ? (source as ExecExpandExpression).Copy()
+                    : source;
+            }
+            else
+            {
+                newExpressions = new[] {source};
+            }
+
+            var result = new ExecExpandExpression(newExpressions);
+            interpreter.CodeStack.SetTop(result);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the length of the top item on the CODE stack onto the INTEGER stack.
+    ///     If the top item is not a list then this pushes a 1. If the top item is a list then this pushes the
+    ///     number of items in the top level of the list; that is, nested lists contribute only 1 to this count, no
+    ///     matter what they contain.
+    /// </summary>
+    public class CodeLengthExpression : StatelessExpression
+    {
+        public CodeLengthExpression() : base("CODE.LENGTH")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count == 0) return;
+
+            var expression = interpreter.CodeStack.Pop();
+            var count = 1;
+
+            if (expression.GetType() == typeof(ExecExpandExpression))
+                count = (expression as ExecExpandExpression).Expressions.Count;
+
+            interpreter.IntegerStack.Push(count);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes a list of the top two items of the CODE stack onto the CODE stack.
+    /// </summary>
+    public class CodeListExpression : StatelessExpression
+    {
+        public CodeListExpression() : base("CODE.LIST") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count < 2) return;
+
+            var first = interpreter.CodeStack.Pop();
+            var second = interpreter.CodeStack.Top;
+            var expandExpression = new ExecExpandExpression(second, first);
+
+            interpreter.CodeStack.SetTop(expandExpression);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the second item of the CODE stack is a member of the first item
+    ///     (which is coerced to a list if necessary). Pushes FALSE onto the BOOLEAN stack otherwise.
+    /// </summary>
+    public class CodeMemberExpression : StatelessExpression
+    {
+        public CodeMemberExpression() : base("CODE.MEMBER") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count < 2) return;
+
+            var expressions = interpreter.CodeStack.Pop(2);
+
+            var contains = expressions[1].GetType() == typeof(ExecExpandExpression)
+                ? (expressions[1] as ExecExpandExpression).Expressions.Contains(expressions[0])
+                : expressions[1].Equals(expressions[0]);
+
+            interpreter.BooleanStack.Push(contains);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the nth element of the expression on top of the CODE stack (which is coerced to a list first if necessary).
+    ///     If the expression is an empty list then the result is an empty list. N is taken from the INTEGER stack and is taken
+    ///     modulo the length of the expression into which it is indexing.
+    /// </summary>
+    public class CodeNthExpression : StatelessExpression
+    {
+        public CodeNthExpression() : base("CODE.NTH") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if ((interpreter.CodeStack.Count == 0) || (interpreter.IntegerStack.Count == 0)) return;
+
+            var n = interpreter.IntegerStack.Pop();
+            var expression = interpreter.CodeStack.Top;
+
+            Expression nthExpression = null;
+
+            if (expression.GetType() == typeof(ExecExpandExpression))
+            {
+                var subExpression = expression as ExecExpandExpression;
+
+                if (subExpression.IsEmpty)
+                {
+                    nthExpression = ExecExpandExpression.Empty;
+                }
+                else
+                {
+                    var index = (int) (subExpression.Expressions.Count - 1 -
+                                       Math.Abs(n % subExpression.Expressions.Count));
+
+                    nthExpression = subExpression.Expressions[index];
+                }
+            }
+            else
+            {
+                nthExpression = expression;
+            }
+
+            interpreter.CodeStack.SetTop(nthExpression);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the nth "CDR" (in the Lisp sense) of the expression on top of the CODE stack (which is coerced to a list
+    ///     first if necessary). If the expression is an empty list then the result is an empty list. N is taken from the
+    ///     INTEGER
+    ///     stack and is taken modulo the length of the expression into which it is indexing. A "CDR" of a list is the list
+    ///     without
+    ///     its first element.
+    /// </summary>
+    public class CodeNthCdrExpression : StatelessExpression
+    {
+        public CodeNthCdrExpression() : base("CODE.NTHCDR")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if ((interpreter.CodeStack.Count == 0) || (interpreter.IntegerStack.Count == 0)) return;
+
+            var n = interpreter.IntegerStack.Pop();
+            var expression = interpreter.CodeStack.Top;
+
+            Expression nthExpression = null;
+
+            if (expression.GetType() == typeof(ExecExpandExpression))
+            {
+                var subExpressions = (expression as ExecExpandExpression).Expressions;
+
+                if (subExpressions.Count < 2)
+                {
+                    nthExpression = ExecExpandExpression.Empty;
+                }
+                else
+                {
+                    var index = (int) (subExpressions.Count - 2 - Math.Abs(n % (subExpressions.Count - 1)));
+
+                    nthExpression = subExpressions[index];
+                }
+            }
+            else
+            {
+                nthExpression = expression;
+            }
+
+            interpreter.CodeStack.SetTop(nthExpression);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the top item of the CODE stack is an empty list, or FALSE otherwise.
+    /// </summary>
+    public class CodeNullExpression : StatelessExpression
+    {
+        public CodeNullExpression() : base("CODE.NULL")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count == 0) return;
+
+            var result = interpreter.CodeStack.Pop().Equals(ExecExpandExpression.Empty);
+
+            interpreter.BooleanStack.Push(result);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes onto the INTEGER stack the position of the second item on the CODE stack within the first item
+    ///     (which is coerced to a list if necessary). Pushes -1 if no match is found.
+    /// </summary>
+    public class CodePositionExpression : StatelessExpression
+    {
+        public CodePositionExpression() : base("CODE.POSITION")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count < 2) return;
+
+            var expressions = interpreter.CodeStack.Pop(2);
+            var first = expressions[1];
+            var second = expressions[0];
+
+            var position = -1;
+            if (first.GetType() == typeof(ExecExpandExpression))
+            {
+                var expand = first as ExecExpandExpression;
+                position = expand.Expressions.Count - 1
+                           - Array.FindIndex(expand.Expressions as Expression[], e => e.Equals(second));
+            }
+            else if (first.Equals(second))
+            {
+                position = 0;
+            }
+
+            interpreter.IntegerStack.Push(position);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the number of "points" in the top piece of CODE onto the INTEGER stack. Each instruction, literal,
+    ///     and pair of parentheses counts as a point.
+    /// </summary>
+    public class CodeSizeExpression : StatelessExpression
+    {
+        public CodeSizeExpression() : base("CODE.SIZE")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.CodeStack.Count == 0) return;
+
+            var expression = interpreter.CodeStack.Pop();
+            var points = expression.GetType() == typeof(ExecExpandExpression)
+                ? (expression as ExecExpandExpression).Expressions.Count
+                : 1;
+
+            interpreter.IntegerStack.Push(points);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the result of substituting the third item on the code stack for the second item in the first item.
+    ///     As of this writing this is implemented only in the Lisp implementation, within which it relies on the Lisp "subst"
+    ///     function. As such, there are several problematic possibilities; for example "dotted-lists" can result in certain
+    ///     cases with empty-list arguments. If any of these problematic possibilities occurs the stack is left unchanged.
+    /// </summary>
+    public class CodeSubstitutionExpression : StatelessExpression
+    {
+        public CodeSubstitutionExpression() : base("CODE.SUBST")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if ((interpreter.CodeStack.Count < 3) || (interpreter.CodeStack.Top.GetType() !=
+                                                      typeof(ExecExpandExpression))) return;
+
+            var expressions = interpreter.CodeStack.Pop(2);
+            var third = interpreter.CodeStack.Top;
+            var second = expressions[0];
+            var first = expressions[1] as ExecExpandExpression;
+            var newExpressions = new Expression[first.Expressions.Count];
+
+            for (var i = 0; i < first.Expressions.Count; i++)
+                newExpressions[i] = first.Expressions[i].Equals(third)
+                    ? second
+                    /* no cloning needed here because first is removed and therefore newExpression is the only container of sub expressions */
+                    : first.Expressions[i];
+
+            var result = new ExecExpandExpression(newExpressions);
+
+            interpreter.CodeStack.SetTop(result);
+        }
+    }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DefineExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DefineExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DefineExpressions.cs	(revision 14602)
@@ -1,4 +1,3 @@
-﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
-{
+﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
   using System;
   using System.Collections.Generic;
@@ -12,12 +11,12 @@
   /// </summary>
   /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class DefineExpression<T> : StatelessExpression
-  {
+  public abstract class DefineExpression<T> : StatelessExpression {
+    protected DefineExpression(string stringRepresentation) : base(stringRepresentation) { }
+
     protected void Eval(
       IStack<T> stack,
       IStack<string> nameStack,
       IDictionary<string, Expression> customExpressions,
-      Func<T, Expression> creator)
-    {
+      Func<T, Expression> creator) {
       // not enough arguments on stack
       if ((nameStack.Count == 0) || (stack.Count < 1)) return;
@@ -31,13 +30,8 @@
   }
 
-  public class CodeDefineExpression : DefineExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.DEFINE";
-    }
+  public class CodeDefineExpression : DefineExpression<Expression> {
+    public CodeDefineExpression() : base("CODE.DEFINE") { }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
+    public override void Eval(IPushGpInterpreter interpreter) {
       if (interpreter.Configuration.TopLevelPushCode && (interpreter.CodeStack.Count < 2)) return;
 
@@ -52,13 +46,8 @@
   }
 
-  public class ExecDefineExpression : DefineExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.DEFINE";
-    }
+  public class ExecDefineExpression : DefineExpression<Expression> {
+    public ExecDefineExpression() : base("EXEC.DEFINE") { }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
+    public override void Eval(IPushGpInterpreter interpreter) {
       if (interpreter.ExecStack.Count < 2) return;
 
@@ -73,13 +62,8 @@
   }
 
-  public class FloatDefineExpression : DefineExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.DEFINE";
-    }
+  public class FloatDefineExpression : DefineExpression<double> {
+    public FloatDefineExpression() : base("FLOAT.DEFINE") { }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
+    public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(
         interpreter.FloatStack,
@@ -90,13 +74,8 @@
   }
 
-  public class IntegerDefineExpression : DefineExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.DEFINE";
-    }
+  public class IntegerDefineExpression : DefineExpression<long> {
+    public IntegerDefineExpression() : base("INTEGER.DEFINE") { }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
+    public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(
         interpreter.IntegerStack,
@@ -107,13 +86,8 @@
   }
 
-  public class BooleanDefineExpression : DefineExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.DEFINE";
-    }
+  public class BooleanDefineExpression : DefineExpression<bool> {
+    public BooleanDefineExpression() : base("BOOLEAN.DEFINE") { }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
+    public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(
         interpreter.BooleanStack,
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoCountExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoCountExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoCountExpressions.cs	(revision 14602)
@@ -4,6 +4,12 @@
 
   public abstract class DoCountExpression : LoopExpression {
+    protected DoCountExpression(string stringRepresentation)
+      : base(stringRepresentation) {
+    }
+
     protected override bool HasInsufficientArguments(IPushGpInterpreter interpreter, IStack<Expression> sourceStack) {
-      return (interpreter.IntegerStack.Count < 1) || (sourceStack.Count == 0) || (interpreter.IntegerStack.Top <= 0);
+      return interpreter.IntegerStack.Count < 1 ||
+             sourceStack.Count == 0 ||
+             interpreter.IntegerStack.Top <= 0;
     }
 
@@ -32,7 +38,5 @@
   /// </summary>
   public class CodeDoCountExpression : DoCountExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.DO*COUNT";
-    }
+    public CodeDoCountExpression() : base("CODE.DO*COUNT") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -56,8 +60,5 @@
   /// </summary>
   public class ExecDoCountExpression : DoCountExpression {
-    protected override string InitStringRepresentation() {
-      return "EXEC.DO*COUNT";
-    }
-
+    public ExecDoCountExpression() : base("EXEC.DO*COUNT") { }
     public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(interpreter, interpreter.ExecStack);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoRangeExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoRangeExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoRangeExpressions.cs	(revision 14602)
@@ -4,7 +4,10 @@
 
   public abstract class DoRangeExpression : LoopExpression {
+    protected DoRangeExpression(string stringRepresentation) : base(stringRepresentation) { }
+
     protected override bool HasInsufficientArguments(IPushGpInterpreter interpreter, IStack<Expression> sourceStack) {
-      return (interpreter.IntegerStack.Count < 2) || (sourceStack.Count == 0)
-             || (interpreter.IntegerStack.Top == interpreter.IntegerStack.ReverseElementAt(1));
+      return interpreter.IntegerStack.Count < 2 ||
+             sourceStack.Count == 0 ||
+             interpreter.IntegerStack.Top == interpreter.IntegerStack.ReverseElementAt(1);
     }
 
@@ -41,7 +44,5 @@
   /// </summary>
   public class CodeDoRangeExpression : DoRangeExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.DO*RANGE";
-    }
+    public CodeDoRangeExpression() : base("CODE.DO*RANGE") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -75,7 +76,5 @@
   /// </summary>
   public class ExecDoRangeExpression : DoRangeExpression {
-    protected override string InitStringRepresentation() {
-      return "EXEC.DO*RANGE";
-    }
+    public ExecDoRangeExpression() : base("EXEC.DO*RANGE") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoTimesExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoTimesExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DoTimesExpressions.cs	(revision 14602)
@@ -4,4 +4,5 @@
 
   public abstract class DoTimesExpression : LoopExpression {
+    protected DoTimesExpression(string stringRepresentation) : base(stringRepresentation) { }
     protected override bool HasInsufficientArguments(IPushGpInterpreter interpreter, IStack<Expression> sourceStack) {
       return (interpreter.IntegerStack.Count < 1) || (sourceStack.Count == 0) || (interpreter.IntegerStack.Top <= 0);
@@ -31,7 +32,5 @@
   /// </summary>
   public class CodeDoTimesExpression : DoTimesExpression {
-    protected override string InitStringRepresentation() {
-      return "CODE.DO*TIMES";
-    }
+    public CodeDoTimesExpression() : base("CODE.DO*TIMES") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -50,7 +49,5 @@
   /// </summary>
   public class ExecDoTimesExpression : DoTimesExpression {
-    protected override string InitStringRepresentation() {
-      return "EXEC.DO*TIMES";
-    }
+    public ExecDoTimesExpression() : base("EXEC.DO*TIMES") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DuplicateExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DuplicateExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/DuplicateExpressions.cs	(revision 14602)
@@ -1,107 +1,105 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using HeuristicLab.Algorithms.PushGP.Interpreter;
+    using HeuristicLab.Algorithms.PushGP.Stack;
 
-  /// <summary>
-  ///     Duplicates the top item on the INTEGER stack. Does not pop its argument
-  ///     (which, if it did, would negate the effect of the duplication!).
-  /// </summary>
-  /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class DuplicateExpression<T> : StatelessExpression
-  {
-    protected void Eval(IStack<T> stack)
+    /// <summary>
+    ///     Duplicates the top item on the INTEGER stack. Does not pop its argument
+    ///     (which, if it did, would negate the effect of the duplication!).
+    /// </summary>
+    /// <typeparam name="T">Stacktype</typeparam>
+    public abstract class DuplicateExpression<T> : StatelessExpression
     {
-      if (stack.Count == 0) return;
+        protected DuplicateExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
 
-      stack.Push(stack.Top);
+        protected void Eval(IStack<T> stack)
+        {
+            if (stack.Count == 0) return;
+
+            stack.Push(stack.Top);
+        }
+
+        protected void Eval(IStack<Expression> stack)
+        {
+            if (stack.Count == 0) return;
+
+            var top = stack.Top;
+
+            stack.Push(top);
+        }
     }
 
-    protected void Eval(IStack<Expression> stack)
+    public class IntegerDuplicateExpression : DuplicateExpression<long>
     {
-      if (stack.Count == 0) return;
+        public IntegerDuplicateExpression() : base("INTEGER.DUP")
+        {
+        }
 
-      var top = stack.Top;
-
-      stack.Push(top);
-    }
-  }
-
-  public class IntegerDuplicateExpression : DuplicateExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.DUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class FloatDuplicateExpression : DuplicateExpression<double>
     {
-      this.Eval(interpreter.IntegerStack);
-    }
-  }
+        public FloatDuplicateExpression() : base("FLOAT.DUP")
+        {
+        }
 
-  public class FloatDuplicateExpression : DuplicateExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.DUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class BooleanDuplicateExpression : DuplicateExpression<bool>
     {
-      this.Eval(interpreter.FloatStack);
-    }
-  }
+        public BooleanDuplicateExpression() : base("BOOLEAN.DUP")
+        {
+        }
 
-  public class BooleanDuplicateExpression : DuplicateExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.DUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NameDuplicateExpression : DuplicateExpression<string>
     {
-      this.Eval(interpreter.BooleanStack);
-    }
-  }
+        public NameDuplicateExpression() : base("NAME.DUP")
+        {
+        }
 
-  public class NameDuplicateExpression : DuplicateExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.DUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.NameStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecDuplicateExpression : DuplicateExpression<Expression>
     {
-      this.Eval(interpreter.NameStack);
-    }
-  }
+        public ExecDuplicateExpression() : base("EXEC.DUP")
+        {
+        }
 
-  public class ExecDuplicateExpression : DuplicateExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.DUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.ExecStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodeDuplicateExpression : DuplicateExpression<Expression>
     {
-      this.Eval(interpreter.ExecStack);
+        public CodeDuplicateExpression() : base("CODE.DUP")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.CodeStack);
+        }
     }
-  }
-
-  public class CodeDuplicateExpression : DuplicateExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.DUP";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.CodeStack);
-    }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ERCExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ERCExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ERCExpressions.cs	(revision 14602)
@@ -2,4 +2,5 @@
   using HeuristicLab.Algorithms.PushGP.Generators;
   using HeuristicLab.Algorithms.PushGP.Interpreter;
+  using HeuristicLab.Algorithms.PushGP.Stack;
 
   /// <summary>
@@ -7,18 +8,14 @@
   /// </summary>
   /// <typeparam name="T"></typeparam>
-  public abstract class ErcExpression<T> : PushExpression<T> {
-    protected ErcExpression(T value) : base(value) { }
+  public abstract class ErcExpression<T> : StatefullExpression<T> {
+    protected ErcExpression(T value, string stringRepresentation) : base(value, stringRepresentation) { }
 
-    protected override string InitStringRepresentation() {
-      return string.Format("{0}({1})", this.GetType().Name, this.State);
-    }
-
-    protected override int InitId() {
-      return this.State.GetHashCode();
+    protected void Eval(IStack<T> stack) {
+      stack.Push(this.State);
     }
   }
 
   public class IntegerErcExpression : ErcExpression<long> {
-    public IntegerErcExpression() : base(IntegerGenerator.RandomInteger()) { }
+    public IntegerErcExpression() : base(IntegerGenerator.RandomInteger(), "INTEGER.ERC") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -28,5 +25,5 @@
 
   public class FloatErcExpression : ErcExpression<double> {
-    public FloatErcExpression() : base(FloatGenerator.RandomFloat()) { }
+    public FloatErcExpression() : base(FloatGenerator.RandomFloat(), "FLOAT.ERC") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -36,5 +33,5 @@
 
   public class BooleanErcExpression : ErcExpression<bool> {
-    public BooleanErcExpression() : base(BooleanGenerator.RandomBoolean()) { }
+    public BooleanErcExpression() : base(BooleanGenerator.RandomBoolean(), "BOOLEAN.ERC") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
@@ -44,5 +41,5 @@
 
   public class NameErcExpression : ErcExpression<string> {
-    public NameErcExpression() : base(NameGenerator.RandomName()) { }
+    public NameErcExpression() : base(NameGenerator.RandomName(), "NAME.ERC") { }
 
     public override void Eval(IPushGpInterpreter interpreter) {
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/EqualsExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/EqualsExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/EqualsExpressions.cs	(revision 14602)
@@ -1,99 +1,97 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using HeuristicLab.Algorithms.PushGP.Interpreter;
+    using HeuristicLab.Algorithms.PushGP.Stack;
 
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the top two items are equal, or FALSE otherwise
-  /// </summary>
-  /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class EqualsExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack, IStack<bool> booleanStack)
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the top two items are equal, or FALSE otherwise
+    /// </summary>
+    /// <typeparam name="T">Stacktype</typeparam>
+    public abstract class EqualsExpression<T> : StatelessExpression
     {
-      if (stack.Count < 2) return;
+        protected EqualsExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
 
-      var items = stack.Pop(2);
+        public void Eval(IStack<T> stack, IStack<bool> booleanStack)
+        {
+            if (stack.Count < 2) return;
 
-      booleanStack.Push(items[0].Equals(items[1]));
-    }
-  }
+            var items = stack.Pop(2);
 
-  public class IntegerEqualsExpression : EqualsExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.=";
+            booleanStack.Push(items[0].Equals(items[1]));
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class IntegerEqualsExpression : EqualsExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, interpreter.BooleanStack);
-    }
-  }
+        public IntegerEqualsExpression() : base("INTEGER.=")
+        {
+        }
 
-  public class FloatEqualsExpression : EqualsExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.=";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class FloatEqualsExpression : EqualsExpression<double>
     {
-      this.Eval(interpreter.FloatStack, interpreter.BooleanStack);
-    }
-  }
+        public FloatEqualsExpression() : base("FLOAT.=")
+        {
+        }
 
-  public class BooleanEqualsExpression : EqualsExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.=";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class BooleanEqualsExpression : EqualsExpression<bool>
     {
-      this.Eval(interpreter.BooleanStack, interpreter.BooleanStack);
-    }
-  }
+        public BooleanEqualsExpression() : base("BOOLEAN.=")
+        {
+        }
 
-  public class NameEqualsExpression : EqualsExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.=";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.BooleanStack, interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NameEqualsExpression : EqualsExpression<string>
     {
-      this.Eval(interpreter.NameStack, interpreter.BooleanStack);
-    }
-  }
+        public NameEqualsExpression() : base("NAME.=")
+        {
+        }
 
-  public class ExecEqualsExpression : EqualsExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.=";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.NameStack, interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecEqualsExpression : EqualsExpression<Expression>
     {
-      this.Eval(interpreter.ExecStack, interpreter.BooleanStack);
-    }
-  }
+        public ExecEqualsExpression() : base("EXEC.=")
+        {
+        }
 
-  public class CodeEqualsExpression : EqualsExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.=";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.ExecStack, interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodeEqualsExpression : EqualsExpression<Expression>
     {
-      this.Eval(interpreter.CodeStack, interpreter.BooleanStack);
+        public CodeEqualsExpression() : base("CODE.=")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.CodeStack, interpreter.BooleanStack);
+        }
     }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ExecExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ExecExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ExecExpressions.cs	(revision 14602)
@@ -1,55 +1,80 @@
-﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
+﻿using System.Threading;
+
+namespace HeuristicLab.Algorithms.PushGP.Expressions {
   using System;
   using System.Collections.Generic;
+  using System.Diagnostics;
   using System.Linq;
   using System.Text;
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-
-  public class ExecExpandExpression : StatefullExpression<Expression[]> {
-    private const string PREFIX = "( ";
-    private const string POSTFIX = ")";
-    private const string DELIMITER = " ";
-
+  using Interpreter;
+
+  public class ExecExpandExpression : WrapperExpression<Expression[]> {
+    private const string Prefix = "( ";
+    private const string PrefixReduced = "[";
+    private const string Postfix = ")";
+    private const string PostfixReduced = "]";
+    private const string Delimiter = " ";
+
+    public static readonly ExecExpandExpression Empty = new ExecExpandExpression();
+
+    private readonly Lazy<string> _stringValue;
+    private readonly int[] _treeIndex;
     public readonly int Depth;
 
-    public static readonly ExecExpandExpression Empty = new ExecExpandExpression(new Expression[0]);
+    private readonly int _hashCode;
+
+    public ExecExpandExpression(params Expression[] state) : base(state) {
+      IsEmpty = State.Length == 0;
+
+      Depth = CalcDepth();
+      _treeIndex = BuildTreeIndex();
+      _hashCode = HashExpressions();
+
+      _stringValue = new Lazy<string>(BuildString, LazyThreadSafetyMode.ExecutionAndPublication);
+    }
+
+    public ExecExpandExpression(IEnumerable<Expression> state) : this(state.ToArray()) {
+      // TODO: lazy evaluation of ToArray()
+    }
+
+#if DEBUG
+
+    private static void CheckIfNested(int level, ExecExpandExpression target, ExecExpandExpression current,
+        IList<ExecExpandExpression> visited) {
+      if (visited.Any(x => ReferenceEquals(x, current)))
+        Debugger.Break();
+
+      visited.Add(current);
+      if (level <= 0) {
+        // hirarchy depth > level
+        Debugger.Break();
+        return;
+      }
+
+      for (var i = 0; i < current.State.Length; i++) {
+        if (current.State[i].GetType() != typeof(ExecExpandExpression))
+          continue;
+
+        var subExpression = current.State[i] as ExecExpandExpression;
+
+        if (ReferenceEquals(target, subExpression)) {
+          // Endless recursion dedected
+          Debugger.Break();
+        }
+
+        CheckIfNested(level - 1, target, subExpression, visited);
+      }
+
+      visited.RemoveAt(visited.Count - 1);
+    }
+
+#endif
+
+    public IReadOnlyList<Expression> Expressions
+    {
+      get { return State; }
+    }
 
     public bool IsEmpty { get; private set; }
-
-    private int[] treeIndex;
-
-    public ExecExpandExpression(Expression[] state)
-      : base(state) {
-      this.IsEmpty = this.State.Length == 0;
-      this.InitId();
-
-      var subExpressions = state.Where(e => e.GetType() == typeof(ExecExpandExpression));
-
-      this.Depth = subExpressions.Any() ? subExpressions.Select(e => e as ExecExpandExpression).Max(e => e.Depth) : 1;
-    }
-
-    //private void CheckIfNested(int level, Expression parent)
-    //{
-    //    for (var i = 0; i < State.Length; i++)
-    //    {
-    //        if (State[i].GetType() == typeof(ExecExpandExpression))
-    //        {
-    //            if (parent == State[i])
-    //            {
-    //                Debugger.Break();
-    //            }
-
-    //            (State[i] as ExecExpandExpression).CheckIfNested(level + 1, parent);
-    //        }
-    //    }
-    //}
-
-    public ExecExpandExpression(ExecExpandExpression origin) : base(new Expression[origin.State.Length]) {
-      Array.Copy(origin.State, this.State, origin.State.Length);
-
-      this.IsEmpty = origin.IsEmpty;
-    }
-
-    public IReadOnlyList<Expression> Expressions { get { return this.State; } }
 
     /// <summary>
@@ -61,69 +86,85 @@
       get
       {
-        if (this.IsEmpty) {
-          return 1;
-        }
-
-        this.BuildIndexIfNecessary();
-
-        // + 1 because this is also counted
-        return this.treeIndex[0] + 1;
-      }
-    }
-
-    protected override string InitStringRepresentation() {
-      var sb = new StringBuilder();
-
-      sb.Append(PREFIX);
-#if DEBUG
-      for (var i = this.State.Length - 1; i >= 0; i--)
-        sb.Append(this.State[i] + DELIMITER);
-#else
-      sb.Append(this.TotalCount.ToString() + DELIMITER);
-#endif
-
-      sb.Append(POSTFIX);
-
-      return sb.ToString();
-    }
-
-    protected sealed override int InitId() {
+        return IsEmpty
+            ? 1
+            // + 1 because this is also counted
+            : _treeIndex[0] + 1;
+      }
+    }
+
+    public override string ToString() {
+      return _stringValue.Value;
+    }
+
+    private int HashExpressions() {
       var hash = 19 * 31 + this.GetType().GetHashCode();
 
-      for (var i = this.State.Length - 1; i >= 0; i--) hash = hash * 31 + this.State[i].GetHashCode();
+      for (var i = 0; i < this.State.Length; i++) {
+        hash = hash * 31 + this.State[i].GetHashCode();
+      }
 
       return hash;
+    }
+
+    protected override int CalcHashCode() {
+      return _hashCode;
     }
 
     public ExecExpandExpression Copy() {
       // as the empty list is a static stateless expression, no copy required
-      return this == Empty || this.IsEmpty
-        ? Empty
-        : new ExecExpandExpression(this.State);
+      return this == Empty || IsEmpty ? Empty : new ExecExpandExpression(State);
     }
 
     public Expression[] CopyExpressions() {
-      var copy = new Expression[this.State.Length];
-      Array.Copy(this.State, copy, this.State.Length);
+      var copy = new Expression[State.Length];
+      Array.Copy(State, copy, State.Length);
 
       return copy;
     }
 
-    public override int GetHashCode() {
-      return base.GetHashCode();
-    }
-
-    public override string ToString() {
-      return this.StringRepresentation;
-    }
-
-    public override bool Equals(object obj) {
-      if ((obj == null) || (obj.GetType() != typeof(ExecExpandExpression))) return false;
-
-      return this.GetHashCode() == obj.GetHashCode();
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      interpreter.ExecStack.Push(this.State);
+    public override void Eval(IPushGpInterpreter interpreter) {
+      interpreter.ExecStack.Push(State);
+    }
+
+    private int CalcDepth() {
+      var subExpressions = State.Where(e => e.GetType() == typeof(ExecExpandExpression));
+      var depth = subExpressions.Any()
+          ? subExpressions.Select(e => e as ExecExpandExpression).Max(e => e.Depth) + 1
+          : 1;
+
+      return depth;
+    }
+
+    private string BuildString() {
+      // prevent stack overflow
+      if (this.TotalCount > 50)
+        return PrefixReduced + this.State.Length + PostfixReduced;
+
+      var sb = new StringBuilder();
+
+      sb.Append(Prefix);
+      for (var i = this.State.Length - 1; i >= 0; i--) sb.Append(this.State[i] + Delimiter);
+      sb.Append(Postfix);
+      return sb.ToString();
+    }
+
+    private int[] BuildTreeIndex() {
+      var treeIndex = new int[State.Length];
+
+      var next = 1;
+
+      for (var i = State.Length - 1; i >= 0; i--) {
+        var subExpression = State[i];
+
+        treeIndex[i] = next;
+
+        if (subExpression.GetType() == typeof(ExecExpandExpression)) {
+          next += (subExpression as ExecExpandExpression).TotalCount;
+        } else {
+          next++;
+        }
+      }
+
+      return treeIndex;
     }
 
@@ -134,23 +175,23 @@
     /// <returns>The required element</returns>
     public Expression GetFromTree(int index) {
-      return this.GetFromTree(index, (root, parent, child, childIndex, parentIndex) => child);
+      return GetFromTree(index, (root, parent, child, childIndex, parentIndex) => child);
     }
 
     /// <returns>The required element</returns>
-    public T GetFromTree<T>(int index, Func<ExecExpandExpression, ExecExpandExpression, Expression, int, int, T> resolver) {
-      return this.GetFromTree(index, 0, null, resolver);
-    }
-
-    private T GetFromTree<T>(int index, int parentIndex, ExecExpandExpression parent, Func<ExecExpandExpression, ExecExpandExpression, Expression, int, int, T> resolver) {
+    public T GetFromTree<T>(int index,
+        Func<ExecExpandExpression, ExecExpandExpression, Expression, int, int, T> resolver) {
+      return GetFromTree(index, 0, null, resolver);
+    }
+
+    private T GetFromTree<T>(int index, int parentIndex, ExecExpandExpression parent,
+        Func<ExecExpandExpression, ExecExpandExpression, Expression, int, int, T> resolver) {
       if (index == 0) return resolver(parent, parent, this, 0, parentIndex);
 
-      this.BuildIndexIfNecessary();
-
-      var min = this.State.Length - 1;
+      var min = State.Length - 1;
       var max = 0;
       var mid = (min + max) / 2;
 
-      while ((max <= min) && (this.treeIndex[mid] != index)) {
-        if (this.treeIndex[mid] > index) max = mid + 1;
+      while ((max <= min) && (_treeIndex[mid] != index)) {
+        if (_treeIndex[mid] > index) max = mid + 1;
         else min = mid - 1;
 
@@ -158,31 +199,8 @@
       }
 
-      return this.treeIndex[mid] == index
-        ? resolver(parent, this, this.State[mid], mid, parentIndex)
-        : (this.State[mid + 1] as ExecExpandExpression).GetFromTree(index - this.treeIndex[mid + 1], mid + 1, this, resolver);
-    }
-
-    private void BuildIndexIfNecessary() {
-      if (this.treeIndex != null) return;
-
-      this.BuildIndex();
-    }
-
-    private void BuildIndex() {
-      this.treeIndex = new int[this.State.Length];
-
-      var next = 1;
-
-      for (var i = this.State.Length - 1; i >= 0; i--) {
-        var subExpression = this.State[i];
-
-        this.treeIndex[i] = next;
-
-        if (subExpression.GetType() == typeof(ExecExpandExpression)) {
-          next += (subExpression as ExecExpandExpression).TotalCount;
-        } else {
-          next++;
-        }
-      }
+      return _treeIndex[mid] == index
+          ? resolver(parent, this, State[mid], mid, parentIndex)
+          : (State[mid + 1] as ExecExpandExpression).GetFromTree(index - _treeIndex[mid + 1], mid + 1,
+              this, resolver);
     }
   }
@@ -195,6 +213,5 @@
   /// </summary>
   public class ExecIfExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "EXEC.IF";
+    public ExecIfExpression() : base("EXEC.IF") {
     }
 
@@ -215,6 +232,5 @@
   /// </summary>
   public class ExecYExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "EXEC.Y";
+    public ExecYExpression() : base("EXEC.Y") {
     }
 
@@ -224,5 +240,5 @@
 
       var top = interpreter.ExecStack.Top;
-      var result = new ExecExpandExpression(new[] { top, new ExecYExpression() });
+      var result = new ExecExpandExpression(top, new ExecYExpression());
 
       interpreter.ExecStack.Insert(interpreter.ExecStack.Count - 1, result);
@@ -234,6 +250,5 @@
   /// </summary>
   public class ExecKExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "EXEC.K";
+    public ExecKExpression() : base("EXEC.K") {
     }
 
@@ -252,6 +267,5 @@
   /// </summary>
   public class ExecSExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "EXEC.S";
+    public ExecSExpression() : base("EXEC.S") {
     }
 
@@ -259,10 +273,10 @@
       if (interpreter.ExecStack.Count < 3) return;
 
-      var State = interpreter.ExecStack.Pop(2);
-      var a = State[1];
-      var b = State[0];
+      var expression = interpreter.ExecStack.Pop(2);
+      var a = expression[1];
+      var b = expression[0];
       var c = interpreter.ExecStack.Top;
 
-      var newTop = new ExecExpandExpression(new[] { c, b });
+      var newTop = new ExecExpandExpression(c, b);
 
       interpreter.ExecStack.SetTop(newTop);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Expression.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Expression.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Expression.cs	(revision 14602)
@@ -4,35 +4,16 @@
 
   public abstract class Expression {
-    protected int id;
-    protected string stringRepresentation;
+    private readonly string stringRepresentation;
 
-    public string StringRepresentation
-    {
-      get { return this.stringRepresentation ?? (this.stringRepresentation = this.InitStringRepresentation()); }
+    protected Expression(string stringRepresentation) {
+      this.stringRepresentation = stringRepresentation;
     }
 
-    public int Id
-    {
-      get
-      {
-        if (this.id == default(int))
-          this.id = this.InitId();
-
-        return this.id;
-      }
-    }
+    public string StringRepresentation { get { return this.stringRepresentation; } }
 
     public abstract void Eval(IPushGpInterpreter interpreter);
 
-    protected abstract int InitId();
-
-    protected abstract string InitStringRepresentation();
-
-    public override bool Equals(object obj) {
-      return (obj != null) && ((this.GetHashCode() == obj.GetHashCode()) || (this.GetType() == obj.GetType()));
-    }
-
-    public override int GetHashCode() {
-      return this.Id;
+    public override string ToString() {
+      return this.stringRepresentation;
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ExpressionTable.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ExpressionTable.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ExpressionTable.cs	(revision 14602)
@@ -5,7 +5,9 @@
 
   public static class ExpressionTable {
-    private static readonly Dictionary<string, Expression> statelessExpressionTable;
+    private static readonly IDictionary<string, Expression> statelessExpressionTable;
+    private static readonly IDictionary<string, Func<Expression>> statefullExpressionFactory;
 
-    private static readonly Dictionary<string, Func<Expression>> statefullExpressionFactory;
+    private static readonly IDictionary<int, string> indexToNameTable = new Dictionary<int, string>();
+
 
     public static int Count;
@@ -43,4 +45,5 @@
 
         dictionary.Add(key, expression);
+        indexToNameTable.Add(indexToNameTable.Keys.Count, key);
       }
 
@@ -63,4 +66,5 @@
 
         dictionary.Add(key, creator);
+        indexToNameTable.Add(indexToNameTable.Keys.Count, key);
       }
 
@@ -102,8 +106,21 @@
 
     public static Expression GetExpression(int index) {
+      var name = indexToNameTable[index];
+      return GetExpression(name);
+
       // TODO: build lookup table for index to determine the key for the dictionary (get rid of ElementAt, is it slow?)
-      return index < StatelessCount
-               ? statelessExpressionTable.ElementAt(index).Value
-               : statefullExpressionFactory.ElementAt(index - StatelessCount).Value();
+      //return index < StatelessCount
+      //         ? statelessExpressionTable.ElementAt(index).Value
+      //         : statefullExpressionFactory.ElementAt(index - StatelessCount).Value();
+    }
+
+    public static ExecExpandExpression GetProgram(int[] index) {
+      var expressions = new List<Expression>(index.Length);
+
+      for (var i = 0; i < index.Length; i++) {
+        expressions.Add(GetExpression(index[i]));
+      }
+
+      return new ExecExpandExpression(expressions);
     }
 
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/FloatExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/FloatExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/FloatExpressions.cs	(revision 14602)
@@ -1,228 +1,214 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using System;
-
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-
-  /// <summary>
-  ///     Pushes the sum of the top two items.
-  /// </summary>
-  public class FloatAddExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.+";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 2, values => values[0] + values[1]);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the difference of the top two items; that is, the second item minus the top item.
-  /// </summary>
-  public class FloatSubtractExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.-";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 2, values => values[0] - values[1]);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the product of the top two items.
-  /// </summary>
-  public class FloatMultiplyExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.*";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 2, values => values[0] * values[1]);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the quotient of the top two items; that is, the second item divided by the top item.
-  ///     If the top item is zero this acts as a NOOP.
-  /// </summary>
-  public class FloatDivideExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT./";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 2, values => values[0] / values[1], 0);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the second stack item modulo the top stack item. If the top item is zero this acts as a NOOP.
-  ///     The modulus is computed as the remainder of the quotient, where the quotient has first been truncated toward
-  ///     negative infinity.
-  ///     (This is taken from the definition for the generic MOD function in Common Lisp, which is described
-  ///     for example at http://www.lispworks.com/reference/HyperSpec/Body/f_mod_r.htm.)
-  /// </summary>
-  public class FloatModuloExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.%";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 2, values => values[0] % values[1], 0);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the minimum of the top two items.
-  /// </summary>
-  public class FloatMinExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.MIN";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 2, values => Math.Min(values[0], values[1]));
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the maximum of the top two items.
-  /// </summary>
-  public class FloatMaxExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.MAX";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 2, values => Math.Max(values[0], values[1]));
-    }
-  }
-
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the second item is less than the top item, or FALSE otherwise.
-  /// </summary>
-  public class FloatSmallerThanExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.<";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, interpreter.BooleanStack, 2, values => values[0] < values[1]);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the second item is greater than the top item, or FALSE otherwise.
-  /// </summary>
-  public class FloatGreaterThanExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.>";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, interpreter.BooleanStack, 2, values => values[0] > values[1]);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the sine of the top item.
-  /// </summary>
-  public class FloatSineExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.SIN";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 1, values => Math.Sin(values[0]));
-    }
-  }
-
-  /// <summary>
-  ///     Pushes the cosine of the top item.
-  /// </summary>
-  public class FloatCosineExpression : PushResultExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.COS";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack, 1, values => Math.Cos(values[0]));
-    }
-  }
-
-  /// <summary>
-  ///     Pushes 1 if the top BOOLEAN is TRUE, or 0 if the top BOOLEAN is FALSE.
-  /// </summary>
-  public class FloatFromBooleanExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.FROMBOOLEAN";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      if (interpreter.BooleanStack.Count == 0) return;
-
-      var condition = interpreter.BooleanStack.Pop();
-      var value = condition ? 1 : 0;
-
-      interpreter.FloatStack.Push(value);
-    }
-  }
-
-  /// <summary>
-  ///     Pushes a floating point version of the top INTEGER.
-  /// </summary>
-  public class FloatFromIntegerExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.FROMINTEGER";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      if (interpreter.IntegerStack.Count == 0) return;
-
-      var value = (double)interpreter.IntegerStack.Pop();
-
-      interpreter.FloatStack.Push(value);
-    }
-  }
+    using System;
+    using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+    /// <summary>
+    ///     Pushes the sum of the top two items.
+    /// </summary>
+    public class FloatAddExpression : PushResultExpression<double>
+    {
+        public FloatAddExpression() : base("FLOAT.+")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.FloatStack, 2, values => values[0] + values[1]);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the difference of the top two items; that is, the second item minus the top item.
+    /// </summary>
+    public class FloatSubtractExpression : PushResultExpression<double>
+    {
+        public FloatSubtractExpression() : base("FLOAT.-")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 2, values => values[0] - values[1]);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the product of the top two items.
+    /// </summary>
+    public class FloatMultiplyExpression : PushResultExpression<double>
+    {
+        public FloatMultiplyExpression() : base("FLOAT.*")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 2, values => values[0] * values[1]);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the quotient of the top two items; that is, the second item divided by the top item.
+    ///     If the top item is zero this acts as a NOOP.
+    /// </summary>
+    public class FloatDivideExpression : PushResultExpression<double>
+    {
+        public FloatDivideExpression() : base("FLOAT./")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 2, values => values[0] / values[1], 0);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the second stack item modulo the top stack item. If the top item is zero this acts as a NOOP.
+    ///     The modulus is computed as the remainder of the quotient, where the quotient has first been truncated toward
+    ///     negative infinity.
+    ///     (This is taken from the definition for the generic MOD function in Common Lisp, which is described
+    ///     for example at http://www.lispworks.com/reference/HyperSpec/Body/f_mod_r.htm.)
+    /// </summary>
+    public class FloatModuloExpression : PushResultExpression<double>
+    {
+        public FloatModuloExpression() : base("FLOAT.%")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 2, values => values[0] % values[1], 0);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the minimum of the top two items.
+    /// </summary>
+    public class FloatMinExpression : PushResultExpression<double>
+    {
+        public FloatMinExpression() : base("FLOAT.MIN")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 2, values => Math.Min(values[0], values[1]));
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the maximum of the top two items.
+    /// </summary>
+    public class FloatMaxExpression : PushResultExpression<double>
+    {
+        public FloatMaxExpression() : base("FLOAT.MAX")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 2, values => Math.Max(values[0], values[1]));
+        }
+    }
+
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the second item is less than the top item, or FALSE otherwise.
+    /// </summary>
+    public class FloatSmallerThanExpression : PushResultExpression<double>
+    {
+        public FloatSmallerThanExpression() : base("FLOAT.<")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, interpreter.BooleanStack, 2, values => values[0] < values[1]);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the second item is greater than the top item, or FALSE otherwise.
+    /// </summary>
+    public class FloatGreaterThanExpression : PushResultExpression<double>
+    {
+        public FloatGreaterThanExpression() : base("FLOAT.>")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, interpreter.BooleanStack, 2, values => values[0] > values[1]);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the sine of the top item.
+    /// </summary>
+    public class FloatSineExpression : PushResultExpression<double>
+    {
+        public FloatSineExpression() : base("FLOAT.SIN")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 1, values => Math.Sin(values[0]));
+        }
+    }
+
+    /// <summary>
+    ///     Pushes the cosine of the top item.
+    /// </summary>
+    public class FloatCosineExpression : PushResultExpression<double>
+    {
+        public FloatCosineExpression() : base("FLOAT.COS")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, 1, values => Math.Cos(values[0]));
+        }
+    }
+
+    /// <summary>
+    ///     Pushes 1 if the top BOOLEAN is TRUE, or 0 if the top BOOLEAN is FALSE.
+    /// </summary>
+    public class FloatFromBooleanExpression : StatelessExpression
+    {
+        public FloatFromBooleanExpression() : base("FLOAT.FROMBOOLEAN")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.BooleanStack.Count == 0) return;
+
+            var condition = interpreter.BooleanStack.Pop();
+            var value = condition ? 1 : 0;
+
+            interpreter.FloatStack.Push(value);
+        }
+    }
+
+    /// <summary>
+    ///     Pushes a floating point version of the top INTEGER.
+    /// </summary>
+    public class FloatFromIntegerExpression : StatelessExpression
+    {
+        public FloatFromIntegerExpression() : base("FLOAT.FROMINTEGER")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.IntegerStack.Count == 0) return;
+
+            var value = (double) interpreter.IntegerStack.Pop();
+
+            interpreter.FloatStack.Push(value);
+        }
+    }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/FlushExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/FlushExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/FlushExpressions.cs	(revision 14602)
@@ -1,95 +1,93 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using Interpreter;
+    using Stack;
 
-  /// <summary>
-  ///     Empties the given stack.
-  /// </summary>
-  /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class FlushExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack)
+    /// <summary>
+    ///     Empties the given stack.
+    /// </summary>
+    /// <typeparam name="T">Stacktype</typeparam>
+    public abstract class FlushExpression<T> : StatelessExpression
     {
-      stack.Clear();
-    }
-  }
+        protected FlushExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
 
-  public class IntegerFlushExpression : FlushExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.FLUSH";
+        public void Eval(IStack<T> stack)
+        {
+            stack.Clear();
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class IntegerFlushExpression : FlushExpression<long>
     {
-      this.Eval(interpreter.IntegerStack);
-    }
-  }
+        public IntegerFlushExpression() : base("INTEGER.FLUSH")
+        {
+        }
 
-  public class FloatFlushExpression : FlushExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.FLUSH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class FloatFlushExpression : FlushExpression<double>
     {
-      this.Eval(interpreter.FloatStack);
-    }
-  }
+        public FloatFlushExpression() : base("FLOAT.FLUSH")
+        {
+        }
 
-  public class BooleanFlushExpression : FlushExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.FLUSH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.FloatStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class BooleanFlushExpression : FlushExpression<bool>
     {
-      this.Eval(interpreter.BooleanStack);
-    }
-  }
+        public BooleanFlushExpression() : base("BOOLEAN.FLUSH")
+        {
+        }
 
-  public class NameFlushExpression : FlushExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.FLUSH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NameFlushExpression : FlushExpression<string>
     {
-      this.Eval(interpreter.NameStack);
-    }
-  }
+        public NameFlushExpression() : base("NAME.FLUSH")
+        {
+        }
 
-  public class ExecFlushExpression : FlushExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.FLUSH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.NameStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecFlushExpression : FlushExpression<Expression>
     {
-      this.Eval(interpreter.ExecStack);
-    }
-  }
+        public ExecFlushExpression() : base("EXEC.FLUSH")
+        {
+        }
 
-  public class CodeFlushExpression : FlushExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.FLUSH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.ExecStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodeFlushExpression : FlushExpression<Expression>
     {
-      this.Eval(interpreter.CodeStack);
+        public CodeFlushExpression() : base("CODE.FLUSH")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.CodeStack);
+        }
     }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/IntegerExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/IntegerExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/IntegerExpressions.cs	(revision 14602)
@@ -1,197 +1,185 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using System;
+    using System;
+    using HeuristicLab.Algorithms.PushGP.Interpreter;
 
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
+    /// <summary>
+    ///     Pushes the sum of the top two items.
+    /// </summary>
+    public class IntegerAddExpression : PushResultExpression<long>
+    {
+        public IntegerAddExpression() : base("INTEGER.+")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes the sum of the top two items.
-  /// </summary>
-  public class IntegerAddExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.+";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, 2, values => values[0] + values[1]);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes the difference of the top two items; that is, the second item minus the top item.
+    /// </summary>
+    public class IntegerSubtractExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, 2, values => values[0] + values[1]);
-    }
-  }
+        public IntegerSubtractExpression() : base("INTEGER.-")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes the difference of the top two items; that is, the second item minus the top item.
-  /// </summary>
-  public class IntegerSubtractExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.-";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, 2, values => values[0] - values[1]);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes the product of the top two items.
+    /// </summary>
+    public class IntegerMultiplyExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, 2, values => values[0] - values[1]);
-    }
-  }
+        public IntegerMultiplyExpression() : base("INTEGER.*")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes the product of the top two items.
-  /// </summary>
-  public class IntegerMultiplyExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.*";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, 2, values => values[0] * values[1]);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes the quotient of the top two items; that is, the second item divided by the top item.
+    ///     If the top item is zero this acts as a NOOP.
+    /// </summary>
+    public class IntegerDivideExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, 2, values => values[0] * values[1]);
-    }
-  }
+        public IntegerDivideExpression() : base("INTEGER./")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes the quotient of the top two items; that is, the second item divided by the top item.
-  ///     If the top item is zero this acts as a NOOP.
-  /// </summary>
-  public class IntegerDivideExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER./";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, 2, values => values[0] / values[1], 0);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes the second stack item modulo the top stack item. If the top item is zero this acts as a NOOP. The modulus is
+    ///     computed as the
+    ///     remainder of the quotient, where the quotient has first been truncated toward negative infinity. (This is taken
+    ///     from the definition
+    ///     for the generic MOD function in Common Lisp, which is described for example at
+    ///     http://www.lispworks.com/reference/HyperSpec/Body/f_mod_r.htm.)
+    /// </summary>
+    public class IntegerModuloExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, 2, values => values[0] / values[1], 0);
-    }
-  }
+        public IntegerModuloExpression() : base("INTEGER.%")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes the second stack item modulo the top stack item. If the top item is zero this acts as a NOOP. The modulus is
-  ///     computed as the
-  ///     remainder of the quotient, where the quotient has first been truncated toward negative infinity. (This is taken
-  ///     from the definition
-  ///     for the generic MOD function in Common Lisp, which is described for example at
-  ///     http://www.lispworks.com/reference/HyperSpec/Body/f_mod_r.htm.)
-  /// </summary>
-  public class IntegerModuloExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.%";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, 2, values => values[0] % values[1], 0);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes the minimum of the top two items.
+    /// </summary>
+    public class IntegerMinExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, 2, values => values[0] % values[1], 0);
-    }
-  }
+        public IntegerMinExpression() : base("INTEGER.MIN")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes the minimum of the top two items.
-  /// </summary>
-  public class IntegerMinExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.MIN";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, 2, values => Math.Min(values[0], values[1]));
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes the maximum of the top two items.
+    /// </summary>
+    public class IntegerMaxExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, 2, values => Math.Min(values[0], values[1]));
-    }
-  }
+        public IntegerMaxExpression() : base("INTEGER.MAX")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes the maximum of the top two items.
-  /// </summary>
-  public class IntegerMaxExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.MAX";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, 2, values => Math.Max(values[0], values[1]));
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the second item is less than the top item, or FALSE otherwise.
+    /// </summary>
+    public class IntegerSmallerThanExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, 2, values => Math.Max(values[0], values[1]));
-    }
-  }
+        public IntegerSmallerThanExpression() : base("INTEGER.<")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the second item is less than the top item, or FALSE otherwise.
-  /// </summary>
-  public class IntegerSmallerThanExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.<";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, interpreter.BooleanStack, 2, values => values[0] < values[1]);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes TRUE onto the BOOLEAN stack if the second item is greater than the top item, or FALSE otherwise.
+    /// </summary>
+    public class IntegerGreaterThanExpression : PushResultExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, interpreter.BooleanStack, 2, values => values[0] < values[1]);
-    }
-  }
+        public IntegerGreaterThanExpression() : base("INTEGER.>")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes TRUE onto the BOOLEAN stack if the second item is greater than the top item, or FALSE otherwise.
-  /// </summary>
-  public class IntegerGreaterThanExpression : PushResultExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.>";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, interpreter.BooleanStack, 2, values => values[0] > values[1]);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes 1 if the top BOOLEAN is TRUE, or 0 if the top BOOLEAN is FALSE.
+    /// </summary>
+    public class IntegerFromBooleanExpression : StatelessExpression
     {
-      this.Eval(interpreter.IntegerStack, interpreter.BooleanStack, 2, values => values[0] > values[1]);
-    }
-  }
+        public IntegerFromBooleanExpression() : base("INTEGER.FROMBOOLEAN")
+        {
+        }
 
-  /// <summary>
-  ///     Pushes 1 if the top BOOLEAN is TRUE, or 0 if the top BOOLEAN is FALSE.
-  /// </summary>
-  public class IntegerFromBooleanExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.FROMBOOLEAN";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.BooleanStack.Count == 0) return;
+
+            var condition = interpreter.BooleanStack.Pop();
+            var value = condition ? 1 : 0;
+
+            interpreter.IntegerStack.Push(value);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes the result of truncating the top FLOAT.
+    /// </summary>
+    public class IntegerFromFloatExpression : StatelessExpression
     {
-      if (interpreter.BooleanStack.Count == 0) return;
+        public IntegerFromFloatExpression() : base("INTEGER.FROMFLOAT")
+        {
+        }
 
-      var condition = interpreter.BooleanStack.Pop();
-      var value = condition ? 1 : 0;
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.FloatStack.Count == 0) return;
 
-      interpreter.IntegerStack.Push(value);
+            var value = (int) interpreter.FloatStack.Pop();
+
+            interpreter.IntegerStack.Push(value);
+        }
     }
-  }
-
-  /// <summary>
-  ///     Pushes the result of truncating the top FLOAT.
-  /// </summary>
-  public class IntegerFromFloatExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.FROMFLOAT";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      if (interpreter.FloatStack.Count == 0) return;
-
-      var value = (int)interpreter.FloatStack.Pop();
-
-      interpreter.IntegerStack.Push(value);
-    }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/LoopExpression.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/LoopExpression.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/LoopExpression.cs	(revision 14602)
@@ -1,3 +1,4 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
+
   using HeuristicLab.Algorithms.PushGP.Interpreter;
   using HeuristicLab.Algorithms.PushGP.Stack;
@@ -11,5 +12,5 @@
 
   public abstract class LoopExpression : StatefullExpression<LoopState> {
-    protected LoopExpression() : base(new LoopState()) { }
+    protected LoopExpression(string stringRepresentation) : base(new LoopState(), stringRepresentation) { }
 
     protected void Eval(IPushGpInterpreter interpreter, IStack<Expression> sourceStack, bool pushCurrentIndex = false) {
@@ -52,37 +53,36 @@
 
     public override bool Equals(object obj) {
-      if (!base.Equals(obj)) return false;
+      if (this == obj)
+        return true;
+
+      if (obj == null || obj.GetType() != this.GetType())
+        return false;
 
       var other = obj as LoopExpression;
 
-      var isBodyEqual = ((this.State.Body == null) && (other.State.Body == null))
-                        || (this.State.Body != null && this.State.Body.Equals(other.State.Body));
+      if (this.State.CurrentIndex != other.State.CurrentIndex ||
+          this.State.DestinationIndex != other.State.DestinationIndex ||
+          this.State.Incrementor != other.State.Incrementor)
+        return false;
 
-      return isBodyEqual && (this.State.CurrentIndex == other.State.CurrentIndex)
-             && (this.State.DestinationIndex == other.State.DestinationIndex) && (this.State.Incrementor == other.State.Incrementor);
+      var isBodyEqual = this.State.Body == other.State.Body ||
+                        (this.State.Body != null &&
+                        other.State.Body != null &&
+                        this.State.Body.Equals(other.State.Body));
+
+      return isBodyEqual;
     }
 
-    public override string ToString() {
-      return this.StringRepresentation;
-    }
+    protected override int CalcHashCode() {
+      var hash = 19;
 
-    public override int GetHashCode() {
-      return base.GetHashCode();
-    }
+      if (this.State.Body != null)
+        hash = hash * 31 + this.State.Body.GetHashCode();
 
-    protected override int InitId() {
-      unchecked {
-        var hash = 19;
+      hash = hash * 31 + this.State.CurrentIndex.GetHashCode();
+      hash = hash * 31 + this.State.DestinationIndex.GetHashCode();
+      hash = hash * 31 + this.State.Incrementor.GetHashCode();
 
-        hash = hash * 31 + this.GetType().GetHashCode();
-
-        if ((this.State.Body != null) && (this.State.Body != this)) hash = hash * 31 + this.State.Body.GetHashCode();
-
-        hash = hash * 31 + this.State.CurrentIndex.GetHashCode();
-        hash = hash * 31 + this.State.DestinationIndex.GetHashCode();
-        hash = hash * 31 + this.State.Incrementor.GetHashCode();
-
-        return hash;
-      }
+      return hash;
     }
 
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/NameExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/NameExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/NameExpressions.cs	(revision 14602)
@@ -1,85 +1,69 @@
-﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
-  using System.Linq;
-  using System.Threading;
+﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
+{
+    using System.Linq;
+    using System.Threading;
+    using Data.Random;
+    using Interpreter;
+    using Core;
 
-  using HeuristicLab.Algorithms.PushGP.Data.Random;
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Core;
+    public class NameDefineXExecExpression : WrapperExpression<string>
+    {
+        public NameDefineXExecExpression(string state) : base(state) { }
 
-  public class NameDefineXExecExpression : StatefullExpression<string> {
-
-    public NameDefineXExecExpression(string state) : base(state) { }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      Expression expression;
-      if (!interpreter.IsNameQuoteFlagSet && interpreter.CustomExpressions.TryGetValue(this.State, out expression)) {
-        interpreter.ExecStack.Push(expression);
-      } else {
-        interpreter.NameStack.Push(this.State);
-        interpreter.IsNameQuoteFlagSet = false;
-      }
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Expression expression;
+            if (!interpreter.IsNameQuoteFlagSet &&
+                interpreter.CustomExpressions.TryGetValue(State, out expression))
+            {
+                interpreter.ExecStack.Push(expression);
+            }
+            else
+            {
+                interpreter.NameStack.Push(State);
+                interpreter.IsNameQuoteFlagSet = false;
+            }
+        }
     }
 
-    public override bool Equals(object obj) {
-      if (!base.Equals(obj)) return false;
+    /// <summary>
+    ///     Sets a flag indicating that the next State encountered will be pushed onto the NAME stack (and not have its
+    ///     associated value
+    ///     pushed onto the EXEC stack), regardless of whether or not it has a definition. Upon encountering such a State and
+    ///     pushing it
+    ///     onto the NAME stack the flag will be cleared (whether or not the pushed State had a definition).
+    /// </summary>
+    public class NameQuoteExpression : StatelessExpression
+    {
+        public NameQuoteExpression() : base("NAME.QUOTE")
+        {
+        }
 
-      var other = obj as NameDefineXExecExpression;
-
-      return this.State.Equals(other.State);
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            interpreter.IsNameQuoteFlagSet = true;
+        }
     }
 
-    public override int GetHashCode() {
-      return base.GetHashCode();
+    /// <summary>
+    ///     Pushes a randomly selected NAME that already has a definition.
+    /// </summary>
+    public class NameRandBoundNameExpression : StatelessExpression
+    {
+        private static readonly ThreadLocal<IRandom> Rand = RandomFactory.GetRandom();
+
+        public NameRandBoundNameExpression() : base("NAME.RANDBOUNDNAME")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (!interpreter.CustomExpressions.Any()) return;
+
+            var index = Rand.Value.Next(0, interpreter.CustomExpressions.Keys.Count - 1);
+            var state = interpreter.CustomExpressions.Keys.ElementAt(index);
+
+            interpreter.NameStack.Push(state);
+        }
     }
-
-    protected override string InitStringRepresentation() {
-      return this.State;
-    }
-
-    protected override int InitId() {
-      var hash = 19;
-
-      hash = hash * 31 + this.GetType().GetHashCode();
-      hash = hash * 31 + this.State.GetHashCode();
-
-      return hash;
-    }
-  }
-
-  /// <summary>
-  ///     Sets a flag indicating that the next State encountered will be pushed onto the NAME stack (and not have its
-  ///     associated value
-  ///     pushed onto the EXEC stack), regardless of whether or not it has a definition. Upon encountering such a State and
-  ///     pushing it
-  ///     onto the NAME stack the flag will be cleared (whether or not the pushed State had a definition).
-  /// </summary>
-  public class NameQuoteExpression : StatelessExpression {
-    protected override string InitStringRepresentation() {
-      return "NAME.QUOTE";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      interpreter.IsNameQuoteFlagSet = true;
-    }
-  }
-
-  /// <summary>
-  ///     Pushes a randomly selected NAME that already has a definition.
-  /// </summary>
-  public class NameRandBoundNameExpression : StatelessExpression {
-    private static readonly ThreadLocal<IRandom> Rand = RandomFactory.GetRandom();
-
-    protected override string InitStringRepresentation() {
-      return "NAME.RANDBOUNDNAME";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter) {
-      if (!interpreter.CustomExpressions.Any()) return;
-
-      var index = Rand.Value.Next(0, interpreter.CustomExpressions.Keys.Count - 1);
-      var state = interpreter.CustomExpressions.Keys.ElementAt(index);
-
-      interpreter.NameStack.Push(state);
-    }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PopExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PopExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PopExpressions.cs	(revision 14602)
@@ -1,93 +1,91 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using Interpreter;
+    using Stack;
 
-  public abstract class PopExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack)
+    public abstract class PopExpression<T> : StatelessExpression
     {
-      if (stack.Count == 0) return;
+        protected PopExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
 
-      stack.Pop();
-    }
-  }
+        public void Eval(IStack<T> stack)
+        {
+            if (stack.Count == 0) return;
 
-  public class IntegerPopExpression : PopExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.POP";
+            stack.Pop();
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class IntegerPopExpression : PopExpression<long>
     {
-      this.Eval(interpreter.IntegerStack);
-    }
-  }
+        public IntegerPopExpression() : base("INTEGER.POP")
+        {
+        }
 
-  public class FloatPopExpression : PopExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.POP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class FloatPopExpression : PopExpression<double>
     {
-      this.Eval(interpreter.FloatStack);
-    }
-  }
+        public FloatPopExpression() : base("FLOAT.POP")
+        {
+        }
 
-  public class BooleanPopExpression : PopExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.POP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class BooleanPopExpression : PopExpression<bool>
     {
-      this.Eval(interpreter.BooleanStack);
-    }
-  }
+        public BooleanPopExpression() : base("BOOLEAN.POP")
+        {
+        }
 
-  public class NamePopExpression : PopExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.POP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NamePopExpression : PopExpression<string>
     {
-      this.Eval(interpreter.NameStack);
-    }
-  }
+        public NamePopExpression() : base("NAME.POP")
+        {
+        }
 
-  public class ExecPopExpression : PopExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.POP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.NameStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecPopExpression : PopExpression<Expression>
     {
-      this.Eval(interpreter.ExecStack);
-    }
-  }
+        public ExecPopExpression() : base("EXEC.POP")
+        {
+        }
 
-  public class CodePopExpression : PopExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.POP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.ExecStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodePopExpression : PopExpression<Expression>
     {
-      this.Eval(interpreter.CodeStack);
+        public CodePopExpression() : base("CODE.POP")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.CodeStack);
+        }
     }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PushExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PushExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PushExpressions.cs	(revision 14602)
@@ -3,30 +3,10 @@
   using HeuristicLab.Algorithms.PushGP.Stack;
 
-  public abstract class PushExpression<T> : StatefullExpression<T> {
+  public abstract class PushExpression<T> : WrapperExpression<T> {
 
     protected PushExpression(T state) : base(state) { }
 
-    protected override int InitId() {
-      var hash = 19;
-
-      hash = hash * 31 + this.GetType().GetHashCode();
-      hash = hash * 31 + this.State.GetHashCode();
-
-      return hash;
-    }
-
     protected void Eval(IStack<T> stack) {
       stack.Push(this.State);
-    }
-
-    public override bool Equals(object obj) {
-      if (!(obj is PushExpression<T>)) return false;
-      var other = (PushExpression<T>)obj;
-
-      return this.State.Equals(other.State);
-    }
-
-    public override int GetHashCode() {
-      return base.GetHashCode();
     }
   }
@@ -35,8 +15,4 @@
     public IntegerPushExpression(long state)
       : base(state) {
-    }
-
-    protected override string InitStringRepresentation() {
-      return "IntegerPush";
     }
 
@@ -51,8 +27,4 @@
     }
 
-    protected override string InitStringRepresentation() {
-      return "FloatPush";
-    }
-
     public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(interpreter.FloatStack);
@@ -63,8 +35,4 @@
     public BooleanPushExpression(bool state)
       : base(state) {
-    }
-
-    protected override string InitStringRepresentation() {
-      return "BooleanPush";
     }
 
@@ -79,8 +47,4 @@
     }
 
-    protected override string InitStringRepresentation() {
-      return "NamePush";
-    }
-
     public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(interpreter.NameStack);
@@ -93,8 +57,4 @@
     }
 
-    protected override string InitStringRepresentation() {
-      return "ExecPush";
-    }
-
     public override void Eval(IPushGpInterpreter interpreter) {
       this.Eval(interpreter.ExecStack);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PushResultExpression.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PushResultExpression.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/PushResultExpression.cs	(revision 14602)
@@ -5,4 +5,6 @@
 
   public abstract class PushResultExpression<T> : StatelessExpression {
+    protected PushResultExpression(string stringRepresentation) : base(stringRepresentation) { }
+
     protected void Eval(IStack<T> stack, int count, Func<T[], T> templateFunc) {
       if (stack.Count < count) return;
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/RandExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/RandExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/RandExpressions.cs	(revision 14602)
@@ -1,103 +1,98 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Generators;
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
+    using HeuristicLab.Algorithms.PushGP.Generators;
+    using HeuristicLab.Algorithms.PushGP.Interpreter;
 
-  /// <summary>
-  ///     Pushes a random NAME.
-  /// </summary>
-  public class NameRandExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
+    /// <summary>
+    ///     Pushes a random NAME.
+    /// </summary>
+    public class NameRandExpression : StatelessExpression
     {
-      return "NAME.RAND";
+        public NameRandExpression() : base("NAME.RAND")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            var name = NameGenerator.RandomName();
+
+            interpreter.NameStack.Push(name);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes a random integer.
+    /// </summary>
+    public class IntegerRandExpression : StatelessExpression
     {
-      var name = NameGenerator.RandomName();
+        public IntegerRandExpression() : base("INTEGER.RAND")
+        {
+        }
 
-      interpreter.NameStack.Push(name);
-    }
-  }
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            var value = IntegerGenerator.RandomInteger(
+                interpreter.Configuration.MinRandomInteger,
+                interpreter.Configuration.MaxRandomInteger);
 
-  /// <summary>
-  ///     Pushes a random integer.
-  /// </summary>
-  public class IntegerRandExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.RAND";
+            interpreter.IntegerStack.Push(value);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes a random float.
+    /// </summary>
+    public class FloatRandExpression : StatelessExpression
     {
-      var value = IntegerGenerator.RandomInteger(
-        interpreter.Configuration.MinRandomInteger,
-        interpreter.Configuration.MaxRandomInteger);
+        public FloatRandExpression() : base("FLOAT.RAND")
+        {
+        }
 
-      interpreter.IntegerStack.Push(value);
-    }
-  }
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            var value = FloatGenerator.RandomFloat(
+                interpreter.Configuration.MinRandomFloat,
+                interpreter.Configuration.MaxRandomFloat);
 
-  /// <summary>
-  ///     Pushes a random float.
-  /// </summary>
-  public class FloatRandExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.RAND";
+            interpreter.FloatStack.Push(value);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes a random boolean.
+    /// </summary>
+    public class BooleanRandExpression : StatelessExpression
     {
-      var value = FloatGenerator.RandomFloat(
-        interpreter.Configuration.MinRandomFloat,
-        interpreter.Configuration.MaxRandomFloat);
+        public BooleanRandExpression() : base("BOOLEAN.RAND")
+        {
+        }
 
-      interpreter.FloatStack.Push(value);
-    }
-  }
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            var value = BooleanGenerator.RandomBoolean();
 
-  /// <summary>
-  ///     Pushes a random boolean.
-  /// </summary>
-  public class BooleanRandExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.RAND";
+            interpreter.BooleanStack.Push(value);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    /// <summary>
+    ///     Pushes random expressions onto the code stack.
+    /// </summary>
+    public class CodeRandExpression : StatelessExpression
     {
-      var value = BooleanGenerator.RandomBoolean();
+        public CodeRandExpression() : base("CODE.RAND")
+        {
+        }
 
-      interpreter.BooleanStack.Push(value);
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            if (interpreter.IntegerStack.Count == 0 ||
+                interpreter.IntegerStack.Top < 1) return;
+
+            var size = (int) (interpreter.IntegerStack.Pop() % interpreter.Configuration.MaxPointsInRandomExpression);
+            var program = CodeGenerator.RandomProgram(size, interpreter.CustomExpressions);
+
+            interpreter.CodeStack.Push(program);
+        }
     }
-  }
-
-  /// <summary>
-  ///     Pushes random expressions onto the code stack.
-  /// </summary>
-  public class CodeRandExpression : StatelessExpression
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.RAND";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      if ((interpreter.IntegerStack.Count == 0) || (interpreter.IntegerStack.Top < 1)) return;
-
-      var size = (int)(interpreter.IntegerStack.Pop() % interpreter.Configuration.MaxPointsInRandomExpression);
-
-      var expression = CodeGenerator.RandomProgram(size, interpreter.CustomExpressions);
-
-      interpreter.CodeStack.Push(expression);
-    }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/RotateExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/RotateExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/RotateExpressions.cs	(revision 14602)
@@ -1,93 +1,77 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using Interpreter;
+    using Stack;
 
-  public abstract class RotateExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack)
+    public abstract class RotateExpression<T> : StatelessExpression
     {
-      if (stack.Count < 3) return;
+        protected RotateExpression(string stringRepresentation) : base(stringRepresentation) { }
 
-      stack.Swap(3);
-    }
-  }
+        public void Eval(IStack<T> stack)
+        {
+            if (stack.Count < 3) return;
 
-  public class IntegerRotateExpression : RotateExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.ROT";
+            stack.Swap(3);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class IntegerRotateExpression : RotateExpression<long>
     {
-      this.Eval(interpreter.IntegerStack);
-    }
-  }
+        public IntegerRotateExpression() : base("INTEGER.ROT") { }
 
-  public class FloatRotateExpression : RotateExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.ROT";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class FloatRotateExpression : RotateExpression<double>
     {
-      this.Eval(interpreter.FloatStack);
-    }
-  }
+        public FloatRotateExpression() : base("FLOAT.ROT") { }
 
-  public class BooleanRotateExpression : RotateExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.ROT";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.FloatStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class BooleanRotateExpression : RotateExpression<bool>
     {
-      this.Eval(interpreter.BooleanStack);
-    }
-  }
+        public BooleanRotateExpression() : base("BOOLEAN.ROT") { }
 
-  public class NameRotateExpression : RotateExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.ROT";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.BooleanStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NameRotateExpression : RotateExpression<string>
     {
-      this.Eval(interpreter.NameStack);
-    }
-  }
+        public NameRotateExpression() : base("NAME.ROT") { }
 
-  public class ExecRotateExpression : RotateExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.ROT";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.NameStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecRotateExpression : RotateExpression<Expression>
     {
-      this.Eval(interpreter.ExecStack);
-    }
-  }
+        public ExecRotateExpression() : base("EXEC.ROT") { }
 
-  public class CodeRotateExpression : RotateExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.ROT";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.ExecStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodeRotateExpression : RotateExpression<Expression>
     {
-      this.Eval(interpreter.CodeStack);
+        public CodeRotateExpression() : base("CODE.ROT") { }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.CodeStack);
+        }
     }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ShoveExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ShoveExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/ShoveExpressions.cs	(revision 14602)
@@ -1,98 +1,88 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using Interpreter;
+    using Stack;
 
-  public abstract class ShoveExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack, IStack<long> integerStack, int count = 1)
+    public abstract class ShoveExpression<T> : StatelessExpression
     {
-      if (integerStack.Count == 0) return;
+        protected ShoveExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
 
-      if ((integerStack.Top > stack.Count - count) || (integerStack.Top < 0) || (stack.Count < 2)) return;
+        protected void Eval(IStack<T> stack, IStack<long> integerStack, int count = 1)
+        {
+            if (integerStack.Count == 0 ||
+                integerStack.Top > stack.Count - count ||
+                integerStack.Top < 0 ||
+                stack.Count < 2)
+                return;
 
-      var index = (int)integerStack.Pop();
-      var item = stack.Pop();
+            var index = (int) integerStack.Pop();
+            var item = stack.Pop();
 
-      stack.Insert(index, item);
-    }
-  }
-
-  public class IntegerShoveExpression : ShoveExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.SHOVE";
+            stack.Insert(index, item);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class IntegerShoveExpression : ShoveExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, interpreter.IntegerStack, 2);
-    }
-  }
+        public IntegerShoveExpression() : base("INTEGER.SHOVE") { }
 
-  public class FloatShoveExpression : ShoveExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.SHOVE";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.IntegerStack, interpreter.IntegerStack, 2);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class FloatShoveExpression : ShoveExpression<double>
     {
-      this.Eval(interpreter.FloatStack, interpreter.IntegerStack);
-    }
-  }
+        public FloatShoveExpression() : base("FLOAT.SHOVE") { }
 
-  public class BooleanShoveExpression : ShoveExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.SHOVE";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.FloatStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class BooleanShoveExpression : ShoveExpression<bool>
     {
-      this.Eval(interpreter.BooleanStack, interpreter.IntegerStack);
-    }
-  }
+        public BooleanShoveExpression() : base("BOOLEAN.SHOVE") { }
 
-  public class NameShoveExpression : ShoveExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.SHOVE";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.BooleanStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NameShoveExpression : ShoveExpression<string>
     {
-      this.Eval(interpreter.NameStack, interpreter.IntegerStack);
-    }
-  }
+        public NameShoveExpression() : base("NAME.SHOVE") { }
 
-  public class ExecShoveExpression : ShoveExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.SHOVE";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.NameStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecShoveExpression : ShoveExpression<Expression>
     {
-      this.Eval(interpreter.ExecStack, interpreter.IntegerStack);
-    }
-  }
+        public ExecShoveExpression() : base("EXEC.SHOVE") { }
 
-  public class CodeShoveExpression : ShoveExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.SHOVE";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.ExecStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodeShoveExpression : ShoveExpression<Expression>
     {
-      this.Eval(interpreter.CodeStack, interpreter.IntegerStack);
+        public CodeShoveExpression() : base("CODE.SHOVE")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.CodeStack, interpreter.IntegerStack);
+        }
     }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StackdepthExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StackdepthExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StackdepthExpressions.cs	(revision 14602)
@@ -1,78 +1,97 @@
-﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
+{
+    using Interpreter;
+    using Stack;
 
-  /// <summary>
-  ///     Pushes the stack depth onto the INTEGER stack (thereby increasing it!).
-  /// </summary>
-  /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class StackdepthExpression<T> : StatelessExpression {
-    public void Eval(IStack<T> stack, IStack<long> integerStack, bool incremental = false) {
-      var count = stack.Count;
+    /// <summary>
+    ///     Pushes the stack depth onto the INTEGER stack (thereby increasing it!).
+    /// </summary>
+    /// <typeparam name="T">Stacktype</typeparam>
+    public abstract class StackdepthExpression<T> : StatelessExpression
+    {
+        protected StackdepthExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
 
-      if (incremental) count += 1;
+        public void Eval(IStack<T> stack, IStack<long> integerStack, bool incremental = false)
+        {
+            var count = stack.Count;
 
-      integerStack.Push(count);
-    }
-  }
+            if (incremental) count += 1;
 
-  public class IntegerStackdepthExpression : StackdepthExpression<long> {
-    protected override string InitStringRepresentation() {
-      return "INTEGER.STACKDEPTH";
+            integerStack.Push(count);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter) {
-      this.Eval(interpreter.IntegerStack, interpreter.IntegerStack, true);
-    }
-  }
+    public class IntegerStackdepthExpression : StackdepthExpression<long>
+    {
+        public IntegerStackdepthExpression() : base("INTEGER.STACKDEPTH")
+        {
+        }
 
-  public class FloatStackdepthExpression : StackdepthExpression<double> {
-    protected override string InitStringRepresentation() {
-      return "FLOAT.STACKDEPTH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.IntegerStack, interpreter.IntegerStack, true);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter) {
-      this.Eval(interpreter.FloatStack, interpreter.IntegerStack);
-    }
-  }
+    public class FloatStackdepthExpression : StackdepthExpression<double>
+    {
+        public FloatStackdepthExpression() : base("FLOAT.STACKDEPTH")
+        {
+        }
 
-  public class BooleanStackdepthExpression : StackdepthExpression<bool> {
-    protected override string InitStringRepresentation() {
-      return "BOOLEAN.STACKDEPTH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.FloatStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter) {
-      this.Eval(interpreter.BooleanStack, interpreter.IntegerStack);
-    }
-  }
+    public class BooleanStackdepthExpression : StackdepthExpression<bool>
+    {
+        public BooleanStackdepthExpression() : base("BOOLEAN.STACKDEPTH")
+        {
+        }
 
-  public class NameStackdepthExpression : StackdepthExpression<string> {
-    protected override string InitStringRepresentation() {
-      return "NAME.STACKDEPTH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.BooleanStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter) {
-      this.Eval(interpreter.NameStack, interpreter.IntegerStack);
-    }
-  }
+    public class NameStackdepthExpression : StackdepthExpression<string>
+    {
+        public NameStackdepthExpression() : base("NAME.STACKDEPTH")
+        {
+        }
 
-  public class ExecStackdepthExpression : StackdepthExpression<Expression> {
-    protected override string InitStringRepresentation() {
-      return "EXEC.STACKDEPTH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.NameStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter) {
-      this.Eval(interpreter.ExecStack, interpreter.IntegerStack);
-    }
-  }
+    public class ExecStackdepthExpression : StackdepthExpression<Expression>
+    {
+        public ExecStackdepthExpression() : base("EXEC.STACKDEPTH")
+        {
+        }
 
-  public class CodeStackdepthExpression : StackdepthExpression<Expression> {
-    protected override string InitStringRepresentation() {
-      return "CODE.STACKDEPTH";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.ExecStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter) {
-      this.Eval(interpreter.CodeStack, interpreter.IntegerStack);
+    public class CodeStackdepthExpression : StackdepthExpression<Expression>
+    {
+        public CodeStackdepthExpression() : base("CODE.STACKDEPTH")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            Eval(interpreter.CodeStack, interpreter.IntegerStack);
+        }
     }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StatefullExpression.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StatefullExpression.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StatefullExpression.cs	(revision 14602)
@@ -1,12 +1,27 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
+  using System;
+  using System.Threading;
+
   public abstract class StatefullExpression<T> : Expression {
+
     protected T State { get; set; }
 
-    protected StatefullExpression(T state) {
+    private readonly Lazy<int> hashCode;
+
+    protected StatefullExpression(T state, string stringRepresentation) : base(stringRepresentation) {
       this.State = state;
+      this.hashCode = new Lazy<int>(this.CalcHashCode, LazyThreadSafetyMode.ExecutionAndPublication);
     }
 
-    public override string ToString() {
-      return this.State.ToString();
+    protected virtual int CalcHashCode() {
+      return this.State.GetHashCode();
+    }
+
+    public override bool Equals(object obj) {
+      return obj != null && (this == obj || (this.GetType() == obj.GetType() && this.GetHashCode() == obj.GetHashCode()));
+    }
+
+    public override int GetHashCode() {
+      return hashCode.Value;
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StatelessExpression.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StatelessExpression.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/StatelessExpression.cs	(revision 14602)
@@ -1,10 +1,8 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
   public abstract class StatelessExpression : Expression {
-    protected override int InitId() {
+    protected StatelessExpression(string stringRepresentation) : base(stringRepresentation) { }
+
+    public override int GetHashCode() {
       return this.GetType().GetHashCode();
-    }
-
-    public override string ToString() {
-      return this.StringRepresentation;
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/SwapExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/SwapExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/SwapExpressions.cs	(revision 14602)
@@ -1,6 +1,5 @@
-﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
-{
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+﻿namespace HeuristicLab.Algorithms.PushGP.Expressions {
+  using Interpreter;
+  using Stack;
 
   /// <summary>
@@ -8,9 +7,11 @@
   /// </summary>
   /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class SwapExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack)
-    {
-      if (stack.Count < 2) return;
+  public abstract class SwapExpression<T> : StatelessExpression {
+    protected SwapExpression(string stringRepresentation) : base(stringRepresentation) {
+    }
+
+    public void Eval(IStack<T> stack) {
+      if (stack.Count < 2)
+        return;
 
       stack.Swap(2);
@@ -18,79 +19,55 @@
   }
 
-  public class IntegerSwapExpression : SwapExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.SWAP";
+  public class IntegerSwapExpression : SwapExpression<long> {
+    public IntegerSwapExpression() : base("INTEGER.SWAP") {
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.IntegerStack);
+    public override void Eval(IPushGpInterpreter interpreter) {
+      Eval(interpreter.IntegerStack);
     }
   }
 
-  public class FloatSwapExpression : SwapExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.SWAP";
+  public class FloatSwapExpression : SwapExpression<double> {
+    public FloatSwapExpression() : base("FLOAT.SWAP") {
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.FloatStack);
+    public override void Eval(IPushGpInterpreter interpreter) {
+      Eval(interpreter.FloatStack);
     }
   }
 
-  public class BooleanSwapExpression : SwapExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.SWAP";
+  public class BooleanSwapExpression : SwapExpression<bool> {
+    public BooleanSwapExpression() : base("BOOLEAN.SWAP") {
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.BooleanStack);
+    public override void Eval(IPushGpInterpreter interpreter) {
+      Eval(interpreter.BooleanStack);
     }
   }
 
-  public class NameSwapExpression : SwapExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.SWAP";
+  public class NameSwapExpression : SwapExpression<string> {
+    public NameSwapExpression() : base("NAME.SWAP") {
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.NameStack);
+    public override void Eval(IPushGpInterpreter interpreter) {
+      Eval(interpreter.NameStack);
     }
   }
 
-  public class ExecSwapExpression : SwapExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.SWAP";
+  public class ExecSwapExpression : SwapExpression<Expression> {
+    public ExecSwapExpression() : base("EXEC.SWAP") {
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.ExecStack);
+    public override void Eval(IPushGpInterpreter interpreter) {
+      Eval(interpreter.ExecStack);
     }
   }
 
-  public class CodeSwapExpression : SwapExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.SWAP";
+  public class CodeSwapExpression : SwapExpression<Expression> {
+    public CodeSwapExpression() : base("CODE.SWAP") {
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.CodeStack);
+    public override void Eval(IPushGpInterpreter interpreter) {
+      Eval(interpreter.CodeStack);
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/WrapperExpression.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/WrapperExpression.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/WrapperExpression.cs	(revision 14602)
@@ -0,0 +1,14 @@
+﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
+{
+    public abstract class WrapperExpression<T> : StatefullExpression<T>
+    {
+        protected WrapperExpression(T state) : base(state, null)
+        {
+        }
+
+        public override string ToString()
+        {
+            return State.ToString();
+        }
+    }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/YankDuplicateExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/YankDuplicateExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/YankDuplicateExpressions.cs	(revision 14602)
@@ -1,127 +1,127 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using HeuristicLab.Algorithms.PushGP.Interpreter;
+    using HeuristicLab.Algorithms.PushGP.Stack;
 
-  /// <summary>
-  ///     Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item.
-  ///     The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
-  /// </summary>
-  /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class YankDuplicateExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack, IStack<long> integerStack)
+    /// <summary>
+    ///     Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item.
+    ///     The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
+    /// </summary>
+    /// <typeparam name="T">Stacktype</typeparam>
+    public abstract class YankDuplicateExpression<T> : StatelessExpression
     {
-      T item;
-      if (this.TryGetItem(stack, integerStack, out item)) stack.Push(item);
+        protected YankDuplicateExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
+
+        public void Eval(IStack<T> stack, IStack<long> integerStack)
+        {
+            T item;
+            if (this.TryGetItem(stack, integerStack, out item)) stack.Push(item);
+        }
+
+        public void Eval(IStack<Expression> stack, IStack<long> integerStack)
+        {
+            Expression item;
+            if (this.TryGetItem(stack, integerStack, out item)) stack.Push(item);
+        }
+
+        public void Eval(IStack<long> integerStack)
+        {
+            if ((integerStack.Count < 2) || (integerStack.Top > integerStack.Count - 2) ||
+                (integerStack.Top < 0)) return;
+
+            var index = (int) integerStack.Pop();
+            var item = integerStack.ReverseElementAt(index);
+
+            integerStack.Push(item);
+        }
+
+        private bool TryGetItem<E>(IStack<E> stack, IStack<long> integerStack, out E item)
+        {
+            if ((integerStack.Count == 0) || (integerStack.Top >= stack.Count) || (integerStack.Top < 0) ||
+                (stack.Count < 2))
+            {
+                item = default(E);
+                return false;
+            }
+
+            var index = (int) integerStack.Pop();
+            item = stack.ReverseElementAt(index);
+
+            return true;
+        }
     }
 
-    public void Eval(IStack<Expression> stack, IStack<long> integerStack)
+    public class IntegerYankDuplicateExpression : YankDuplicateExpression<long>
     {
-      Expression item;
-      if (this.TryGetItem(stack, integerStack, out item)) stack.Push(item);
+        public IntegerYankDuplicateExpression() : base("INTEGER.YANKDUP")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack);
+        }
     }
 
-    public void Eval(IStack<long> integerStack)
+    public class FloatYankDuplicateExpression : YankDuplicateExpression<double>
     {
-      if ((integerStack.Count < 2) || (integerStack.Top > integerStack.Count - 2) || (integerStack.Top < 0)) return;
+        public FloatYankDuplicateExpression() : base("FLOAT.YANKDUP")
+        {
+        }
 
-      var index = (int)integerStack.Pop();
-      var item = integerStack.ReverseElementAt(index);
-
-      integerStack.Push(item);
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, interpreter.IntegerStack);
+        }
     }
 
-    private bool TryGetItem<E>(IStack<E> stack, IStack<long> integerStack, out E item)
+    public class BooleanYankDuplicateExpression : YankDuplicateExpression<bool>
     {
-      if ((integerStack.Count == 0) || (integerStack.Top >= stack.Count) || (integerStack.Top < 0) || (stack.Count < 2))
-      {
-        item = default(E);
-        return false;
-      }
+        public BooleanYankDuplicateExpression() : base("BOOLEAN.YANKDUP")
+        {
+        }
 
-      var index = (int)integerStack.Pop();
-      item = stack.ReverseElementAt(index);
-
-      return true;
-    }
-  }
-
-  public class IntegerYankDuplicateExpression : YankDuplicateExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.YANKDUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.BooleanStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NameYankDuplicateExpression : YankDuplicateExpression<string>
     {
-      this.Eval(interpreter.IntegerStack);
-    }
-  }
+        public NameYankDuplicateExpression() : base("NAME.YANKDUP")
+        {
+        }
 
-  public class FloatYankDuplicateExpression : YankDuplicateExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.YANKDUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.NameStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecYankDuplicateExpression : YankDuplicateExpression<Expression>
     {
-      this.Eval(interpreter.FloatStack, interpreter.IntegerStack);
-    }
-  }
+        public ExecYankDuplicateExpression() : base("EXEC.YANKDUP")
+        {
+        }
 
-  public class BooleanYankDuplicateExpression : YankDuplicateExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.YANKDUP";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.ExecStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodeYankDuplicateExpression : YankDuplicateExpression<Expression>
     {
-      this.Eval(interpreter.BooleanStack, interpreter.IntegerStack);
+        public CodeYankDuplicateExpression() : base("CODE.YANKDUP")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.CodeStack, interpreter.IntegerStack);
+        }
     }
-  }
-
-  public class NameYankDuplicateExpression : YankDuplicateExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.YANKDUP";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.NameStack, interpreter.IntegerStack);
-    }
-  }
-
-  public class ExecYankDuplicateExpression : YankDuplicateExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.YANKDUP";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.ExecStack, interpreter.IntegerStack);
-    }
-  }
-
-  public class CodeYankDuplicateExpression : YankDuplicateExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.YANKDUP";
-    }
-
-    public override void Eval(IPushGpInterpreter interpreter)
-    {
-      this.Eval(interpreter.CodeStack, interpreter.IntegerStack);
-    }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/YankExpressions.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/YankExpressions.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/YankExpressions.cs	(revision 14602)
@@ -1,103 +1,101 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Expressions
 {
-  using HeuristicLab.Algorithms.PushGP.Interpreter;
-  using HeuristicLab.Algorithms.PushGP.Stack;
+    using HeuristicLab.Algorithms.PushGP.Interpreter;
+    using HeuristicLab.Algorithms.PushGP.Stack;
 
-  /// <summary>
-  ///     Removes an indexed item from "deep" in the stack and pushes it on top of the stack.
-  ///     The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
-  /// </summary>
-  /// <typeparam name="T">Stacktype</typeparam>
-  public abstract class YankExpression<T> : StatelessExpression
-  {
-    public void Eval(IStack<T> stack, IStack<long> integerStack, int count = 1)
+    /// <summary>
+    ///     Removes an indexed item from "deep" in the stack and pushes it on top of the stack.
+    ///     The index is taken from the INTEGER stack, and the indexing is done after the index is removed.
+    /// </summary>
+    /// <typeparam name="T">Stacktype</typeparam>
+    public abstract class YankExpression<T> : StatelessExpression
     {
-      if (integerStack.Count == 0) return;
+        protected YankExpression(string stringRepresentation) : base(stringRepresentation)
+        {
+        }
 
-      var index = integerStack.Top;
+        public void Eval(IStack<T> stack, IStack<long> integerStack, int count = 1)
+        {
+            if (integerStack.Count == 0) return;
 
-      if ((index > stack.Count - count) || (index < 0) || (stack.Count < 2)) return;
+            var index = integerStack.Top;
 
-      integerStack.Pop();
-      stack.Yank((int)index);
-    }
-  }
+            if ((index > stack.Count - count) || (index < 0) || (stack.Count < 2)) return;
 
-  public class IntegerYankExpression : YankExpression<long>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "INTEGER.YANK";
+            integerStack.Pop();
+            stack.Yank((int) index);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class IntegerYankExpression : YankExpression<long>
     {
-      this.Eval(interpreter.IntegerStack, interpreter.IntegerStack, 2);
-    }
-  }
+        public IntegerYankExpression() : base("INTEGER.YANK")
+        {
+        }
 
-  public class FloatYankExpression : YankExpression<double>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "FLOAT.YANK";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.IntegerStack, interpreter.IntegerStack, 2);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class FloatYankExpression : YankExpression<double>
     {
-      this.Eval(interpreter.FloatStack, interpreter.IntegerStack);
-    }
-  }
+        public FloatYankExpression() : base("FLOAT.YANK")
+        {
+        }
 
-  public class BooleanYankExpression : YankExpression<bool>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "BOOLEAN.YANK";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.FloatStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class BooleanYankExpression : YankExpression<bool>
     {
-      this.Eval(interpreter.BooleanStack, interpreter.IntegerStack);
-    }
-  }
+        public BooleanYankExpression() : base("BOOLEAN.YANK")
+        {
+        }
 
-  public class NameYankExpression : YankExpression<string>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "NAME.YANK";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.BooleanStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class NameYankExpression : YankExpression<string>
     {
-      this.Eval(interpreter.NameStack, interpreter.IntegerStack);
-    }
-  }
+        public NameYankExpression() : base("NAME.YANK")
+        {
+        }
 
-  public class ExecYankExpression : YankExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "EXEC.YANK";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.NameStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class ExecYankExpression : YankExpression<Expression>
     {
-      this.Eval(interpreter.ExecStack, interpreter.IntegerStack);
-    }
-  }
+        public ExecYankExpression() : base("EXEC.YANK")
+        {
+        }
 
-  public class CodeYankExpression : YankExpression<Expression>
-  {
-    protected override string InitStringRepresentation()
-    {
-      return "CODE.YANK";
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.ExecStack, interpreter.IntegerStack);
+        }
     }
 
-    public override void Eval(IPushGpInterpreter interpreter)
+    public class CodeYankExpression : YankExpression<Expression>
     {
-      this.Eval(interpreter.CodeStack, interpreter.IntegerStack);
+        public CodeYankExpression() : base("CODE.YANK")
+        {
+        }
+
+        public override void Eval(IPushGpInterpreter interpreter)
+        {
+            this.Eval(interpreter.CodeStack, interpreter.IntegerStack);
+        }
     }
-  }
 }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Generators/CodeGenerator.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Generators/CodeGenerator.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Generators/CodeGenerator.cs	(revision 14602)
@@ -27,5 +27,5 @@
     /// <returns>Returns an ExpandExpression if maxPoints smaller or equal to Configuration.MaxProgramPoints and Noop otherwise</returns>
     public static ExecExpandExpression RandomProgram(int maxPoints, IDictionary<string, Expression> customExpressions = null) {
-      var code = RandomCode(maxPoints, customExpressions).ToArray();
+      var code = RandomCode(maxPoints, customExpressions);
 
       return new ExecExpandExpression(code);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.csproj
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.csproj	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.csproj	(revision 14602)
@@ -53,5 +53,5 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Data\Pool\IRecyclable.cs" />
+    <Compile Include="Attributes\PushExpressionAttriubte.cs" />
     <Compile Include="Data\Pool\ObjectPool.cs" />
     <Compile Include="Data\Random\RandomFactory.cs" />
@@ -71,4 +71,5 @@
     <Compile Include="Expressions\StatefullExpression.cs" />
     <Compile Include="Expressions\StatelessExpression.cs" />
+    <Compile Include="Expressions\WrapperExpression.cs" />
     <Compile Include="Expressions\YankDuplicateExpressions.cs" />
     <Compile Include="Expressions\YankExpressions.cs" />
Index: anches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.csproj.user
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP.csproj.user	(revision 14601)
+++ 	(revision )
@@ -1,6 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectView>ShowAllFiles</ProjectView>
-  </PropertyGroup>
-</Project>
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/IPushGpInterpreter.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/IPushGpInterpreter.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/IPushGpInterpreter.cs	(revision 14602)
@@ -1,4 +1,3 @@
 ﻿namespace HeuristicLab.Algorithms.PushGP.Interpreter {
-  using System;
   using System.Collections.Generic;
   using System.Threading;
@@ -26,11 +25,11 @@
     bool IsNameQuoteFlagSet { get; set; }
 
-    void Interpret(string code);
+    void Run(string code);
 
-    Task InterpretAsync(string code, bool paused = false, CancellationToken token = default(CancellationToken));
+    Task RunAsync(string code, bool paused = false, CancellationToken token = default(CancellationToken));
 
-    void Interpret(Expression program);
+    void Run(Expression program);
 
-    Task InterpretAsync(Expression program, bool paused = false, CancellationToken token = default(CancellationToken));
+    Task RunAsync(Expression program, bool paused = false, CancellationToken token = default(CancellationToken));
 
     Task AbortAndResetAsync();
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/PooledPushGpInterpreter.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/PooledPushGpInterpreter.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/PooledPushGpInterpreter.cs	(revision 14602)
@@ -2,7 +2,5 @@
   using System;
 
-  using HeuristicLab.Algorithms.PushGP.Data.Pool;
-
-  public class PooledPushGpInterpreter : PushGpInterpreter, IRecyclable, IDisposable {
+  public class PooledPushGpInterpreter : PushGpInterpreter, IDisposable {
 
     private readonly PushGpInterpreterPool container;
@@ -13,10 +11,7 @@
     }
 
-    void IRecyclable.Recycle() {
+    public void Dispose() {
       this.Reset();
-      this.Configuration = this.container.Configuration;
-    }
-
-    public void Dispose() {
+      this.Configuration = this.Configuration;
       this.container.Free(this);
     }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/PushGPInterpreter.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/PushGPInterpreter.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Interpreter/PushGPInterpreter.cs	(revision 14602)
@@ -76,28 +76,28 @@
     public bool IsNameQuoteFlagSet { get; set; }
 
-    public void Interpret(string code) {
+    public void Run(string code) {
       var program = PushGPParser.Parse(code);
-      this.Interpret(program);
-    }
-
-    public Task InterpretAsync(string code, bool paused = false, CancellationToken token = default(CancellationToken)) {
+      this.Run(program);
+    }
+
+    public Task RunAsync(string code, bool paused = false, CancellationToken token = default(CancellationToken)) {
       var program = PushGPParser.Parse(code);
 
-      this.currentTask = this.InterpretAsync(program, paused, token);
-
-      return this.currentTask;
-    }
-
-    public Task InterpretAsync(
+      this.currentTask = this.RunAsync(program, paused, token);
+
+      return this.currentTask;
+    }
+
+    public Task RunAsync(
       Expression program,
       bool paused = false,
       CancellationToken token = default(CancellationToken)) {
       this.IsPaused = paused;
-      this.currentTask = Task.Run(() => this.Interpret(program), token);
-
-      return this.currentTask;
-    }
-
-    public void Interpret(Expression program) {
+      this.currentTask = Task.Run(() => this.Run(program), token);
+
+      return this.currentTask;
+    }
+
+    public void Run(Expression program) {
       /* Push top expression so the loop is able to enter
        * If the top expression is a single statement then the loop has nothing to do
@@ -160,4 +160,10 @@
       this.PrintStack("FLOAT", this.FloatStack);
       this.PrintStack("INTEGER", this.IntegerStack);
+
+      if (this.CustomExpressions.Count == 0) return;
+      Console.WriteLine("--------- Custom Expressions ---------");
+      foreach (var ce in this.CustomExpressions) {
+        Console.WriteLine("{0}: {1}", ce.Key, ce.Value);
+      }
     }
 
@@ -208,5 +214,7 @@
 
     private void DoStep() {
-      this.ExecStack.Pop().Eval(this);
+      var e = this.ExecStack.Pop();
+
+      e.Eval(this);
     }
 
@@ -218,5 +226,6 @@
 
     private void PrintStack<T>(string name, IStack<T> stack) {
-      Console.WriteLine("--- {0} ---\n{1}\n---------------------------------------------------", name, stack);
+      if (stack.IsEmpty) return;
+      Console.WriteLine("--------- {0} ---------\n{1}\n", name, stack);
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Stack/PushGPStack.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Stack/PushGPStack.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Stack/PushGPStack.cs	(revision 14602)
@@ -3,4 +3,5 @@
   using System.Collections;
   using System.Collections.Generic;
+  using System.Linq;
 
   /// <summary>
@@ -240,5 +241,6 @@
 
     public override string ToString() {
-      return string.Join(Delimiter, this.data);
+      var data = this.data as IEnumerable<T>;
+      return string.Join(Delimiter, data.Reverse());
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuiteDataDescriptor.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuiteDataDescriptor.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuiteDataDescriptor.cs	(revision 14602)
@@ -1,32 +1,134 @@
-﻿namespace HeuristicLab.BenchmarkSuite
-{
+﻿namespace HeuristicLab.BenchmarkSuite {
+  using System;
   using System.Collections.Generic;
+  using System.IO;
+  using System.IO.Compression;
+  using System.Linq;
+  using System.Reflection;
+  using System.Text.RegularExpressions;
 
-  using HeuristicLab.Core;
-  using HeuristicLab.Random;
+  using HeuristicLab.BenchmarkSuite.ProblemData;
 
-  public abstract class BenchmarkSuiteDataDescritpor<T> : ArtificialDataDescriptor
-  {
-    protected static IRandom rand = new FastRandom();
+  using Microsoft.VisualBasic.FileIO;
 
-    protected abstract IEnumerable<T> GenerateTraining();
+  public abstract class BenchmarkSuiteDataDescriptor<TIn, TOut> : IBenchmarkSuiteDataDescriptor {
+    //protected static IRandom rand = new FastRandom();
 
-    protected abstract IEnumerable<T> GenerateTest();
+    private const string InstanceArchiveName = "HeuristicLab.BenchmarkSuite.Data.BenchmarkExamples.zip";
+    private const string TestProblemPostfix = "Test.csv";
+    private const string TrainingProblemPostfix = "Training.csv";
+    private const string ResourcePath = @".*\.Data\.";
+    private const string ExampleSeparator = ",";
 
-    protected abstract IEnumerable<Example> GenerateExamples(IEnumerable<T> trainingAndTest);
+    protected const char ArrayValueSeparator = ' ';
+    protected static readonly char[] ArraySymbolTrim = { '[', ']' };
 
-    protected override IEnumerable<Example> GenerateExamples()
-    {
-      var training = this.GenerateTraining();
+    public abstract string Name { get; }
+    public abstract string Description { get; }
 
-      training = training.Shuffle(rand);
+    protected abstract int InputCount { get; }
+    protected abstract int OutputCount { get; }
 
-      var test = this.GenerateTest();
+    public abstract TIn ConvertInput(string[] input);
+    public abstract TOut ConvertOutput(string[] input);
 
-      var all = new List<T>();
-      all.AddRange(training);
-      all.AddRange(test);
+    public IData CreateData() {
+      var training = this.GetTraining();
+      var test = this.GetTest();
 
-      return this.GenerateExamples(all);
+      return new Data<TIn, TOut>(training, test, 0, double.MaxValue);
+    }
+
+    public IPushData CreatePushData() {
+      var training = this.GetTraining();
+      var test = this.GetTest();
+
+      return this.CreatePushData(training, test);
+    }
+
+    private Example<TIn, TOut>[] GetTest() {
+      return this.ParseData(TestProblemPostfix).ToArray();
+    }
+
+    private Example<TIn, TOut>[] GetTraining() {
+      return this.ParseData(TrainingProblemPostfix)/*.Shuffle(rand)*/.ToArray(); ;
+    }
+
+    public abstract IPushData CreatePushData(Example<TIn, TOut>[] training, Example<TIn, TOut>[] test);
+
+    protected IEnumerable<Example<TIn, TOut>> ParseData(string postfix) {
+      var type = this.GetType();
+      var problemInstanceName = type.Name + postfix;
+
+      using (var file = this.GetType().Assembly.GetManifestResourceStream(InstanceArchiveName))
+      using (var archive = new ZipArchive(file, ZipArchiveMode.Read)) {
+        var entry = archive.Entries.SingleOrDefault(x => x.Name == problemInstanceName);
+
+        using (var parser = new TextFieldParser(entry.Open())) {
+          parser.TextFieldType = FieldType.Delimited;
+          parser.SetDelimiters(ExampleSeparator);
+
+          while (!parser.EndOfData) {
+            //Processing row
+            var fields = parser.ReadFields();
+
+            if (fields.Length != InputCount + OutputCount)
+              throw new InvalidDataException("Number of values do not fit");
+
+            yield return new Example<TIn, TOut> {
+              Input = ConvertInput(fields.Take(this.InputCount).ToArray()),
+              Output = ConvertOutput(fields.Skip(this.InputCount).ToArray())
+            };
+          }
+        }
+      }
+    }
+
+    protected static string GetResourceName(string fileName) {
+      return Assembly
+          .GetExecutingAssembly()
+          .GetManifestResourceNames()
+          .SingleOrDefault(x => Regex.Match(x, ResourcePath + fileName).Success);
+    }
+
+    protected static double[] ConvertDoubles(string input) {
+      return ConvertMultiple(input, double.Parse);
+    }
+
+    protected static double ConvertDouble(string input) {
+      return double.Parse(input);
+    }
+
+    protected static long[] ConvertIntegers(string input) {
+      return ConvertMultiple(input, long.Parse);
+    }
+
+    protected static long ConvertInteger(string input) {
+
+      return string.IsNullOrEmpty(input) ? default(long) : long.Parse(input);
+    }
+
+    protected static T[] ConvertMultiple<T>(string input, Func<string, T> converter) {
+      return input
+       .Trim(ArraySymbolTrim)
+       .Split(ArrayValueSeparator)
+       .Where(s => !string.IsNullOrWhiteSpace(s))
+       .Select(converter)
+       .ToArray();
+    }
+
+    protected static IEnumerable<string> SplitByNewLine(string input) {
+      return input.Split(new[] { Environment.NewLine, "\n", "\r\n" }, StringSplitOptions.None);
+    }
+
+    private static string[] trueFormats = new[] { "true", "t", "1" };
+    private static string[] falseFormats = new[] { "false", "f", "0" };
+
+    protected static bool ConvertBool(string input) {
+      var str = input.ToLower();
+
+      if (trueFormats.Contains(str)) return true;
+      if (falseFormats.Contains(str)) return false;
+      throw new InvalidDataException(string.Format("Unable to parse {0} as boolean", str));
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuiteInstanceProvider.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuiteInstanceProvider.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuiteInstanceProvider.cs	(revision 14602)
@@ -0,0 +1,58 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.BenchmarkSuite {
+
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+  using HeuristicLab.BenchmarkSuite.Problems;
+  using HeuristicLab.Problems.Instances;
+
+  public abstract class BenchmarkSuiteInstanceProvider<TData> : ProblemInstanceProvider<TData>
+    where TData : IData {
+    private const string name = "General Program Synthesis Benchmark Suite";
+    private const string referencePublication =
+      "T. Helmuth and L. Spector, \"Detailed Problem Descriptions for General Program Synthesis Benchmark Suite\", Technical Report UM-CS-2015-006, School of Computer Science, University of Massachusetts Amherst, 2015.";
+    private static readonly Uri webLink = new Uri("https://web.cs.umass.edu/publication/docs/2015/UM-CS-2015-006.pdf");
+
+    public override string Name
+    {
+      get { return name; }
+    }
+
+    public override string Description
+    {
+      get { return ""; }
+    }
+
+    public override Uri WebLink
+    {
+      get { return webLink; }
+    }
+
+    public override string ReferencePublication
+    {
+      get { return referencePublication; }
+    }
+
+    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
+      yield return new CountOdds();
+      yield return new CollatzNumbers();
+      yield return new CompareStringLengths();
+      yield return new Checksum();
+      yield return new Digits();
+      yield return new DoubleLetters();
+      yield return new EvenSquares();
+      yield return new ForLoopIndex();
+      yield return new Grades();
+      yield return new LastIndexOfZero();
+      yield return new Median();
+      yield return new MirrorImage();
+      yield return new NegativeToZero();
+      yield return new NumberIo();
+      yield return new PigLatin();
+      yield return new ReplaceSpaceWithNewline();
+    }
+
+    public abstract override TData LoadData(IDataDescriptor descriptor);
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuitePushInstanceProvider.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuitePushInstanceProvider.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/BenchmarkSuitePushInstanceProvider.cs	(revision 14602)
@@ -0,0 +1,12 @@
+﻿namespace HeuristicLab.BenchmarkSuite {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+  using HeuristicLab.Problems.Instances;
+
+  public class BenchmarkSuitePushInstanceProvider : BenchmarkSuiteInstanceProvider<IPushData> {
+    public override IPushData LoadData(IDataDescriptor descriptor) {
+      var benchmarkSuiteDataDescriptor = descriptor as IBenchmarkSuiteDataDescriptor;
+
+      return benchmarkSuiteDataDescriptor.CreatePushData();
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/HeuristicLab.BenchmarkSuite.csproj
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/HeuristicLab.BenchmarkSuite.csproj	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/HeuristicLab.BenchmarkSuite.csproj	(revision 14602)
@@ -8,6 +8,6 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>HeuristicLab.BenchmarkSuite</RootNamespace>
-    <AssemblyName>HeuristicLab.BenchmarkSuite</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <AssemblyName>HeuristicLab.Problems.ProgramSynthesis.BenchmarkSuite</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@@ -17,4 +17,5 @@
     <IsCodedUITest>False</IsCodedUITest>
     <TestProjectType>UnitTest</TestProjectType>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -22,13 +23,14 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <LangVersion>5</LangVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
@@ -42,4 +44,8 @@
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
     <Reference Include="HeuristicLab.Problems.Instances-3.3">
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
@@ -48,5 +54,7 @@
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
     </Reference>
+    <Reference Include="Microsoft.VisualBasic" />
     <Reference Include="System" />
+    <Reference Include="System.IO.Compression" />
   </ItemGroup>
   <Choose>
@@ -63,12 +71,55 @@
   </Choose>
   <ItemGroup>
-    <Compile Include="ArtificialDataDescriptor.cs" />
     <Compile Include="BenchmarkSuiteDataDescriptor.cs" />
-    <Compile Include="Example.cs" />
+    <Compile Include="BenchmarkSuiteInstanceProvider.cs" />
+    <Compile Include="BenchmarkSuitePushInstanceProvider.cs" />
+    <Compile Include="IBenchmarkSuiteDataDescriptor.cs" />
+    <Compile Include="ProblemData\ReplaceSpaceWithNewlinePushData.cs" />
+    <Compile Include="ProblemData\PigLatinPushData.cs" />
+    <Compile Include="ProblemData\NumberIoPushData.cs" />
+    <Compile Include="ProblemData\NegativeToZeroPushData.cs" />
+    <Compile Include="ProblemData\MirrorImagePushData.cs" />
+    <Compile Include="ProblemData\MedianPushData.cs" />
+    <Compile Include="ProblemData\LastIndexOfZeroPushData.cs" />
+    <Compile Include="ProblemData\GradePushData.cs" />
+    <Compile Include="ProblemData\ChecksumPushData.cs" />
+    <Compile Include="ProblemData\CollatzNumbersPushData.cs" />
+    <Compile Include="ProblemData\CompareStringLengthsPushData.cs" />
+    <Compile Include="ProblemData\ForLoopIndexPushData.cs" />
+    <Compile Include="ProblemData\EvenSquaresPushData.cs" />
+    <Compile Include="ProblemData\DoubleLettersPushData.cs" />
+    <Compile Include="ProblemData\DigitsPushData.cs" />
+    <Compile Include="ProblemData\Data.cs" />
+    <Compile Include="ProblemData\Example.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="ProblemData\IData.cs" />
+    <Compile Include="ProblemData\IPushData.cs" />
+    <Compile Include="ProblemData\CountOddsPushData.cs" />
+    <Compile Include="Problems\ReplaceSpaceWithNewline.cs" />
+    <Compile Include="Problems\PigLatin.cs" />
+    <Compile Include="Problems\NumberIo.cs" />
+    <Compile Include="Problems\NegativeToZero.cs" />
+    <Compile Include="Problems\MirrorImage.cs" />
+    <Compile Include="Problems\Median.cs" />
+    <Compile Include="Problems\LastIndexOfZero.cs" />
+    <Compile Include="Problems\Grades.cs" />
+    <Compile Include="Problems\ForLoopIndex.cs" />
+    <Compile Include="Problems\EvenSquares.cs" />
+    <Compile Include="Problems\DoubleLetters.cs" />
+    <Compile Include="Problems\Checksum.cs" />
+    <Compile Include="Problems\CollatzNumbers.cs" />
+    <Compile Include="Problems\CompareStringLengths.cs" />
+    <Compile Include="Problems\Digits.cs" />
     <Compile Include="Problems\CountOdds.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
-    <Folder Include="Data\" />
+    <ProjectReference Include="..\HeuristicLab.Algorithms.PushGP\HeuristicLab.Algorithms.PushGP.csproj">
+      <Project>{368D1303-470C-4F31-91F2-0FAD379DAA45}</Project>
+      <Name>HeuristicLab.Algorithms.PushGP</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Data\BenchmarkExamples.zip" />
   </ItemGroup>
   <Choose>
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/HeuristicLab.BenchmarkSuite.csproj.user
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/HeuristicLab.BenchmarkSuite.csproj.user	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/HeuristicLab.BenchmarkSuite.csproj.user	(revision 14602)
@@ -2,5 +2,5 @@
 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectView>ShowAllFiles</ProjectView>
+    <ProjectView>ProjectFiles</ProjectView>
   </PropertyGroup>
 </Project>
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/IBenchmarkSuiteDataDescriptor.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/IBenchmarkSuiteDataDescriptor.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/IBenchmarkSuiteDataDescriptor.cs	(revision 14602)
@@ -0,0 +1,10 @@
+﻿namespace HeuristicLab.BenchmarkSuite {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+  using HeuristicLab.Problems.Instances;
+
+  public interface IBenchmarkSuiteDataDescriptor : IDataDescriptor {
+    IData CreateData();
+
+    IPushData CreatePushData();
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Plugin.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Plugin.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Plugin.cs	(revision 14602)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Patrik Kimmeswegner
+ */
+
+#endregion
+
+namespace HeuristicLab.BenchmarkSuite {
+  using HeuristicLab.PluginInfrastructure;
+
+  [Plugin("HeuristicLab.Problems.ProgramSynthesis.BenchmarkSuite", "1.0")]
+  [PluginFile("HeuristicLab.Problems.ProgramSynthesis.BenchmarkSuite.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  public class PushGpPlugin : PluginBase {
+
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ChecksumPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ChecksumPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ChecksumPushData.cs	(revision 14602)
@@ -0,0 +1,35 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class ChecksumPushData : Data<string, string>, IPushData {
+    public ChecksumPushData(Example<string, string>[] training, Example<string, string>[] test)
+      : base(training, test, 0, 256 * 10) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Training[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Test[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CollatzNumbersPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CollatzNumbersPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CollatzNumbersPushData.cs	(revision 14602)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class CollatzNumbersPushData : Data<long, long>, IPushData {
+    public CollatzNumbersPushData(Example<long, long>[] training, Example<long, long>[] test)
+      : base(training, test, 0, 260) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => data - interpreter.IntegerStack.Top);
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => data - interpreter.IntegerStack.Top);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CompareStringLengthsPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CompareStringLengthsPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CompareStringLengthsPushData.cs	(revision 14602)
@@ -0,0 +1,32 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class CompareStringLengthsPushData : Data<string[], bool>, IPushData {
+    public CompareStringLengthsPushData(Example<string[], bool>[] training, Example<string[], bool>[] test)
+      : base(training, test, 0, test.Length) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.NameStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.NameStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.BooleanStack,
+        index,
+        this.Training,
+        data => data == interpreter.BooleanStack.Top ? 1 : 0);
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.BooleanStack,
+        index, this.Test,
+        data => data == interpreter.BooleanStack.Top ? 1 : 0);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CountOddsPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CountOddsPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/CountOddsPushData.cs	(revision 14602)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class CountOddsPushData : Data<long[], long>, IPushData {
+    public CountOddsPushData(Example<long[], long>[] training, Example<long[], long>[] test)
+      : base(training, test, 0, 50) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => data - interpreter.IntegerStack.Top);
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => data - interpreter.IntegerStack.Top);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/Data.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/Data.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/Data.cs	(revision 14602)
@@ -0,0 +1,58 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using System;
+  using System.Linq;
+
+  using HeuristicLab.Algorithms.PushGP.Stack;
+
+  public class Data<TIn, TOut> : IData {
+    public readonly Example<TIn, TOut>[] Training;
+    public readonly Example<TIn, TOut>[] Test;
+
+    public Data(Example<TIn, TOut>[] training, Example<TIn, TOut>[] test, double bestResult, double worstResult) {
+      this.Training = training;
+      this.Test = test;
+      this.WorstResult = worstResult;
+      this.BestResult = bestResult;
+    }
+
+    public int TrainingCount { get { return Training.Length; } }
+    public int TestCount { get { return Test.Length; } }
+
+    public double WorstResult { get; private set; }
+    public double BestResult { get; private set; }
+
+    protected double CompareOutput<TStack>(IStack<TStack> stack, int index, Example<TIn, TOut>[] data, Func<TOut, double> differ) {
+      if (stack.IsEmpty)
+        return this.WorstResult;
+
+      var diff = differ(data[index].Output);
+      return diff == long.MinValue ? this.WorstResult : Math.Min(Math.Abs(diff), this.WorstResult);
+    }
+
+    protected static long[] GetAsciiValues(string str) {
+      return str.Select(c => (long)c).ToArray();
+    }
+
+    protected static double GetAsciiResultDifference(string data, IStack<long> stack) {
+      var resultCount = Math.Min(data.Length, stack.Count);
+      var resultValues = stack.Pop(resultCount);
+
+      return Math.Abs(GetAsciiValues(data).Sum() - resultValues.Sum());
+    }
+
+    protected static double GetFloatResultDifference(double data, IStack<double> stack) {
+      return Math.Abs(data - stack.Pop());
+    }
+
+    protected static double GetIntResultDifference(long data, IStack<long> stack) {
+      return Math.Abs(data - stack.Pop());
+    }
+
+    protected static double GetIntResultDifference(long[] data, IStack<long> stack) {
+      var resultCount = Math.Min(data.Length, stack.Count);
+      var resultValues = stack.Pop(resultCount);
+
+      return Math.Abs(data.Sum() - resultValues.Sum());
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/DigitsPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/DigitsPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/DigitsPushData.cs	(revision 14602)
@@ -0,0 +1,34 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class DigitsPushData : Data<long, long[]>, IPushData {
+    public DigitsPushData(Example<long, long[]>[] training, Example<long, long[]>[] test)
+      : base(training, test, 0, 19 * 15) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/DoubleLettersPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/DoubleLettersPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/DoubleLettersPushData.cs	(revision 14602)
@@ -0,0 +1,35 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class DoubleLettersPushData : Data<string, string>, IPushData {
+    public DoubleLettersPushData(Example<string, string>[] training, Example<string, string>[] test)
+      : base(training, test, 0, 128 * 70) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Training[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Training[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/EvenSquaresPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/EvenSquaresPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/EvenSquaresPushData.cs	(revision 14602)
@@ -0,0 +1,34 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class EvenSquaresPushData : Data<long, long[]>, IPushData {
+    public EvenSquaresPushData(Example<long, long[]>[] training, Example<long, long[]>[] test)
+      : base(training, test, 0, 100000) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/Example.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/Example.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/Example.cs	(revision 14602)
@@ -0,0 +1,6 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  public class Example<TIn, TOut> {
+    public TIn Input { get; set; }
+    public TOut Output { get; set; }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ForLoopIndexPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ForLoopIndexPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ForLoopIndexPushData.cs	(revision 14602)
@@ -0,0 +1,34 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class ForLoopIndexPushData : Data<long[], long[]>, IPushData {
+    public ForLoopIndexPushData(Example<long[], long[]>[] training, Example<long[], long[]>[] test)
+      : base(training, test, 0, 50 * 15) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/GradePushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/GradePushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/GradePushData.cs	(revision 14602)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class GradePushData : Data<long[], string>, IPushData {
+    public GradePushData(Example<long[], string>[] training, Example<long[], string>[] test)
+      : base(training, test, 0, 5) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(this.Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(this.Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/IData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/IData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/IData.cs	(revision 14602)
@@ -0,0 +1,9 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  public interface IData {
+    int TrainingCount { get; }
+    int TestCount { get; }
+
+    double WorstResult { get; }
+    double BestResult { get; }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/IPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/IPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/IPushData.cs	(revision 14602)
@@ -0,0 +1,11 @@
+﻿using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+namespace HeuristicLab.BenchmarkSuite.ProblemData {
+
+  public interface IPushData : IData {
+    void ApplyTrainingInput(IPushGpInterpreter interpreter, int index);
+    void ApplyTestInput(IPushGpInterpreter interpreter, int index);
+    double CompareTrainingOutput(IPushGpInterpreter interpreter, int index);
+    double CompareTestOutput(IPushGpInterpreter interpreter, int index);
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/LastIndexOfZeroPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/LastIndexOfZeroPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/LastIndexOfZeroPushData.cs	(revision 14602)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class LastIndexOfZeroPushData : Data<long[], long>, IPushData {
+    public LastIndexOfZeroPushData(Example<long[], long>[] training, Example<long[], long>[] test)
+      : base(training, test, 0, 50) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => data - interpreter.IntegerStack.Top);
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => data - interpreter.IntegerStack.Top);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/MedianPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/MedianPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/MedianPushData.cs	(revision 14602)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class MedianPushData : Data<long[], long>, IPushData {
+    public MedianPushData(Example<long[], long>[] training, Example<long[], long>[] test)
+      : base(training, test, 0, 100) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/MirrorImagePushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/MirrorImagePushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/MirrorImagePushData.cs	(revision 14602)
@@ -0,0 +1,35 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class MirrorImagePushData : Data<long[][], bool>, IPushData {
+    public MirrorImagePushData(Example<long[][], bool>[] training, Example<long[][], bool>[] test)
+      : base(training, test, 0, 50) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input[0]);
+      interpreter.IntegerStack.Push(Training[index].Input[1]);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input[0]);
+      interpreter.IntegerStack.Push(Test[index].Input[1]);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.BooleanStack,
+        index,
+        this.Training,
+        data => data == interpreter.BooleanStack.Top ? 1 : 0);
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.BooleanStack,
+        index,
+        this.Test,
+        data => data == interpreter.BooleanStack.Top ? 1 : 0);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/NegativeToZeroPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/NegativeToZeroPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/NegativeToZeroPushData.cs	(revision 14602)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class NegativeToZeroPushData : Data<long[], long[]>, IPushData {
+    public NegativeToZeroPushData(Example<long[], long[]>[] training, Example<long[], long[]>[] test)
+      : base(training, test, 0, 50) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Training[index].Input);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.IntegerStack.Push(Test[index].Input);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => GetIntResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/NumberIoPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/NumberIoPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/NumberIoPushData.cs	(revision 14602)
@@ -0,0 +1,36 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class NumberIoPushData : Data<double[], double>, IPushData {
+    public NumberIoPushData(Example<double[], double>[] training, Example<double[], double>[] test)
+      : base(training, test, 0, 200) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.FloatStack.Push(Training[index].Input[0]);
+      interpreter.IntegerStack.Push((long)Training[index].Input[1]);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      interpreter.FloatStack.Push(Test[index].Input[0]);
+      interpreter.IntegerStack.Push((long)Test[index].Input[1]);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.FloatStack,
+        index,
+        this.Training,
+        data => GetFloatResultDifference(data, interpreter.FloatStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.FloatStack,
+        index,
+        this.Test,
+        data => GetFloatResultDifference(data, interpreter.FloatStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/PigLatinPushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/PigLatinPushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/PigLatinPushData.cs	(revision 14602)
@@ -0,0 +1,35 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class PigLatinPushData : Data<string, string>, IPushData {
+    public PigLatinPushData(Example<string, string>[] training, Example<string, string>[] test)
+      : base(training, test, 0, 128 * 70) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Training[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Training[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data => GetAsciiResultDifference(data, interpreter.IntegerStack));
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ReplaceSpaceWithNewLinePushData.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ReplaceSpaceWithNewLinePushData.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/ProblemData/ReplaceSpaceWithNewLinePushData.cs	(revision 14602)
@@ -0,0 +1,41 @@
+﻿namespace HeuristicLab.BenchmarkSuite.ProblemData {
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+
+  public class ReplaceSpaceWithNewlinePushData : Data<string, string[]>, IPushData {
+    public ReplaceSpaceWithNewlinePushData(Example<string, string[]>[] training, Example<string, string[]>[] test)
+      : base(training, test, 0, 128 * 70) {
+    }
+
+    public void ApplyTrainingInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Training[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public void ApplyTestInput(IPushGpInterpreter interpreter, int index) {
+      var asciiValues = GetAsciiValues(this.Training[index].Input);
+      interpreter.IntegerStack.Push(asciiValues);
+    }
+
+    public double CompareTrainingOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Training,
+        data =>
+          GetIntResultDifference(int.Parse(data[1]), interpreter.IntegerStack) +
+          data[0].CompareTo(interpreter.NameStack.Top)
+        );
+    }
+
+    public double CompareTestOutput(IPushGpInterpreter interpreter, int index) {
+      return this.CompareOutput(
+        interpreter.IntegerStack,
+        index,
+        this.Test,
+        data =>
+          GetIntResultDifference(int.Parse(data[1]), interpreter.IntegerStack) +
+          data[0].CompareTo(interpreter.NameStack.Top)
+        );
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Checksum.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Checksum.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Checksum.cs	(revision 14602)
@@ -0,0 +1,25 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class Checksum : BenchmarkSuiteDataDescriptor<string, string> {
+    private const string displayMame = "Checksum";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override string ConvertInput(string[] input) {
+      return input[0];
+    }
+
+    public override string ConvertOutput(string[] output) {
+      return output[0];
+    }
+
+    public override IPushData CreatePushData(Example<string, string>[] training, Example<string, string>[] test) {
+      return new ChecksumPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CollatzNumbers.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CollatzNumbers.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CollatzNumbers.cs	(revision 14602)
@@ -0,0 +1,25 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class CollatzNumbers : BenchmarkSuiteDataDescriptor<long, long> {
+    private const string displayMame = "Collatz Numbers";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long ConvertInput(string[] input) {
+      return ConvertInteger(input[0]);
+    }
+
+    public override long ConvertOutput(string[] output) {
+      return ConvertInteger(output[0]);
+    }
+
+    public override IPushData CreatePushData(Example<long, long>[] training, Example<long, long>[] test) {
+      return new CollatzNumbersPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CompareStringLengths.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CompareStringLengths.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CompareStringLengths.cs	(revision 14602)
@@ -0,0 +1,25 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class CompareStringLengths : BenchmarkSuiteDataDescriptor<string[], bool> {
+    private const string displayMame = "Compare String Lengths";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+    protected override int InputCount { get { return 3; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override string[] ConvertInput(string[] input) {
+      return input;
+    }
+
+    public override bool ConvertOutput(string[] output) {
+      return ConvertBool(output[0]);
+    }
+
+    public override IPushData CreatePushData(Example<string[], bool>[] training, Example<string[], bool>[] test) {
+      return new CompareStringLengthsPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CountOdds.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CountOdds.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/CountOdds.cs	(revision 14602)
@@ -1,141 +1,25 @@
-﻿namespace HeuristicLab.BenchmarkSuite.Problems
-{
-  using System.Collections.Generic;
-  using System.Linq;
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
 
-  public class CountOdds : BenchmarkSuiteDataDescritpor<List<int>>
-  {
-    public const int MaxOdd = 999;
+  public class CountOdds : BenchmarkSuiteDataDescriptor<long[], long> {
+    private const string displayMame = "Count Odds";
+    private const string description = "";
 
-    public const int MaxEven = 1000;
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
 
-    public const int MaxRandom = 1000;
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
 
-    public const int MinRandom = 1000;
-
-    public const int MaxVectorLength = 50;
-
-    public override string Description
-    {
-      get
-      {
-        return string.Empty;
-      }
+    public override long[] ConvertInput(string[] input) {
+      return ConvertIntegers(input[0]);
     }
 
-    public override string Name
-    {
-      get
-      {
-        return "Count Odds";
-      }
+    public override long ConvertOutput(string[] output) {
+      return ConvertInteger(output[0]);
     }
 
-    protected override IEnumerable<Example> GenerateExamples(IEnumerable<List<int>> inputData)
-    {
-      foreach (var input in inputData)
-        yield return
-          new Example
-            {
-              Input = string.Format("[{0}]", string.Join(", ", input)),
-              Output = input.Count(x => x % 2 == 1).ToString()
-            };
-    }
-
-    protected override IEnumerable<List<int>> GenerateTest()
-    {
-      foreach (var list in this.GetHardcodedTrainingSamples()) yield return list;
-
-      foreach (var list in this.GetAllOdd(100)) yield return list;
-
-      foreach (var list in this.GetAllEven(100)) yield return list;
-
-      foreach (var list in this.GetRandom(1800)) yield return list;
-    }
-
-    protected override IEnumerable<List<int>> GenerateTraining()
-    {
-      foreach (var list in this.GetHardcodedTrainingSamples()) yield return list;
-
-      foreach (var list in this.GetAllOdd(9)) yield return list;
-
-      foreach (var list in this.GetAllEven(9)) yield return list;
-
-      foreach (var list in this.GetRandom(150)) yield return list;
-    }
-
-    private IEnumerable<List<int>> GetAllOdd(int n)
-    {
-      for (var i = 0; i < n; i++)
-      {
-        var length = rand.Next(0, MaxVectorLength);
-        var vector = new List<int>(length);
-
-        for (var j = 0; j < length; j++) vector.Add(rand.Next(0, MaxOdd) * 2 - MaxOdd);
-
-        yield return vector;
-      }
-    }
-
-    private IEnumerable<List<int>> GetAllEven(int n)
-    {
-      for (var i = 0; i < n; i++)
-      {
-        var length = rand.Next(0, MaxVectorLength);
-        var vector = new List<int>(length);
-
-        for (var j = 0; j < length; j++) vector.Add(rand.Next(0, MaxEven) * 2 - MaxEven);
-
-        yield return vector;
-      }
-    }
-
-    private IEnumerable<List<int>> GetRandom(int n)
-    {
-      for (var i = 0; i < n; i++)
-      {
-        var length = rand.Next(0, MaxVectorLength);
-        var vector = new List<int>(length);
-
-        for (var j = 0; j < length; j++) vector.Add(rand.Next(MinRandom, MaxRandom));
-
-        yield return vector;
-      }
-    }
-
-    private IEnumerable<List<int>> GetHardcodedTrainingSamples()
-    {
-      yield return new List<int>();
-      yield return new List<int> { -10 };
-      yield return new List<int> { -9 };
-      yield return new List<int> { -8 };
-      yield return new List<int> { -7 };
-      yield return new List<int> { -6 };
-      yield return new List<int> { -5 };
-      yield return new List<int> { -4 };
-      yield return new List<int> { -3 };
-      yield return new List<int> { -2 };
-      yield return new List<int> { -1 };
-      yield return new List<int> { -0 };
-      yield return new List<int> { 1 };
-      yield return new List<int> { 2 };
-      yield return new List<int> { 3 };
-      yield return new List<int> { 4 };
-      yield return new List<int> { 5 };
-      yield return new List<int> { 6 };
-      yield return new List<int> { 7 };
-      yield return new List<int> { 8 };
-      yield return new List<int> { 9 };
-      yield return new List<int> { 10 };
-      yield return new List<int> { -947 };
-      yield return new List<int> { -450 };
-      yield return new List<int> { 303 };
-      yield return new List<int> { 886 };
-      yield return new List<int> { 0, 0 };
-      yield return new List<int> { 0, 1 };
-      yield return new List<int> { 7, 1 };
-      yield return new List<int> { -9, -1 };
-      yield return new List<int> { -11, 40 };
-      yield return new List<int> { 944, 77 };
+    public override IPushData CreatePushData(Example<long[], long>[] training, Example<long[], long>[] test) {
+      return new CountOddsPushData(training, test);
     }
   }
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Digits.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Digits.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Digits.cs	(revision 14602)
@@ -0,0 +1,30 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using System.Linq;
+
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class Digits : BenchmarkSuiteDataDescriptor<long, long[]> {
+    private const string displayMame = "Digits";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long ConvertInput(string[] input) {
+      return ConvertInteger(input[0]);
+    }
+
+    public override long[] ConvertOutput(string[] output) {
+      return SplitByNewLine(output[0])
+        .Select(ConvertInteger)
+        .ToArray();
+    }
+
+    public override IPushData CreatePushData(Example<long, long[]>[] training, Example<long, long[]>[] test) {
+      return new DigitsPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/DoubleLetters.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/DoubleLetters.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/DoubleLetters.cs	(revision 14602)
@@ -0,0 +1,25 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class DoubleLetters : BenchmarkSuiteDataDescriptor<string, string> {
+    private const string displayMame = "Double Letters";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override string ConvertInput(string[] input) {
+      return input[0];
+    }
+
+    public override string ConvertOutput(string[] output) {
+      return output[0];
+    }
+
+    public override IPushData CreatePushData(Example<string, string>[] training, Example<string, string>[] test) {
+      return new DoubleLettersPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/EvenSquares.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/EvenSquares.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/EvenSquares.cs	(revision 14602)
@@ -0,0 +1,30 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using System.Linq;
+
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class EvenSquares : BenchmarkSuiteDataDescriptor<long, long[]> {
+    private const string displayMame = "Even Squares";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long ConvertInput(string[] input) {
+      return ConvertInteger(input[0]);
+    }
+
+    public override long[] ConvertOutput(string[] output) {
+      return SplitByNewLine(output[0])
+        .Select(ConvertInteger)
+        .ToArray();
+    }
+
+    public override IPushData CreatePushData(Example<long, long[]>[] training, Example<long, long[]>[] test) {
+      return new EvenSquaresPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/ForLoopIndex.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/ForLoopIndex.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/ForLoopIndex.cs	(revision 14602)
@@ -0,0 +1,30 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using System.Linq;
+
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class ForLoopIndex : BenchmarkSuiteDataDescriptor<long[], long[]> {
+    private const string displayMame = "For Loop Index";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 3; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long[] ConvertInput(string[] input) {
+      return input.Select(ConvertInteger).ToArray();
+    }
+
+    public override long[] ConvertOutput(string[] output) {
+      return SplitByNewLine(output[0])
+        .Select(ConvertInteger)
+        .ToArray();
+    }
+
+    public override IPushData CreatePushData(Example<long[], long[]>[] training, Example<long[], long[]>[] test) {
+      return new ForLoopIndexPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Grades.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Grades.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Grades.cs	(revision 14602)
@@ -0,0 +1,26 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using System.Linq;
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class Grades : BenchmarkSuiteDataDescriptor<long[], string> {
+    private const string displayMame = "Checksum";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+    protected override int InputCount { get { return 5; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long[] ConvertInput(string[] input) {
+      return input.Select(ConvertInteger).ToArray();
+    }
+
+    public override string ConvertOutput(string[] output) {
+      return output[0];
+    }
+
+    public override IPushData CreatePushData(Example<long[], string>[] training, Example<long[], string>[] test) {
+      return new GradePushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/LastIndexOfZero.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/LastIndexOfZero.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/LastIndexOfZero.cs	(revision 14602)
@@ -0,0 +1,26 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class LastIndexOfZero : BenchmarkSuiteDataDescriptor<long[], long> {
+    private const string displayMame = "Last Index of Zero";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long[] ConvertInput(string[] input) {
+      return ConvertIntegers(input[0]);
+    }
+
+    public override long ConvertOutput(string[] output) {
+      return ConvertInteger(output[0]);
+    }
+
+    public override IPushData CreatePushData(Example<long[], long>[] training, Example<long[], long>[] test) {
+      return new LastIndexOfZeroPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Median.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Median.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/Median.cs	(revision 14602)
@@ -0,0 +1,28 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using System.Linq;
+
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class Median : BenchmarkSuiteDataDescriptor<long[], long> {
+    private const string displayMame = "Median";
+    private const string description = "";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 3; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long[] ConvertInput(string[] input) {
+      return input.Select(ConvertInteger).ToArray();
+    }
+
+    public override long ConvertOutput(string[] output) {
+      return ConvertInteger(output[0]);
+    }
+
+    public override IPushData CreatePushData(Example<long[], long>[] training, Example<long[], long>[] test) {
+      return new MedianPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/MirrorImage.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/MirrorImage.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/MirrorImage.cs	(revision 14602)
@@ -0,0 +1,28 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using System.Linq;
+
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class MirrorImage : BenchmarkSuiteDataDescriptor<long[][], bool> {
+    private const string displayMame = "Mirror Image";
+    private const string description = "Given two vectors of integers, return true if one vector is the reverse of the other, and false otherwise";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 2; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long[][] ConvertInput(string[] input) {
+      return input.Select(ConvertIntegers).ToArray();
+    }
+
+    public override bool ConvertOutput(string[] output) {
+      return ConvertBool(output[0]);
+    }
+
+    public override IPushData CreatePushData(Example<long[][], bool>[] training, Example<long[][], bool>[] test) {
+      return new MirrorImagePushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/NegativeToZero.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/NegativeToZero.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/NegativeToZero.cs	(revision 14602)
@@ -0,0 +1,26 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class NegativeToZero : BenchmarkSuiteDataDescriptor<long[], long[]> {
+    private const string displayMame = "Negative To Zero";
+    private const string description = "Given a vector of integers, return the vector where all negative integers have been replaced by 0.";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override long[] ConvertInput(string[] input) {
+      return ConvertIntegers(input[0]);
+    }
+
+    public override long[] ConvertOutput(string[] output) {
+      return ConvertIntegers(output[0]);
+    }
+
+    public override IPushData CreatePushData(Example<long[], long[]>[] training, Example<long[], long[]>[] test) {
+      return new NegativeToZeroPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/NumberIo.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/NumberIo.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/NumberIo.cs	(revision 14602)
@@ -0,0 +1,28 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using System.Linq;
+
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class NumberIo : BenchmarkSuiteDataDescriptor<double[], double> {
+    private const string displayMame = "NumberIO";
+    private const string description = " Given an integer and a float, print their sum.";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+
+    protected override int InputCount { get { return 2; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override double[] ConvertInput(string[] input) {
+      return input.Select(ConvertDouble).ToArray();
+    }
+
+    public override double ConvertOutput(string[] output) {
+      return ConvertDouble(output[0]);
+    }
+
+    public override IPushData CreatePushData(Example<double[], double>[] training, Example<double[], double>[] test) {
+      return new NumberIoPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/PigLatin.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/PigLatin.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/PigLatin.cs	(revision 14602)
@@ -0,0 +1,25 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class PigLatin : BenchmarkSuiteDataDescriptor<string, string> {
+    private const string displayMame = "Pig Latin";
+    private const string description = "Given a string containing lowercase words separated by single spaces, print the string with each word translated to pig Latin.Specifically, if a word starts with a vowel, it should have“ay”added to its end; otherwise, the first letter is moved to the end of the word, followed by “ay”";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 1; } }
+
+    public override string ConvertInput(string[] input) {
+      return input[0];
+    }
+
+    public override string ConvertOutput(string[] output) {
+      return output[0];
+    }
+
+    public override IPushData CreatePushData(Example<string, string>[] training, Example<string, string>[] test) {
+      return new PigLatinPushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/ReplaceSpaceWithNewLine.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/ReplaceSpaceWithNewLine.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.BenchmarkSuite/Problems/ReplaceSpaceWithNewLine.cs	(revision 14602)
@@ -0,0 +1,25 @@
+﻿namespace HeuristicLab.BenchmarkSuite.Problems {
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+
+  public class ReplaceSpaceWithNewline : BenchmarkSuiteDataDescriptor<string, string[]> {
+    private const string displayMame = "Replace Space with Newline";
+    private const string description = "Given a string input, print the string, replacing spaces with newlines.Also, return the integer count of the non- whitespace characters. The input string will not have tabs or newlines.";
+
+    public override string Name { get { return displayMame; } }
+    public override string Description { get { return description; } }
+    protected override int InputCount { get { return 1; } }
+    protected override int OutputCount { get { return 2; } }
+
+    public override string ConvertInput(string[] input) {
+      return input[0];
+    }
+
+    public override string[] ConvertOutput(string[] output) {
+      return output;
+    }
+
+    public override IPushData CreatePushData(Example<string, string[]>[] training, Example<string, string[]>[] test) {
+      return new ReplaceSpaceWithNewlinePushData(training, test);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj	(revision 14602)
@@ -0,0 +1,119 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{5C93448C-47E3-4C3F-B1D0-EE62A48C3204}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.ProgramSynthesis</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.ProgramSynthesis</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <LangVersion>5</LangVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Push\PushProblem.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Algorithms.PushGP\HeuristicLab.Algorithms.PushGP.csproj">
+      <Project>{368d1303-470c-4f31-91f2-0fad379daa45}</Project>
+      <Name>HeuristicLab.Algorithms.PushGP</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.BenchmarkSuite\HeuristicLab.BenchmarkSuite.csproj">
+      <Project>{22B5C087-CFC7-4D40-86C6-32FCF2CA921E}</Project>
+      <Name>HeuristicLab.BenchmarkSuite</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj.user
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj.user	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj.user	(revision 14602)
@@ -0,0 +1,10 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ProjectFiles</ProjectView>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <StartAction>Program</StartAction>
+    <StartProgram>T:\BTSync\projects\svn\hl\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
+  </PropertyGroup>
+</Project>
Index: anches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.PushGP.csproj
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.PushGP.csproj	(revision 14601)
+++ 	(revision )
@@ -1,97 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{5C93448C-47E3-4C3F-B1D0-EE62A48C3204}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>HeuristicLab.Problems.PushGP</RootNamespace>
-    <AssemblyName>HeuristicLab.Problems.PushGP</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <TargetFrameworkProfile />
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <LangVersion>5</LangVersion>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Net.Http" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Plugin.cs" />
-    <Compile Include="ProgramSynthesis\PushProblem.cs" />
-    <Compile Include="ProgramSynthesis\PushEvalutator.cs" />
-    <Compile Include="ProgramSynthesis\PushProgram.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\HeuristicLab.Algorithms.PushGP\HeuristicLab.Algorithms.PushGP.csproj">
-      <Project>{368d1303-470c-4f31-91f2-0fad379daa45}</Project>
-      <Name>HeuristicLab.Algorithms.PushGP</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup />
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PostBuildEvent>"T:\BTSync\projects\svn\hl\trunk\sources\bin\HeuristicLab 3.3.exe"</PostBuildEvent>
-  </PropertyGroup>
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
Index: anches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.PushGP.csproj.user
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.PushGP.csproj.user	(revision 14601)
+++ 	(revision )
@@ -1,6 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ProjectView>ShowAllFiles</ProjectView>
-  </PropertyGroup>
-</Project>
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Plugin.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Plugin.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Plugin.cs	(revision 14602)
@@ -26,8 +26,15 @@
   using HeuristicLab.PluginInfrastructure;
 
-  [Plugin("HeuristicLab.Problems.ProgramSynthesis.PushGP", "1.0")]
-  [PluginFile("HeuristicLab.Problems.ProgramSynthesis.PushGP.dll", PluginFileType.Assembly)]
+  [Plugin("HeuristicLab.Problems.ProgramSynthesis", "1.0")]
+  [PluginFile("HeuristicLab.Problems.ProgramSynthesis.dll", PluginFileType.Assembly)]
   [PluginFile("HeuristicLab.Algorithms.PushGP.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Problems.ProgramSynthesis.BenchmarkSuite", "1.0")]
   [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.IntegerVectorEncoding", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
   public class PushGpPlugin : PluginBase {
 
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushEvalutator.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushEvalutator.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushEvalutator.cs	(revision 14602)
@@ -0,0 +1,12 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Problems.PushGP.ProgramSynthesis {
+
+  public class PushEvalutator {
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushProblem.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushProblem.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushProblem.cs	(revision 14602)
@@ -0,0 +1,144 @@
+﻿using System;
+
+namespace HeuristicLab.Problems.PushGP.ProgramSynthesis {
+  using System.Collections.Generic;
+  using System.Linq;
+
+  using HeuristicLab.Algorithms.PushGP.Expressions;
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+  using HeuristicLab.BenchmarkSuite.ProblemData;
+  using HeuristicLab.Common;
+  using HeuristicLab.Core;
+  using HeuristicLab.Data;
+  using HeuristicLab.Encodings.IntegerVectorEncoding;
+  using HeuristicLab.Optimization;
+  using HeuristicLab.Parameters;
+  //using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+  using HeuristicLab.Problems.Instances;
+
+  //[StorableClass]
+  [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 180)]
+  [Item("Push GP Problem", "")]
+  public class PushProblem : SingleObjectiveBasicProblem<IntegerVectorEncoding>, IProblemInstanceConsumer<IPushData> {
+
+    private readonly PushGpInterpreterPool pool = new PushGpInterpreterPool();
+    private IPushData pushData;
+
+    public PushProblem() {
+      this.InitParameters();
+
+      this.Encoding.Bounds[0, 0] = 0;
+      this.Encoding.Bounds[0, 1] = ExpressionTable.Count - 1;
+      this.Encoding.Length = this.pool.Configuration.MaxPointsInProgram;
+    }
+
+    #region Parameters
+
+    private const string EvalPushLimitParameterName = "EvalPushLimit";
+    private const string MaxProgramLengthParameterName = "MaxProgramLength";
+    private const string TopLevelPushCodeParameterName = "TopLevelPushCode";
+    private const string TopLevelPopCodeParameterName = "TopLevelPopCode";
+
+    private void InitParameters() {
+      this.Parameters.Add(new FixedValueParameter<IntValue>(EvalPushLimitParameterName, new IntValue(this.pool.Configuration.EvalPushLimit)));
+      this.Parameters.Add(new FixedValueParameter<IntValue>(MaxProgramLengthParameterName, new IntValue(this.pool.Configuration.MaxPointsInProgram)));
+      this.Parameters.Add(new FixedValueParameter<BoolValue>(TopLevelPushCodeParameterName, new BoolValue(this.pool.Configuration.TopLevelPushCode)) { Hidden = true });
+      this.Parameters.Add(new FixedValueParameter<BoolValue>(TopLevelPopCodeParameterName, new BoolValue(this.pool.Configuration.TopLevelPopCode)) { Hidden = true });
+    }
+
+    public IValueParameter<IntValue> EvalPushLimitParameter { get { return this.Parameters[EvalPushLimitParameterName] as ValueParameter<IntValue>; } }
+    public int EvalPushLimit
+    {
+      get { return this.pool.Configuration.EvalPushLimit; }
+      set
+      {
+        this.EvalPushLimitParameter.Value.Value = value;
+        this.pool.Configuration.EvalPushLimit = value;
+      }
+    }
+
+    public IValueParameter<IntValue> MaxProgramLengthParameter { get { return this.Parameters[MaxProgramLengthParameterName] as ValueParameter<IntValue>; } }
+
+    public int MaxProgramLength
+    {
+      get { return this.pool.Configuration.MaxPointsInProgram; }
+      set
+      {
+        this.MaxProgramLengthParameter.Value.Value = value;
+        this.Encoding.LengthParameter.Value.Value = value;
+        this.pool.Configuration.MaxPointsInProgram = value;
+      }
+    }
+
+    public IValueParameter<BoolValue> TopLevelPushParameter { get { return this.Parameters[TopLevelPushCodeParameterName] as ValueParameter<BoolValue>; } }
+
+    public bool TopLevelPushCode
+    {
+      get { return this.pool.Configuration.TopLevelPushCode; }
+      set
+      {
+        this.TopLevelPushParameter.Value.Value = value;
+        this.pool.Configuration.TopLevelPushCode = value;
+      }
+    }
+
+    public IValueParameter<BoolValue> TopLevelPopParameter { get { return this.Parameters[TopLevelPopCodeParameterName] as ValueParameter<BoolValue>; } }
+
+    public bool TopLevelPopCode
+    {
+      get { return this.pool.Configuration.TopLevelPopCode; }
+      set
+      {
+        this.TopLevelPushParameter.Value.Value = value;
+        this.pool.Configuration.TopLevelPopCode = value;
+      }
+    }
+
+    #endregion
+
+    // persistence
+    //[StorableConstructor]
+    public PushProblem(bool deserializing) : base(deserializing) { }
+
+    // cloning
+    public PushProblem(PushProblem original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override bool Maximization { get { return false; } }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      throw new NotImplementedException();
+    }
+
+    public override double Evaluate(Individual individual, IRandom random) {
+      var vector = individual.IntegerVector();
+      var program = MapToProgram(vector);
+      var results = new List<long>();
+
+      using (var interpreter = pool.GetInstance()) {
+        for (var i = 0; i < this.pushData.TrainingCount; i++) {
+          this.pushData.ApplyTrainingInput(interpreter, i);
+          interpreter.Run(program);
+
+          var diff = (long)this.pushData.CompareTrainingOutput(interpreter, i);
+          results.Add(diff);
+
+          interpreter.Clear();
+        }
+      }
+
+      return results.Count == 0 ? 0d : results.Average();
+    }
+
+    private static ExecExpandExpression MapToProgram(IntegerVector vector) {
+      var expressions = vector.Select(ExpressionTable.GetExpression);
+
+      return new ExecExpandExpression(expressions);
+    }
+
+    public void Load(IPushData data) {
+      this.pushData = data;
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushProgram.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushProgram.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/PushProgram.cs	(revision 14602)
@@ -0,0 +1,58 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.PushGP.ProgramSynthesis {
+  using System.Drawing;
+
+  using HeuristicLab.Algorithms.PushGP.Expressions;
+  using HeuristicLab.Common;
+  using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+  public class PushProgram : ExecExpandExpression, ISymbolicExpressionTree {
+    public PushProgram(Expression[] state)
+      : base(state) {
+    }
+
+    public PushProgram(ExecExpandExpression origin)
+      : base(origin) {
+    }
+
+    public object Clone() {
+      throw new NotImplementedException();
+    }
+
+    public IDeepCloneable Clone(Cloner cloner) {
+      throw new NotImplementedException();
+    }
+
+    public string ItemName { get; private set; }
+
+    public string ItemDescription { get; private set; }
+
+    public Version ItemVersion { get; private set; }
+
+    public Image ItemImage { get; private set; }
+
+    public event EventHandler ItemImageChanged;
+
+    public event EventHandler ToStringChanged;
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth() {
+      throw new NotImplementedException();
+    }
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix() {
+      throw new NotImplementedException();
+    }
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix() {
+      throw new NotImplementedException();
+    }
+
+    public ISymbolicExpressionTreeNode Root { get; set; }
+
+    public int Length { get { return this.State.Length; } }
+
+    public new int Depth { get { return base.Depth; } }
+  }
+}
Index: anches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Benchmark/ExampleConverter.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Benchmark/ExampleConverter.cs	(revision 14601)
+++ 	(revision )
@@ -1,28 +1,0 @@
-﻿namespace HeuristicLab.Tests.Benchmark
-{
-  using System.Linq;
-
-  public static class ExampleConverter
-  {
-    private const char ArrayValueSeparator = ' ';
-
-    private static readonly char[] arraySymbolTrim = { '[', ']' };
-
-    public static long Integer(string str)
-    {
-      return long.Parse(str);
-    }
-
-    public static long[] Integers(string str)
-    {
-      var values =
-        str.Trim(arraySymbolTrim).Split(ArrayValueSeparator).Where(s => !string.IsNullOrWhiteSpace(s)).ToList();
-
-      var result = new long[values.Count];
-
-      for (var i = 0; i < result.Length; i++) result[i] = Integer(values[i]);
-
-      return result;
-    }
-  }
-}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Benchmark/ProblemTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Benchmark/ProblemTests.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Benchmark/ProblemTests.cs	(revision 14602)
@@ -0,0 +1,206 @@
+﻿namespace HeuristicLab.Tests.Benchmark.Problem {
+  using System;
+  using System.Linq;
+  using System.Threading.Tasks;
+
+  using HeuristicLab.Algorithms.PushGP.Data.Random;
+  using HeuristicLab.Algorithms.PushGP.Expressions;
+  using HeuristicLab.Algorithms.PushGP.Generators;
+  using HeuristicLab.Algorithms.PushGP.Interpreter;
+  using HeuristicLab.BenchmarkSuite;
+  using HeuristicLab.BenchmarkSuite.Problems;
+  using HeuristicLab.Problems.Instances;
+
+  using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+  [TestClass]
+  public class ProblemTests {
+
+    private void Test(params IDataDescriptor[] descriptors) {
+      var instance = new BenchmarkSuitePushInstanceProvider();
+
+      foreach (var d in descriptors) {
+        var examples = instance.LoadData(d);
+      }
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void CountOdds() {
+      RandomWalk(new CountOdds());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void Checksum() {
+      RandomWalk(new Checksum());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void CollatzNumbers() {
+      RandomWalk(new CollatzNumbers());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void CompareStringLengths() {
+      RandomWalk(new CompareStringLengths());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void Digits() {
+      RandomWalk(new Digits());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void DoubleLetters() {
+      RandomWalk(new DoubleLetters());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void EvenSquares() {
+      RandomWalk(new EvenSquares());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void ForLoopIndex() {
+      RandomWalk(new ForLoopIndex());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void Grades() {
+      RandomWalk(new Grades());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void LastIndexOfZero() {
+      RandomWalk(new LastIndexOfZero());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void Median() {
+      RandomWalk(new Median());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void MirrorImage() {
+      RandomWalk(new MirrorImage());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void NegativeToZero() {
+      RandomWalk(new NegativeToZero());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void NumberIo() {
+      RandomWalk(new NumberIo());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void PigLatin() {
+      RandomWalk(new PigLatin());
+    }
+
+    [TestMethod]
+    [TestProperty("Time", "Medium")]
+    [TestCategory("ProblemTest")]
+    public void ReplaceSpaceWithNewLine() {
+      RandomWalk(new ReplaceSpaceWithNewline());
+    }
+
+    private static void RandomWalk(IDataDescriptor descriptor) {
+      var maxProgramSizeLimit = 1024;
+      var iterations = 1; //4000;
+      var best = double.MaxValue;
+      var globalExecCounter = 0;
+      var lockObj = new object();
+      var lockCount = new object();
+      RandomFactory.Seed = 1337;
+
+      Expression bestProgram = null;
+      var config = new Configuration { EvalPushLimit = 500 };
+      var pool = new PushGpInterpreterPool(config);
+
+      var instance = new BenchmarkSuitePushInstanceProvider();
+      var examples = instance.LoadData(descriptor);
+
+      Parallel.For(0, iterations, i => {
+        var execCounter = 0;
+        var program = CodeGenerator.RandomProgram(maxProgramSizeLimit);
+        var results = new double[examples.TrainingCount];
+
+        using (var interpreter = pool.GetInstance()) {
+          for (var j = 0; j < examples.TrainingCount; j++) {
+            examples.ApplyTrainingInput(interpreter, j);
+            interpreter.Run(program);
+
+            results[j] = examples.CompareTrainingOutput(interpreter, j);
+
+            execCounter += interpreter.ExecCounter;
+            interpreter.Clear();
+          }
+        }
+
+        lock (lockCount) {
+          globalExecCounter += execCounter;
+        }
+
+        var avg = results.Average();
+
+        if (avg >= best) return;
+
+        lock (lockObj) {
+          if (avg < best) {
+            best = avg;
+            bestProgram = program;
+          }
+        }
+      });
+
+      var resultsTest = new double[examples.TrainingCount];
+      Parallel.For(0, examples.TrainingCount, i => {
+        using (var interpreter = pool.GetInstance()) {
+          examples.ApplyTestInput(interpreter, i);
+          interpreter.Run(bestProgram);
+
+          resultsTest[i] = examples.CompareTestOutput(interpreter, i);
+        }
+      });
+
+      var averageTestResult = resultsTest.Average();
+
+      Console.WriteLine("Best Training: {0}", best);
+      Console.WriteLine("Test: {0}", averageTestResult);
+      Console.WriteLine("Best trainig program: {0}", bestProgram);
+      Console.WriteLine("ExecCounter: {0}", globalExecCounter);
+    }
+  }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/HeuristicLab.Tests.csproj
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 14602)
@@ -47,4 +47,8 @@
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.IO.Compression" />
@@ -63,8 +67,5 @@
   </Choose>
   <ItemGroup>
-    <Compile Include="Benchmark\Example.cs" />
-    <Compile Include="Benchmark\ExampleConverter.cs" />
-    <Compile Include="Benchmark\Problem\CountOdds.cs" />
-    <Compile Include="Benchmark\Problem\Problem.cs" />
+    <Compile Include="Benchmark\ProblemTests.cs" />
     <Compile Include="Interpreter\Expressions\CommonTests.cs" />
     <Compile Include="Interpreter\Expressions\ExampleTests.cs" />
@@ -84,7 +85,12 @@
       <Name>HeuristicLab.Algorithms.PushGP</Name>
     </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Benchmark\Data\BenchmarkExamples.zip" />
+    <ProjectReference Include="..\HeuristicLab.BenchmarkSuite\HeuristicLab.BenchmarkSuite.csproj">
+      <Project>{22b5c087-cfc7-4d40-86c6-32fcf2ca921e}</Project>
+      <Name>HeuristicLab.BenchmarkSuite</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Problems.ProgramSynthesis\HeuristicLab.Problems.ProgramSynthesis.csproj">
+      <Project>{5C93448C-47E3-4C3F-B1D0-EE62A48C3204}</Project>
+      <Name>HeuristicLab.Problems.ProgramSynthesis</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/HeuristicLab.Tests.csproj.user
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/HeuristicLab.Tests.csproj.user	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/HeuristicLab.Tests.csproj.user	(revision 14602)
@@ -2,5 +2,5 @@
 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectView>ShowAllFiles</ProjectView>
+    <ProjectView>ProjectFiles</ProjectView>
   </PropertyGroup>
 </Project>
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/BooleanExpressionTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/BooleanExpressionTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/BooleanExpressionTests.cs	(revision 14602)
@@ -32,5 +32,5 @@
     {
       this.interpreter.BooleanStack.Push(true, false);
-      this.interpreter.Interpret(new BooleanAndExpression());
+      this.interpreter.Run(new BooleanAndExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -55,5 +55,5 @@
     {
       this.interpreter.BooleanStack.Push(true, false);
-      this.interpreter.Interpret(new BooleanOrExpression());
+      this.interpreter.Run(new BooleanOrExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -78,5 +78,5 @@
     {
       this.interpreter.BooleanStack.Push(true);
-      this.interpreter.Interpret(new BooleanNotExpression());
+      this.interpreter.Run(new BooleanNotExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -101,5 +101,5 @@
     {
       this.interpreter.FloatStack.Push(2.0);
-      this.interpreter.Interpret(new BooleanFromFloatExpression());
+      this.interpreter.Run(new BooleanFromFloatExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -124,5 +124,5 @@
     {
       this.interpreter.IntegerStack.Push(2);
-      this.interpreter.Interpret(new BooleanFromIntegerExpression());
+      this.interpreter.Run(new BooleanFromIntegerExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CodeExpressionTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CodeExpressionTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CodeExpressionTests.cs	(revision 14602)
@@ -35,5 +35,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeAppendExpression());
+      this.interpreter.Run(new CodeAppendExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -51,5 +51,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeAppendExpression());
+      this.interpreter.Run(new CodeAppendExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -67,5 +67,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeAppendExpression());
+      this.interpreter.Run(new CodeAppendExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -82,5 +82,5 @@
 
       this.interpreter.CodeStack.Push(list);
-      this.interpreter.Interpret(new CodeDuplicateExpression());
+      this.interpreter.Run(new CodeDuplicateExpression());
 
       Assert.AreEqual(this.Stack.Count, 2);
@@ -99,5 +99,5 @@
 
       this.interpreter.CodeStack.Push(first);
-      this.interpreter.Interpret(new CodeAtomExpression());
+      this.interpreter.Run(new CodeAtomExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -113,5 +113,5 @@
 
       this.interpreter.CodeStack.Push(first);
-      this.interpreter.Interpret(new CodeAtomExpression());
+      this.interpreter.Run(new CodeAtomExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -127,5 +127,5 @@
 
       this.interpreter.CodeStack.Push(first);
-      this.interpreter.Interpret(new CodeAtomExpression());
+      this.interpreter.Run(new CodeAtomExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -142,5 +142,5 @@
 
       this.interpreter.CodeStack.Push(first);
-      this.interpreter.Interpret(new CodeCarExpression());
+      this.interpreter.Run(new CodeCarExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -157,5 +157,5 @@
 
       this.interpreter.CodeStack.Push(first);
-      this.interpreter.Interpret(new CodeCarExpression());
+      this.interpreter.Run(new CodeCarExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -172,5 +172,5 @@
 
       this.interpreter.CodeStack.Push(first);
-      this.interpreter.Interpret(new CodeCdrExpression());
+      this.interpreter.Run(new CodeCdrExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -187,5 +187,5 @@
 
       this.interpreter.CodeStack.Push(first);
-      this.interpreter.Interpret(new CodeCdrExpression());
+      this.interpreter.Run(new CodeCdrExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -203,5 +203,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeConsExpression());
+      this.interpreter.Run(new CodeConsExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -218,5 +218,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeContainsExpression());
+      this.interpreter.Run(new CodeContainsExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -233,5 +233,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeContainsExpression());
+      this.interpreter.Run(new CodeContainsExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -249,5 +249,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeContainerExpression());
+      this.interpreter.Run(new CodeContainerExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -265,5 +265,5 @@
       this.interpreter.NameStack.Push("Test");
 
-      this.interpreter.Interpret(new CodeDefinitionExpression());
+      this.interpreter.Run(new CodeDefinitionExpression());
 
       Assert.AreEqual(code, this.interpreter.CodeStack.Top);
@@ -281,5 +281,5 @@
       this.interpreter.CustomExpressions.Add("Test1", code);
       this.interpreter.NameStack.Push("Test2");
-      this.interpreter.Interpret(program);
+      this.interpreter.Run(program);
 
       this.TestStackCounts(nameStack: 1);
@@ -295,5 +295,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeDiscrepancyExpression());
+      this.interpreter.Run(new CodeDiscrepancyExpression());
 
       Assert.AreEqual(2, this.interpreter.IntegerStack.Top);
@@ -310,5 +310,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeDiscrepancyExpression());
+      this.interpreter.Run(new CodeDiscrepancyExpression());
 
       Assert.AreEqual(0, this.interpreter.IntegerStack.Top);
@@ -325,5 +325,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeDiscrepancyExpression());
+      this.interpreter.Run(new CodeDiscrepancyExpression());
 
       Assert.AreEqual(3, this.interpreter.IntegerStack.Top);
@@ -340,5 +340,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeDiscrepancyExpression());
+      this.interpreter.Run(new CodeDiscrepancyExpression());
 
       Assert.AreEqual(5, this.interpreter.IntegerStack.Top);
@@ -354,5 +354,5 @@
 
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoExpression());
+      this.interpreter.Run(new CodeDoExpression());
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -368,5 +368,5 @@
 
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoXExpression());
+      this.interpreter.Run(new CodeDoXExpression());
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -383,5 +383,5 @@
       this.interpreter.IntegerStack.Push(3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoCountExpression());
+      this.interpreter.Run(new CodeDoCountExpression());
 
       Assert.AreEqual(6, this.interpreter.IntegerStack.Top);
@@ -398,5 +398,5 @@
       this.interpreter.IntegerStack.Push(-1);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoCountExpression());
+      this.interpreter.Run(new CodeDoCountExpression());
 
       Assert.AreEqual(-1, this.interpreter.IntegerStack.Top);
@@ -413,5 +413,5 @@
       this.interpreter.IntegerStack.Push(3, 5);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoRangeExpression());
+      this.interpreter.Run(new CodeDoRangeExpression());
 
       Assert.AreEqual(12, this.interpreter.IntegerStack.Top);
@@ -428,5 +428,5 @@
       this.interpreter.IntegerStack.Push(3, 3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoRangeExpression());
+      this.interpreter.Run(new CodeDoRangeExpression());
 
       Assert.AreEqual(3, this.interpreter.IntegerStack.Top);
@@ -443,5 +443,5 @@
       this.interpreter.IntegerStack.Push(-3, -5);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoRangeExpression());
+      this.interpreter.Run(new CodeDoRangeExpression());
 
       Assert.AreEqual(-12, this.interpreter.IntegerStack.Top);
@@ -458,5 +458,5 @@
       this.interpreter.IntegerStack.Push(2, 3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoTimesExpression());
+      this.interpreter.Run(new CodeDoTimesExpression());
 
       Assert.AreEqual(32, this.interpreter.IntegerStack.Top);
@@ -473,5 +473,5 @@
       this.interpreter.IntegerStack.Push(2, -3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeDoTimesExpression());
+      this.interpreter.Run(new CodeDoTimesExpression());
 
       Assert.AreEqual(-3, this.interpreter.IntegerStack.Top);
@@ -484,5 +484,5 @@
     [TestCategory("CodeExpressionTest")]
     public void TestNestedDoRange() {
-      this.interpreter.Interpret(
+      this.interpreter.Run(
         "( 0 2 CODE.QUOTE ( 1 INTEGER.+ 0 3 CODE.QUOTE ( 1 INTEGER.+ INTEGER.* ) CODE.DO*RANGE INTEGER.+ ) CODE.DO*RANGE )");
 
@@ -496,5 +496,5 @@
     [TestCategory("CodeExpressionTest")]
     public void TestNestedDoCount() {
-      this.interpreter.Interpret(
+      this.interpreter.Run(
         "( 2 CODE.QUOTE ( 1 INTEGER.+ 3 CODE.QUOTE ( 1 INTEGER.+ INTEGER.* ) CODE.DO*COUNT INTEGER.+ ) CODE.DO*COUNT )");
 
@@ -508,5 +508,5 @@
     [TestCategory("CodeExpressionTest")]
     public void TestNestedDoTimes() {
-      this.interpreter.Interpret(
+      this.interpreter.Run(
         "( 3 CODE.QUOTE ( 2 3 CODE.QUOTE ( 2 INTEGER.* ) CODE.DO*TIMES INTEGER.+ ) CODE.DO*TIMES )");
 
@@ -525,5 +525,5 @@
       this.interpreter.IntegerStack.Push(5);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeExtractExpression());
+      this.interpreter.Run(new CodeExtractExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -541,5 +541,5 @@
       this.interpreter.IntegerStack.Push(3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeExtractExpression());
+      this.interpreter.Run(new CodeExtractExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -557,5 +557,5 @@
       this.interpreter.IntegerStack.Push(6);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeExtractExpression());
+      this.interpreter.Run(new CodeExtractExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -573,5 +573,5 @@
       this.interpreter.IntegerStack.Push(8);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeExtractExpression());
+      this.interpreter.Run(new CodeExtractExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -589,5 +589,5 @@
       this.interpreter.IntegerStack.Push(7);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeExtractExpression());
+      this.interpreter.Run(new CodeExtractExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -602,5 +602,5 @@
       var result = PushGPParser.Parse("FALSE");
       this.interpreter.BooleanStack.Push(false);
-      this.interpreter.Interpret(new CodeFromBooleanExpression());
+      this.interpreter.Run(new CodeFromBooleanExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -615,5 +615,5 @@
       var result = PushGPParser.Parse("4.1");
       this.interpreter.FloatStack.Push(4.1);
-      this.interpreter.Interpret(new CodeFromFloatExpression());
+      this.interpreter.Run(new CodeFromFloatExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -628,5 +628,5 @@
       var result = PushGPParser.Parse("4");
       this.interpreter.IntegerStack.Push(4);
-      this.interpreter.Interpret(new CodeFromIntegerExpression());
+      this.interpreter.Run(new CodeFromIntegerExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -641,5 +641,5 @@
       var result = PushGPParser.Parse("A");
       this.interpreter.NameStack.Push("A");
-      this.interpreter.Interpret(new CodeFromNameExpression());
+      this.interpreter.Run(new CodeFromNameExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -657,5 +657,5 @@
       this.interpreter.BooleanStack.Push(true);
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeIfExpression());
+      this.interpreter.Run(new CodeIfExpression());
 
       Assert.AreEqual("WAHR", this.interpreter.NameStack.Top);
@@ -673,5 +673,5 @@
       this.interpreter.BooleanStack.Push(false);
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeIfExpression());
+      this.interpreter.Run(new CodeIfExpression());
 
       Assert.AreEqual("FALSCH", this.interpreter.NameStack.Top);
@@ -690,5 +690,5 @@
       this.interpreter.IntegerStack.Push(2);
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeInsertExpression());
+      this.interpreter.Run(new CodeInsertExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -707,5 +707,5 @@
       this.interpreter.IntegerStack.Push(-2);
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeInsertExpression());
+      this.interpreter.Run(new CodeInsertExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -724,5 +724,5 @@
       this.interpreter.IntegerStack.Push(10);
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeInsertExpression());
+      this.interpreter.Run(new CodeInsertExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -740,5 +740,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeListExpression());
+      this.interpreter.Run(new CodeListExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -755,5 +755,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeMemberExpression());
+      this.interpreter.Run(new CodeMemberExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -770,5 +770,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeMemberExpression());
+      this.interpreter.Run(new CodeMemberExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -785,5 +785,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodeMemberExpression());
+      this.interpreter.Run(new CodeMemberExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -796,5 +796,5 @@
     [TestCategory("CodeExpressionTest")]
     public void TestNoop() {
-      this.interpreter.Interpret(new CodeNoopExpression());
+      this.interpreter.Run(new CodeNoopExpression());
 
       this.CheckOtherStacksAreEmpty();
@@ -811,5 +811,5 @@
       this.interpreter.IntegerStack.Push(3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthExpression());
+      this.interpreter.Run(new CodeNthExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -827,5 +827,5 @@
       this.interpreter.IntegerStack.Push(3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthExpression());
+      this.interpreter.Run(new CodeNthExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -843,5 +843,5 @@
       this.interpreter.IntegerStack.Push(3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthExpression());
+      this.interpreter.Run(new CodeNthExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -859,5 +859,5 @@
       this.interpreter.IntegerStack.Push(13);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthExpression());
+      this.interpreter.Run(new CodeNthExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -875,5 +875,5 @@
       this.interpreter.IntegerStack.Push(-3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthExpression());
+      this.interpreter.Run(new CodeNthExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -891,5 +891,5 @@
       this.interpreter.IntegerStack.Push(2);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthCdrExpression());
+      this.interpreter.Run(new CodeNthCdrExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -907,5 +907,5 @@
       this.interpreter.IntegerStack.Push(10);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthCdrExpression());
+      this.interpreter.Run(new CodeNthCdrExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -923,5 +923,5 @@
       this.interpreter.IntegerStack.Push(-2);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthCdrExpression());
+      this.interpreter.Run(new CodeNthCdrExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -939,5 +939,5 @@
       this.interpreter.IntegerStack.Push(3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthCdrExpression());
+      this.interpreter.Run(new CodeNthCdrExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -955,5 +955,5 @@
       this.interpreter.IntegerStack.Push(3);
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNthCdrExpression());
+      this.interpreter.Run(new CodeNthCdrExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -969,5 +969,5 @@
 
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNullExpression());
+      this.interpreter.Run(new CodeNullExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -983,5 +983,5 @@
 
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeNullExpression());
+      this.interpreter.Run(new CodeNullExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -998,5 +998,5 @@
 
       this.interpreter.CodeStack.Push(second, first);
-      this.interpreter.Interpret(new CodePositionExpression());
+      this.interpreter.Run(new CodePositionExpression());
 
       Assert.AreEqual(2, this.interpreter.IntegerStack.Top);
@@ -1011,5 +1011,5 @@
       var result = PushGPParser.Parse("A");
 
-      this.interpreter.Interpret("( CODE.QUOTE A )");
+      this.interpreter.Run("( CODE.QUOTE A )");
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
@@ -1025,5 +1025,5 @@
 
       this.interpreter.CodeStack.Push(prog);
-      this.interpreter.Interpret(new CodeSizeExpression());
+      this.interpreter.Run(new CodeSizeExpression());
 
       Assert.AreEqual(4, this.interpreter.IntegerStack.Top);
@@ -1042,5 +1042,5 @@
 
       this.interpreter.CodeStack.Push(third, second, first);
-      this.interpreter.Interpret(new CodeSubstitutionExpression());
+      this.interpreter.Run(new CodeSubstitutionExpression());
 
       Assert.AreEqual(result, this.interpreter.CodeStack.Top);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CommonTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CommonTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/CommonTests.cs	(revision 14602)
@@ -19,5 +19,5 @@
 
     protected virtual void Test(Expression expression) {
-      this.interpreter.Interpret(expression);
+      this.interpreter.Run(expression);
     }
 
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExampleTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExampleTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExampleTests.cs	(revision 14602)
@@ -12,5 +12,5 @@
     [TestCategory("ExampleTest")]
     public void Example1() {
-      this.interpreter.Interpret("( 2 3 INTEGER.* 4.1 5.2 FLOAT.+ TRUE FALSE BOOLEAN.OR )");
+      this.interpreter.Run("( 2 3 INTEGER.* 4.1 5.2 FLOAT.+ TRUE FALSE BOOLEAN.OR )");
 
       Assert.AreEqual(6, this.interpreter.IntegerStack.Top);
@@ -26,5 +26,5 @@
     [TestCategory("ExampleTest")]
     public void Example2() {
-      this.interpreter.Interpret("( 5 1.23 INTEGER.+ ( 4 ) INTEGER.- 5.67 FLOAT.* )");
+      this.interpreter.Run("( 5 1.23 INTEGER.+ ( 4 ) INTEGER.- 5.67 FLOAT.* )");
 
       Assert.AreEqual(1, this.interpreter.IntegerStack.Top);
@@ -40,5 +40,5 @@
     [TestCategory("ExampleTest")]
     public void Example3() {
-      this.interpreter.Interpret("( 5 INTEGER.DUP INTEGER.+ )");
+      this.interpreter.Run("( 5 INTEGER.DUP INTEGER.+ )");
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -54,5 +54,5 @@
     [TestCategory("ExampleTest")]
     public void Example4() {
-      this.interpreter.Interpret("( 5 CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DO )");
+      this.interpreter.Run("( 5 CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DO )");
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -68,5 +68,5 @@
     [TestCategory("ExampleTest")]
     public void Example5() {
-      this.interpreter.Interpret("( DOUBLE CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DEFINE 5 DOUBLE )");
+      this.interpreter.Run("( DOUBLE CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) CODE.DEFINE 5 DOUBLE )");
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -82,5 +82,5 @@
     [TestCategory("ExampleTest")]
     public void Example6() {
-      this.interpreter.Interpret("( CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) DOUBLE CODE.DEFINE 5 DOUBLE )");
+      this.interpreter.Run("( CODE.QUOTE ( INTEGER.DUP INTEGER.+ ) DOUBLE CODE.DEFINE 5 DOUBLE )");
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -96,5 +96,5 @@
     [TestCategory("ExampleTest")]
     public void Example7() {
-      this.interpreter.Interpret("( DOUBLE EXEC.DEFINE ( INTEGER.DUP INTEGER.+ ) 5 DOUBLE )");
+      this.interpreter.Run("( DOUBLE EXEC.DEFINE ( INTEGER.DUP INTEGER.+ ) 5 DOUBLE )");
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -113,5 +113,5 @@
 
       this.interpreter.IntegerStack.Push(5);
-      this.interpreter.Interpret(@"( CODE.QUOTE ( INTEGER.POP 1 )
+      this.interpreter.Run(@"( CODE.QUOTE ( INTEGER.POP 1 )
                                            CODE.QUOTE ( CODE.DUP INTEGER.DUP 1 INTEGER.- CODE.DO INTEGER.* )
                                            INTEGER.DUP 2 INTEGER.< CODE.IF )");
@@ -130,5 +130,5 @@
     public void Example9() {
       this.interpreter.IntegerStack.Push(5);
-      this.interpreter.Interpret("( 1 INTEGER.MAX 1 EXEC.DO*RANGE INTEGER.* )");
+      this.interpreter.Run("( 1 INTEGER.MAX 1 EXEC.DO*RANGE INTEGER.* )");
 
       Assert.AreEqual(120, this.interpreter.IntegerStack.Top);
@@ -145,5 +145,5 @@
     public void Example10() {
       this.interpreter.IntegerStack.Push(5);
-      this.interpreter.Interpret("( 1 INTEGER.MAX 1 EXEC.DO*RANGE ( 2 INTEGER.* ) )");
+      this.interpreter.Run("( 1 INTEGER.MAX 1 EXEC.DO*RANGE ( 2 INTEGER.* ) )");
 
       Assert.AreEqual(2, this.interpreter.IntegerStack.Top);
@@ -164,5 +164,5 @@
       this.interpreter.FloatStack.Push(2.1, 0.7);
 
-      this.interpreter.Interpret(program);
+      this.interpreter.Run(program);
 
       Assert.IsTrue(this.interpreter.IntegerStack.IsEmpty);
@@ -176,5 +176,5 @@
       this.interpreter.IntegerStack.Push(1, 2);
       this.interpreter.FloatStack.Push(2.1, 0.7);
-      this.interpreter.Interpret(program);
+      this.interpreter.Run(program);
 
       Assert.IsTrue(this.interpreter.IntegerStack.IsEmpty);
@@ -195,5 +195,5 @@
       this.interpreter.FloatStack.Push(2.1, 0.7);
 
-      this.interpreter.Interpret(program);
+      this.interpreter.Run(program);
 
       Assert.IsTrue(this.interpreter.IntegerStack.IsEmpty);
@@ -207,5 +207,5 @@
       this.interpreter.IntegerStack.Push(1, 2);
       this.interpreter.FloatStack.Push(2.1, 0.7);
-      this.interpreter.Interpret(program);
+      this.interpreter.Run(program);
 
       Assert.IsTrue(this.interpreter.IntegerStack.IsEmpty);
@@ -222,5 +222,5 @@
     public void Example13() {
       this.interpreter.IntegerStack.Push(5);
-      this.interpreter.Interpret("( EXEC.Y ( ( FALSE 2 INTEGER.* ) EXEC.IF ( ) EXEC.POP ) )");
+      this.interpreter.Run("( EXEC.Y ( ( FALSE 2 INTEGER.* ) EXEC.IF ( ) EXEC.POP ) )");
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -237,5 +237,5 @@
     public void Example14() {
       this.interpreter.IntegerStack.Push(5);
-      this.interpreter.Interpret("( EXEC.Y ( ( 2 INTEGER.* INTEGER.DUP 1000 INTEGER.< ) EXEC.IF ( ) EXEC.POP ) )");
+      this.interpreter.Run("( EXEC.Y ( ( 2 INTEGER.* INTEGER.DUP 1000 INTEGER.< ) EXEC.IF ( ) EXEC.POP ) )");
 
       Assert.AreEqual(1280, this.interpreter.IntegerStack.Top);
@@ -253,12 +253,12 @@
       this.interpreter.IntegerStack.Push(10);
       this.interpreter.FloatStack.Push(2);
-      this.interpreter.Interpret(@"( ARG FLOAT.DEFINE
-                                           EXEC.Y (
-                                           ARG FLOAT.*
-                                           1 INTEGER.-
-                                           INTEGER.DUP 1 INTEGER.>
-                                           EXEC.IF ( ) EXEC.POP
-                                           )
-                                         )");
+      this.interpreter.Run(@"( ARG FLOAT.DEFINE
+                                     EXEC.Y (
+                                       ARG FLOAT.*
+                                       1 INTEGER.-
+                                       INTEGER.DUP 1 INTEGER.>
+                                       EXEC.IF ( ) EXEC.POP
+                                     )
+                                   )");
 
       Assert.AreEqual(1024, this.interpreter.FloatStack.Top, Delta);
@@ -277,5 +277,5 @@
 
       this.interpreter.CodeStack.Push(list);
-      this.interpreter.Interpret("( CODE.DUP 0 CODE.INSERT )");
+      this.interpreter.Run("( CODE.DUP 0 CODE.INSERT )");
 
       var id = this.interpreter.CodeStack.Top.GetHashCode();
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExecExpressionTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExecExpressionTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/ExecExpressionTests.cs	(revision 14602)
@@ -25,5 +25,5 @@
 
     protected override void Test(Expression expression) {
-      this.interpreter.InterpretAsync(expression, true).Wait();
+      this.interpreter.RunAsync(expression, true).Wait();
     }
 
@@ -34,5 +34,5 @@
     public void TestIfTrue() {
       this.interpreter.BooleanStack.Push(true);
-      this.interpreter.Interpret("( EXEC.IF WAHR FALSCH )");
+      this.interpreter.Run("( EXEC.IF WAHR FALSCH )");
 
       Assert.AreEqual("WAHR", this.interpreter.NameStack.Top);
@@ -46,5 +46,5 @@
     public void TestIfFalse() {
       this.interpreter.BooleanStack.Push(false);
-      this.interpreter.Interpret("( EXEC.IF WAHR FALSCH )");
+      this.interpreter.Run("( EXEC.IF WAHR FALSCH )");
 
       Assert.AreEqual("FALSCH", this.interpreter.NameStack.Top);
@@ -109,5 +109,5 @@
     [TestCategory("ExecExpressionTest")]
     public void TestNestedDoRange() {
-      this.interpreter.Interpret(
+      this.interpreter.Run(
         "( 0 2 EXEC.DO*RANGE ( 1 INTEGER.+ 0 3 EXEC.DO*RANGE ( 1 INTEGER.+ INTEGER.* ) INTEGER.+ )");
 
@@ -121,5 +121,5 @@
     [TestCategory("ExecExpressionTest")]
     public void TestNestedDoCount() {
-      this.interpreter.Interpret(
+      this.interpreter.Run(
         "( 2 EXEC.DO*COUNT ( 1 INTEGER.+ 3 EXEC.DO*COUNT ( 1 INTEGER.+ INTEGER.* ) INTEGER.+ )");
 
@@ -133,5 +133,5 @@
     [TestCategory("ExecExpressionTest")]
     public void TestNestedDoTimes() {
-      this.interpreter.Interpret("( 3 EXEC.DO*TIMES ( 2 3 EXEC.DO*TIMES ( 2 INTEGER.* ) INTEGER.+ )");
+      this.interpreter.Run("( 3 EXEC.DO*TIMES ( 2 3 EXEC.DO*TIMES ( 2 INTEGER.* ) INTEGER.+ )");
 
       Assert.AreEqual(128, this.interpreter.IntegerStack.Top);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/FloatExpressionTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/FloatExpressionTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/FloatExpressionTests.cs	(revision 14602)
@@ -36,5 +36,5 @@
     {
       this.interpreter.FloatStack.Push(5.3, 5.3);
-      this.interpreter.Interpret(new FloatAddExpression());
+      this.interpreter.Run(new FloatAddExpression());
 
       Assert.AreEqual(10.6, this.interpreter.FloatStack.Top, delta);
@@ -59,5 +59,5 @@
     {
       this.interpreter.FloatStack.Push(10.2, 5.3);
-      this.interpreter.Interpret(new FloatSubtractExpression());
+      this.interpreter.Run(new FloatSubtractExpression());
 
       Assert.AreEqual(4.9, this.interpreter.FloatStack.Top, delta);
@@ -82,5 +82,5 @@
     {
       this.interpreter.FloatStack.Push(9.9, 3.3);
-      this.interpreter.Interpret(new FloatMultiplyExpression());
+      this.interpreter.Run(new FloatMultiplyExpression());
 
       Assert.AreEqual(32.67, this.interpreter.FloatStack.Top, delta);
@@ -105,5 +105,5 @@
     {
       this.interpreter.FloatStack.Push(9.9, 3.3);
-      this.interpreter.Interpret(new FloatDivideExpression());
+      this.interpreter.Run(new FloatDivideExpression());
 
       Assert.AreEqual(3.0, this.interpreter.FloatStack.Top, delta);
@@ -128,5 +128,5 @@
     {
       this.interpreter.FloatStack.Push(11.6, 5.3);
-      this.interpreter.Interpret(new FloatModuloExpression());
+      this.interpreter.Run(new FloatModuloExpression());
 
       Assert.AreEqual(1, this.interpreter.FloatStack.Top, delta);
@@ -151,5 +151,5 @@
     {
       this.interpreter.FloatStack.Push(10.2, 5.3);
-      this.interpreter.Interpret(new FloatMinExpression());
+      this.interpreter.Run(new FloatMinExpression());
 
       Assert.AreEqual(5.3, this.interpreter.FloatStack.Top, delta);
@@ -174,5 +174,5 @@
     {
       this.interpreter.FloatStack.Push(10.3, 5.3);
-      this.interpreter.Interpret(new FloatMaxExpression());
+      this.interpreter.Run(new FloatMaxExpression());
 
       Assert.AreEqual(10.3, this.interpreter.FloatStack.Top, delta);
@@ -197,5 +197,5 @@
     {
       this.interpreter.FloatStack.Push(10.2, 5.3);
-      this.interpreter.Interpret(new FloatSmallerThanExpression());
+      this.interpreter.Run(new FloatSmallerThanExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -220,5 +220,5 @@
     {
       this.interpreter.FloatStack.Push(10.2, 5.3);
-      this.interpreter.Interpret(new FloatGreaterThanExpression());
+      this.interpreter.Run(new FloatGreaterThanExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -243,5 +243,5 @@
     {
       this.interpreter.BooleanStack.Push(true);
-      this.interpreter.Interpret(new FloatFromBooleanExpression());
+      this.interpreter.Run(new FloatFromBooleanExpression());
 
       Assert.AreEqual(1d, this.interpreter.FloatStack.Top, delta);
@@ -257,5 +257,5 @@
     {
       this.interpreter.BooleanStack.Push(false);
-      this.interpreter.Interpret(new FloatFromBooleanExpression());
+      this.interpreter.Run(new FloatFromBooleanExpression());
 
       Assert.AreEqual(0d, this.interpreter.FloatStack.Top, delta);
@@ -280,5 +280,5 @@
     {
       this.interpreter.IntegerStack.Push(5);
-      this.interpreter.Interpret(new FloatFromIntegerExpression());
+      this.interpreter.Run(new FloatFromIntegerExpression());
 
       Assert.AreEqual(5d, this.interpreter.FloatStack.Top, delta);
@@ -303,5 +303,5 @@
     {
       this.interpreter.FloatStack.Push(Math.PI / 2);
-      this.interpreter.Interpret(new FloatSineExpression());
+      this.interpreter.Run(new FloatSineExpression());
 
       Assert.AreEqual(1, this.interpreter.FloatStack.Top, delta);
@@ -326,5 +326,5 @@
     {
       this.interpreter.FloatStack.Push(Math.PI);
-      this.interpreter.Interpret(new FloatCosineExpression());
+      this.interpreter.Run(new FloatCosineExpression());
 
       Assert.AreEqual(-1, this.interpreter.FloatStack.Top, delta);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs	(revision 14602)
@@ -32,5 +32,5 @@
     {
       this.interpreter.IntegerStack.Push(5, 5);
-      this.interpreter.Interpret(new IntegerAddExpression());
+      this.interpreter.Run(new IntegerAddExpression());
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -55,5 +55,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerSubtractExpression());
+      this.interpreter.Run(new IntegerSubtractExpression());
 
       Assert.AreEqual(5, this.interpreter.IntegerStack.Top);
@@ -78,5 +78,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerMultiplyExpression());
+      this.interpreter.Run(new IntegerMultiplyExpression());
 
       Assert.AreEqual(50, this.interpreter.IntegerStack.Top);
@@ -101,5 +101,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerDivideExpression());
+      this.interpreter.Run(new IntegerDivideExpression());
 
       Assert.AreEqual(2, this.interpreter.IntegerStack.Top);
@@ -124,5 +124,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerModuloExpression());
+      this.interpreter.Run(new IntegerModuloExpression());
 
       Assert.AreEqual(0, this.interpreter.IntegerStack.Top);
@@ -147,5 +147,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerMinExpression());
+      this.interpreter.Run(new IntegerMinExpression());
 
       Assert.AreEqual(5, this.interpreter.IntegerStack.Top);
@@ -170,5 +170,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerMaxExpression());
+      this.interpreter.Run(new IntegerMaxExpression());
 
       Assert.AreEqual(10, this.interpreter.IntegerStack.Top);
@@ -193,5 +193,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerSmallerThanExpression());
+      this.interpreter.Run(new IntegerSmallerThanExpression());
 
       Assert.AreEqual(false, this.interpreter.BooleanStack.Top);
@@ -216,5 +216,5 @@
     {
       this.interpreter.IntegerStack.Push(10, 5);
-      this.interpreter.Interpret(new IntegerGreaterThanExpression());
+      this.interpreter.Run(new IntegerGreaterThanExpression());
 
       Assert.AreEqual(true, this.interpreter.BooleanStack.Top);
@@ -239,5 +239,5 @@
     {
       this.interpreter.BooleanStack.Push(true);
-      this.interpreter.Interpret(new IntegerFromBooleanExpression());
+      this.interpreter.Run(new IntegerFromBooleanExpression());
 
       Assert.AreEqual(1, this.interpreter.IntegerStack.Top);
@@ -262,5 +262,5 @@
     {
       this.interpreter.BooleanStack.Push(false);
-      this.interpreter.Interpret(new IntegerFromBooleanExpression());
+      this.interpreter.Run(new IntegerFromBooleanExpression());
 
       Assert.AreEqual(0, this.interpreter.IntegerStack.Top);
@@ -276,5 +276,5 @@
     {
       this.interpreter.FloatStack.Push(1.5);
-      this.interpreter.Interpret(new IntegerFromFloatExpression());
+      this.interpreter.Run(new IntegerFromFloatExpression());
 
       Assert.AreEqual(1, this.interpreter.IntegerStack.Top);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/NameExpressionTests.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/NameExpressionTests.cs	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/Expressions/NameExpressionTests.cs	(revision 14602)
@@ -32,5 +32,5 @@
     public void TestRand()
     {
-      this.interpreter.Interpret(new NameRandExpression());
+      this.interpreter.Run(new NameRandExpression());
 
       Assert.IsTrue(this.interpreter.NameStack.Count == 1);
@@ -49,5 +49,5 @@
       this.interpreter.CustomExpressions.Add("c3", new CodeNoopExpression());
 
-      this.interpreter.Interpret(new NameRandBoundNameExpression());
+      this.interpreter.Run(new NameRandBoundNameExpression());
 
       Assert.IsTrue(this.interpreter.CustomExpressions.Keys.Contains(this.interpreter.NameStack.Top));
@@ -71,5 +71,5 @@
     public void TestQuote()
     {
-      this.interpreter.Interpret(new NameQuoteExpression());
+      this.interpreter.Run(new NameQuoteExpression());
 
       Assert.IsTrue(this.interpreter.IsNameQuoteFlagSet);
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/InterpreterTest.cs
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/InterpreterTest.cs	(revision 14602)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Tests/Interpreter/InterpreterTest.cs	(revision 14602)
@@ -0,0 +1,52 @@
+﻿using HeuristicLab.Algorithms.PushGP.Interpreter;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Tests.Interpreter
+{
+    public class InterpreterTest
+    {
+        protected PushGPInterpreter interpreter;
+
+        [TestInitialize]
+        public void BeforeTest()
+        {
+            interpreter = new PushGPInterpreter(new Configuration
+            {
+                TopLevelPushCode = false
+            });
+        }
+
+        protected void TestStackCounts(int? execStack = 0, int? codeStack = 0, int? nameStack = 0, int? booleanStack = 0, int? floatStack = 0, int? integerStack = 0)
+        {
+            if (execStack.HasValue)
+            {
+                Assert.AreEqual(execStack, interpreter.ExecStack.Count);
+            }
+
+            if (codeStack.HasValue)
+            {
+                Assert.AreEqual(codeStack, interpreter.CodeStack.Count);
+            }
+
+            if (nameStack.HasValue)
+            {
+                Assert.AreEqual(nameStack, interpreter.NameStack.Count);
+            }
+
+            if (booleanStack.HasValue)
+            {
+                Assert.AreEqual(booleanStack, interpreter.BooleanStack.Count);
+            }
+
+            if (floatStack.HasValue)
+            {
+                Assert.AreEqual(floatStack, interpreter.FloatStack.Count);
+            }
+
+            if (integerStack.HasValue)
+            {
+                Assert.AreEqual(integerStack, interpreter.IntegerStack.Count);
+            }
+        }
+    }
+}
Index: /branches/PushGP/HeuristicLab.Algorithms.PushGP/PushGp.sln
===================================================================
--- /branches/PushGP/HeuristicLab.Algorithms.PushGP/PushGp.sln	(revision 14601)
+++ /branches/PushGP/HeuristicLab.Algorithms.PushGP/PushGp.sln	(revision 14602)
@@ -12,5 +12,5 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.BenchmarkSuite", "HeuristicLab.BenchmarkSuite\HeuristicLab.BenchmarkSuite.csproj", "{22B5C087-CFC7-4D40-86C6-32FCF2CA921E}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.PushGP", "HeuristicLab.Problems.ProgramSynthesis\HeuristicLab.Problems.PushGP.csproj", "{5C93448C-47E3-4C3F-B1D0-EE62A48C3204}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.ProgramSynthesis", "HeuristicLab.Problems.ProgramSynthesis\HeuristicLab.Problems.ProgramSynthesis.csproj", "{5C93448C-47E3-4C3F-B1D0-EE62A48C3204}"
 EndProject
 Global
