Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/And.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/And.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/And.cs	(revision 2202)
@@ -38,7 +38,5 @@
     public And()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
+      MinArity = 2; MaxArity = 2;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/FunctionLibraryInjector.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/FunctionLibraryInjector.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/FunctionLibraryInjector.cs	(revision 2202)
@@ -34,5 +34,5 @@
     private const string OPERATORLIBRARY = "FunctionLibrary";
 
-    private GPOperatorLibrary operatorLibrary;
+    private FunctionLibrary operatorLibrary;
     private Variable variable;
 
@@ -44,5 +44,5 @@
       : base() {
       AddVariableInfo(new VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), VariableKind.In));
-      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(GPOperatorLibrary), VariableKind.New));
+      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(FunctionLibrary), VariableKind.New));
     }
 
@@ -82,12 +82,12 @@
       //SetAllowedSubOperators(xor, allFunctions);
 
-      operatorLibrary = new GPOperatorLibrary();
-      operatorLibrary.GPOperatorGroup.AddOperator(and);
-      operatorLibrary.GPOperatorGroup.AddOperator(or);
+      operatorLibrary = new FunctionLibrary();
+      operatorLibrary.FunctionGroup.AddFunction(and);
+      operatorLibrary.FunctionGroup.AddFunction(or);
       //operatorLibrary.GPOperatorGroup.AddOperator(not);
-      operatorLibrary.GPOperatorGroup.AddOperator(nand);
-      operatorLibrary.GPOperatorGroup.AddOperator(nor);
+      operatorLibrary.FunctionGroup.AddFunction(nand);
+      operatorLibrary.FunctionGroup.AddFunction(nor);
       //operatorLibrary.GPOperatorGroup.AddOperator(xor);
-      operatorLibrary.GPOperatorGroup.AddOperator(variable);
+      operatorLibrary.FunctionGroup.AddFunction(variable);
     }
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nand.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/Nand.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nand.cs	(revision 2202)
@@ -38,7 +38,5 @@
     public Nand()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
+      MinArity = 2; MaxArity = 2;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nor.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/Nor.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nor.cs	(revision 2202)
@@ -38,7 +38,5 @@
     public Nor()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
+      MinArity = 2; MaxArity = 2;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Not.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/Not.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Not.cs	(revision 2202)
@@ -38,6 +38,5 @@
     public Not()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
+      MinArity = 1; MaxArity = 1;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Or.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/Or.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Or.cs	(revision 2202)
@@ -38,7 +38,5 @@
     public Or()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
+      MinArity = 2; MaxArity = 2;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Variable.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/Variable.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Variable.cs	(revision 2202)
@@ -51,5 +51,5 @@
       GetVariableInfo(MANIPULATION).Local = false;
 
-      AddConstraint(new NumberOfSubOperatorsConstraint(0, 0));
+      MinArity = 0; MaxArity = 0;
 
       ConstrainedIntData variable = new ConstrainedIntData();
@@ -75,10 +75,5 @@
       combinedOp.OperatorGraph.InitialOperator = seq;
       seq.AddSubOperator(indexRandomizer);
-      HeuristicLab.Core.IVariable initOp = GetVariable(INITIALIZATION);
-      if(initOp == null) {
-        AddVariable(new HeuristicLab.Core.Variable(INITIALIZATION, combinedOp));
-      } else {
-        initOp.Value = combinedOp;
-      }
+      Initializer = combinedOp;
     }
 
@@ -97,14 +92,9 @@
       combinedOp.OperatorGraph.InitialOperator = seq;
       seq.AddSubOperator(indexRandomizer);
-      HeuristicLab.Core.IVariable manipulationOp = GetVariable(MANIPULATION);
-      if(manipulationOp == null) {
-        AddVariable(new HeuristicLab.Core.Variable(MANIPULATION, combinedOp));
-      } else {
-        manipulationOp.Value = combinedOp;
-      }
+      Manipulator = combinedOp;
     }
 
     public void SetConstraints(int[] allowedIndexes) {
-      ConstrainedIntData index = GetVariableValue<ConstrainedIntData>(INDEX, null, false);
+      //ConstrainedIntData index = GetVariableValue<ConstrainedIntData>(INDEX, null, false);
       Array.Sort(allowedIndexes);
       minIndex = allowedIndexes[0]; maxIndex = allowedIndexes[allowedIndexes.Length - 1];
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Xor.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.Boolean/3.3/Xor.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Xor.cs	(revision 2202)
@@ -38,7 +38,5 @@
     public Xor()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
+      MinArity = 2; MaxArity = 2;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/FunctionLibraryInjector.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.SantaFe/3.3/FunctionLibraryInjector.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/FunctionLibraryInjector.cs	(revision 2202)
@@ -33,5 +33,5 @@
     private const string OPERATORLIBRARY = "FunctionLibrary";
 
-    private GPOperatorLibrary operatorLibrary;
+    private FunctionLibrary operatorLibrary;
 
     public override string Description {
@@ -41,5 +41,5 @@
     public FunctionLibraryInjector()
       : base() {
-      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(GPOperatorLibrary), VariableKind.New));
+      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(FunctionLibrary), VariableKind.New));
     }
 
@@ -71,11 +71,11 @@
       SetAllowedSubOperators(prog3, allFunctions);
 
-      operatorLibrary = new GPOperatorLibrary();
-      operatorLibrary.GPOperatorGroup.AddOperator(ifFoodAhead);
-      operatorLibrary.GPOperatorGroup.AddOperator(prog2);
-      operatorLibrary.GPOperatorGroup.AddOperator(prog3);
-      operatorLibrary.GPOperatorGroup.AddOperator(move);
-      operatorLibrary.GPOperatorGroup.AddOperator(left);
-      operatorLibrary.GPOperatorGroup.AddOperator(right);
+      operatorLibrary = new FunctionLibrary();
+      operatorLibrary.FunctionGroup.AddFunction(ifFoodAhead);
+      operatorLibrary.FunctionGroup.AddFunction(prog2);
+      operatorLibrary.FunctionGroup.AddFunction(prog3);
+      operatorLibrary.FunctionGroup.AddFunction(move);
+      operatorLibrary.FunctionGroup.AddFunction(left);
+      operatorLibrary.FunctionGroup.AddFunction(right);
     }
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/IfFoodAhead.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.SantaFe/3.3/IfFoodAhead.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/IfFoodAhead.cs	(revision 2202)
@@ -39,7 +39,5 @@
     public IfFoodAhead()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
+      MinArity = 2; MaxArity = 2;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Left.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.SantaFe/3.3/Left.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Left.cs	(revision 2202)
@@ -39,5 +39,5 @@
     public Left()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(0, 0));
+      MinArity = 0; MaxArity = 0;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Move.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.SantaFe/3.3/Move.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Move.cs	(revision 2202)
@@ -39,5 +39,5 @@
     public Move()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(0, 0));
+      MinArity = 0; MaxArity = 0;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog2.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.SantaFe/3.3/Prog2.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog2.cs	(revision 2202)
@@ -39,7 +39,5 @@
     public Prog2()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
+      MinArity = 2; MaxArity = 2;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog3.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.SantaFe/3.3/Prog3.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog3.cs	(revision 2202)
@@ -39,8 +39,5 @@
     public Prog3()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(3, 3)); 
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-      AddConstraint(new SubOperatorTypeConstraint(2));
+      MinArity = 3; MaxArity = 3;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Right.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.SantaFe/3.3/Right.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Right.cs	(revision 2202)
@@ -38,5 +38,5 @@
     public Right()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(0, 0));
+      MinArity = 0; MaxArity = 0;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Addition.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Addition.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Addition.cs	(revision 2202)
@@ -42,8 +42,6 @@
       : base() {
       // 2 - 3 seems like an reasonable defaut (used for +,-,*,/) (discussion with swinkler and maffenze)
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 3));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-      AddConstraint(new SubOperatorTypeConstraint(2));
+      MinArity = 2;
+      MaxArity = 3;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/And.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/And.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/And.cs	(revision 2202)
@@ -38,8 +38,5 @@
     public And()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 3));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-      AddConstraint(new SubOperatorTypeConstraint(2));
+      MinArity = 2; MaxArity = 3;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Average.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Average.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Average.cs	(revision 2202)
@@ -36,8 +36,5 @@
     public Average()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 3));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-      AddConstraint(new SubOperatorTypeConstraint(2));
+      MinArity = 2; MaxArity = 3;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BakedTreeEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/BakedTreeEvaluator.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BakedTreeEvaluator.cs	(revision 2202)
@@ -183,7 +183,4 @@
             return Math.Abs(x - y);
           }
-        case EvaluatorSymbolTable.UNKNOWN: { // evaluate functions which are not statically defined directly
-            return currInstr.function.Apply();
-          }
         default: {
             throw new NotImplementedException();
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/BinaryFunction.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/BinaryFunction.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/BinaryFunction.cs	(revision 2202)
@@ -0,0 +1,35 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Constraints;
+
+namespace HeuristicLab.GP.StructureIdentification {
+  public abstract class BinaryFunction : FunctionBase {
+    public BinaryFunction()
+      : base() {
+      MinArity = 2; MaxArity = 2;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/Terminal.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/Terminal.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/Terminal.cs	(revision 2202)
@@ -0,0 +1,35 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Constraints;
+
+namespace HeuristicLab.GP.StructureIdentification {
+  public abstract class Terminal : FunctionBase {
+    public Terminal()
+      : base() {
+      MinArity = 0; MaxArity = 0;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/UnaryFunction.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/UnaryFunction.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/UnaryFunction.cs	(revision 2202)
@@ -0,0 +1,35 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Constraints;
+
+namespace HeuristicLab.GP.StructureIdentification {
+  public abstract class UnaryFunction : FunctionBase {
+    public UnaryFunction()
+      : base() {
+      MinArity = 1; MaxArity = 1;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Constant.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Constant.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Constant.cs	(revision 2202)
@@ -32,6 +32,7 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Constant : FunctionBase {
+  public sealed class Constant : Terminal {
     public const string VALUE = "Value";
+    private BakedFunctionTree constantNodeTemplate;
 
     public override string Description {
@@ -39,25 +40,26 @@
     }
 
+    public override IEnumerable<string> LocalParameterNames {
+      get {
+        return new string[] { VALUE };
+      }
+    }
+
     public Constant()
       : base() {
-      AddVariableInfo(new VariableInfo(VALUE, "The constant value", typeof(DoubleData), VariableKind.None));
-      GetVariableInfo(VALUE).Local = true;
-
       DoubleData valueData = new DoubleData();
-      // initialize a default range for the contant value
-      HeuristicLab.Core.Variable value = new HeuristicLab.Core.Variable(VALUE, valueData);
-      AddVariable(value);
+      constantNodeTemplate = new BakedFunctionTree(this);
+      constantNodeTemplate.AddVariable(new HeuristicLab.Core.Variable(VALUE, valueData));
 
       SetupInitialization();
       SetupManipulation();
+    }
 
-      // constant can't have suboperators
-      AddConstraint(new NumberOfSubOperatorsConstraint(0, 0));
+    public override IFunctionTree GetTreeNode() {
+      return (IFunctionTree)constantNodeTemplate.Clone();
     }
 
     private void SetupInitialization() {
       // initialization operator
-      AddVariableInfo(new VariableInfo(INITIALIZATION, "Initialization operator-graph for constants", typeof(IOperatorGraph), VariableKind.None));
-      GetVariableInfo(INITIALIZATION).Local = false;
       CombinedOperator combinedOp = new CombinedOperator();
       SequentialProcessor initSeq = new SequentialProcessor();
@@ -70,11 +72,9 @@
       combinedOp.OperatorGraph.InitialOperator = initSeq;
       initSeq.AddSubOperator(randomizer);
-      AddVariable(new HeuristicLab.Core.Variable(INITIALIZATION, combinedOp));
+      Initializer = combinedOp;
     }
 
     private void SetupManipulation() {
       // manipulation operator
-      AddVariableInfo(new VariableInfo(MANIPULATION, "Manipulation operator-graph for constants", typeof(IOperatorGraph), VariableKind.None));
-      GetVariableInfo(MANIPULATION).Local = false;
       CombinedOperator combinedOp = new CombinedOperator();
       SequentialProcessor manipulationSeq = new SequentialProcessor();
@@ -87,5 +87,5 @@
       combinedOp.OperatorGraph.InitialOperator = manipulationSeq;
       manipulationSeq.AddSubOperator(valueAdder);
-      AddVariable(new HeuristicLab.Core.Variable(MANIPULATION, combinedOp));
+      Manipulator = combinedOp;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Cosinus.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Cosinus.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Cosinus.cs	(revision 2202)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Cosinus : FunctionBase {
+  public sealed class Cosinus : UnaryFunction {
     public override string Description {
       get { return "Returns the cosinus of the first sub-tree."; }
@@ -36,7 +36,4 @@
     public Cosinus()
       : base() {
-      // must have exactly one subfunction
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Differential.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Differential.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Differential.cs	(revision 2202)
@@ -40,7 +40,5 @@
     }
 
-    public Differential()
-      : base() {
-    }
+    public Differential() : base() { }
   }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Division.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Division.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Division.cs	(revision 2202)
@@ -30,7 +30,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Division : FunctionBase {
-    private const double EPSILON = 10.0E-20; // if any divisor is < EPSILON return 0
-
+  public sealed class Division : BinaryFunction {
     public override string Description {
       get {
@@ -46,12 +44,5 @@
     }
 
-    public Division()
-      : base() {
-      // 2 - 3 seems like an reasonable defaut (used for +,-,*,/) (discussion with swinkler and maffenze)
-      //MK changed to only 2 allowed suboperators to be compliant with HL2
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-    }
+    public Division() : base() { }
   }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Equal.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Equal.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Equal.cs	(revision 2202)
@@ -28,5 +28,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Equal : FunctionBase {
+  public sealed class Equal : BinaryFunction {
     public override string Description {
       get {
@@ -35,10 +35,5 @@
     }
 
-    public Equal()
-      : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-    }
+    public Equal() : base() { }
   }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Exponential.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Exponential.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Exponential.cs	(revision 2202)
@@ -29,15 +29,10 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Exponential : FunctionBase {
+  public sealed class Exponential : UnaryFunction {
     public override string Description {
       get { return "Returns returns exponential of the first sub-tree (power(e, x))."; }
     }
 
-    public Exponential()
-      : base() {
-      // must have exactly one sub-operator
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-    }
+    public Exponential() : base() { }
   }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs	(revision 2202)
@@ -72,5 +72,5 @@
       AddVariableInfo(new VariableInfo(MINTIMEOFFSET, "Minimal time offset for all features", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo(MAXTIMEOFFSET, "Maximal time offset for all feature", typeof(IntData), VariableKind.In));
-      AddVariableInfo(new VariableInfo(FUNCTIONLIBRARY, "Preconfigured default operator library", typeof(GPOperatorLibrary), VariableKind.New));
+      AddVariableInfo(new VariableInfo(FUNCTIONLIBRARY, "Preconfigured default function library", typeof(FunctionLibrary), VariableKind.New));
 
       AddVariable(DIFFERENTIALS_ALLOWED, false);
@@ -107,6 +107,5 @@
 
     public override IOperation Apply(IScope scope) {
-      StructId.Variable variable;
-      GPOperatorLibrary operatorLibrary;
+      FunctionLibrary functionLibrary = new FunctionLibrary();
       int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;
 
@@ -118,57 +117,57 @@
       int maxTimeOffset = maxTimeOffsetItem == null ? 0 : ((IntData)maxTimeOffsetItem).Data;
 
-      variable = new StructId.Variable();
-      StructId.Constant constant = new StructId.Constant();
-      StructId.Differential differential = new Differential();
-      StructId.Addition addition = new StructId.Addition();
-      StructId.And and = new StructId.And();
-      StructId.Average average = new StructId.Average();
-      StructId.Cosinus cosinus = new StructId.Cosinus();
-      StructId.Division division = new StructId.Division();
-      StructId.Equal equal = new StructId.Equal();
-      StructId.Exponential exponential = new StructId.Exponential();
-      StructId.GreaterThan greaterThan = new StructId.GreaterThan();
-      StructId.IfThenElse ifThenElse = new StructId.IfThenElse();
-      StructId.LessThan lessThan = new StructId.LessThan();
-      StructId.Logarithm logarithm = new StructId.Logarithm();
-      StructId.Multiplication multiplication = new StructId.Multiplication();
-      StructId.Not not = new StructId.Not();
-      StructId.Or or = new StructId.Or();
-      StructId.Power power = new StructId.Power();
-      StructId.Signum signum = new StructId.Signum();
-      StructId.Sinus sinus = new StructId.Sinus();
-      StructId.Sqrt sqrt = new StructId.Sqrt();
-      StructId.Subtraction subtraction = new StructId.Subtraction();
-      StructId.Tangens tangens = new StructId.Tangens();
-      StructId.Xor xor = new StructId.Xor();
-
-
-      List<IOperator> booleanFunctions = new List<IOperator>();
-      ConditionalAddOperator(AND_ALLOWED, and, booleanFunctions);
-      ConditionalAddOperator(EQUAL_ALLOWED, equal, booleanFunctions);
-      ConditionalAddOperator(GREATERTHAN_ALLOWED, greaterThan, booleanFunctions);
-      ConditionalAddOperator(LESSTHAN_ALLOWED, lessThan, booleanFunctions);
-      ConditionalAddOperator(NOT_ALLOWED, not, booleanFunctions);
-      ConditionalAddOperator(OR_ALLOWED, or, booleanFunctions);
-      ConditionalAddOperator(XOR_ALLOWED, xor, booleanFunctions);
-
-      List<IOperator> doubleFunctions = new List<IOperator>();
-      ConditionalAddOperator(DIFFERENTIALS_ALLOWED, differential, doubleFunctions);
-      ConditionalAddOperator(VARIABLES_ALLOWED, variable, doubleFunctions);
-      ConditionalAddOperator(CONSTANTS_ALLOWED, constant, doubleFunctions);
-      ConditionalAddOperator(ADDITION_ALLOWED, addition, doubleFunctions);
-      ConditionalAddOperator(AVERAGE_ALLOWED, average, doubleFunctions);
-      ConditionalAddOperator(COSINUS_ALLOWED, cosinus, doubleFunctions);
-      ConditionalAddOperator(DIVISION_ALLOWED, division, doubleFunctions);
-      ConditionalAddOperator(EXPONENTIAL_ALLOWED, exponential, doubleFunctions);
-      ConditionalAddOperator(IFTHENELSE_ALLOWED, ifThenElse, doubleFunctions);
-      ConditionalAddOperator(LOGARTIHM_ALLOWED, logarithm, doubleFunctions);
-      ConditionalAddOperator(MULTIPLICATION_ALLOWED, multiplication, doubleFunctions);
-      ConditionalAddOperator(POWER_ALLOWED, power, doubleFunctions);
-      ConditionalAddOperator(SIGNUM_ALLOWED, signum, doubleFunctions);
-      ConditionalAddOperator(SINUS_ALLOWED, sinus, doubleFunctions);
-      ConditionalAddOperator(SQRT_ALLOWED, sqrt, doubleFunctions);
-      ConditionalAddOperator(SUBTRACTION_ALLOWED, subtraction, doubleFunctions);
-      ConditionalAddOperator(TANGENS_ALLOWED, tangens, doubleFunctions);
+      Variable variable = new Variable();
+      Constant constant = new Constant();
+      Differential differential = new Differential();
+      Addition addition = new Addition();
+      And and = new And();
+      Average average = new Average();
+      Cosinus cosinus = new Cosinus();
+      Division division = new Division();
+      Equal equal = new Equal();
+      Exponential exponential = new Exponential();
+      GreaterThan greaterThan = new GreaterThan();
+      IfThenElse ifThenElse = new IfThenElse();
+      LessThan lessThan = new LessThan();
+      Logarithm logarithm = new Logarithm();
+      Multiplication multiplication = new Multiplication();
+      Not not = new Not();
+      Or or = new Or();
+      Power power = new Power();
+      Signum signum = new Signum();
+      Sinus sinus = new Sinus();
+      Sqrt sqrt = new Sqrt();
+      Subtraction subtraction = new Subtraction();
+      Tangens tangens = new Tangens();
+      Xor xor = new Xor();
+
+
+      List<IFunction> booleanFunctions = new List<IFunction>();
+      ConditionalAddFunction(AND_ALLOWED, and, booleanFunctions);
+      ConditionalAddFunction(EQUAL_ALLOWED, equal, booleanFunctions);
+      ConditionalAddFunction(GREATERTHAN_ALLOWED, greaterThan, booleanFunctions);
+      ConditionalAddFunction(LESSTHAN_ALLOWED, lessThan, booleanFunctions);
+      ConditionalAddFunction(NOT_ALLOWED, not, booleanFunctions);
+      ConditionalAddFunction(OR_ALLOWED, or, booleanFunctions);
+      ConditionalAddFunction(XOR_ALLOWED, xor, booleanFunctions);
+
+      List<IFunction> doubleFunctions = new List<IFunction>();
+      ConditionalAddFunction(DIFFERENTIALS_ALLOWED, differential, doubleFunctions);
+      ConditionalAddFunction(VARIABLES_ALLOWED, variable, doubleFunctions);
+      ConditionalAddFunction(CONSTANTS_ALLOWED, constant, doubleFunctions);
+      ConditionalAddFunction(ADDITION_ALLOWED, addition, doubleFunctions);
+      ConditionalAddFunction(AVERAGE_ALLOWED, average, doubleFunctions);
+      ConditionalAddFunction(COSINUS_ALLOWED, cosinus, doubleFunctions);
+      ConditionalAddFunction(DIVISION_ALLOWED, division, doubleFunctions);
+      ConditionalAddFunction(EXPONENTIAL_ALLOWED, exponential, doubleFunctions);
+      ConditionalAddFunction(IFTHENELSE_ALLOWED, ifThenElse, doubleFunctions);
+      ConditionalAddFunction(LOGARTIHM_ALLOWED, logarithm, doubleFunctions);
+      ConditionalAddFunction(MULTIPLICATION_ALLOWED, multiplication, doubleFunctions);
+      ConditionalAddFunction(POWER_ALLOWED, power, doubleFunctions);
+      ConditionalAddFunction(SIGNUM_ALLOWED, signum, doubleFunctions);
+      ConditionalAddFunction(SINUS_ALLOWED, sinus, doubleFunctions);
+      ConditionalAddFunction(SQRT_ALLOWED, sqrt, doubleFunctions);
+      ConditionalAddFunction(SUBTRACTION_ALLOWED, subtraction, doubleFunctions);
+      ConditionalAddFunction(TANGENS_ALLOWED, tangens, doubleFunctions);
 
       SetAllowedSubOperators(and, booleanFunctions);
@@ -196,76 +195,53 @@
       SetAllowedSubOperators(tangens, doubleFunctions);
 
-      operatorLibrary = new GPOperatorLibrary();
-      ConditionalAddOperator(DIFFERENTIALS_ALLOWED, operatorLibrary, differential);
-      ConditionalAddOperator(VARIABLES_ALLOWED, operatorLibrary, variable);
-      ConditionalAddOperator(CONSTANTS_ALLOWED, operatorLibrary, constant);
-      ConditionalAddOperator(ADDITION_ALLOWED, operatorLibrary, addition);
-      ConditionalAddOperator(AVERAGE_ALLOWED, operatorLibrary, average);
-      ConditionalAddOperator(AND_ALLOWED, operatorLibrary, and);
-      ConditionalAddOperator(COSINUS_ALLOWED, operatorLibrary, cosinus);
-      ConditionalAddOperator(DIVISION_ALLOWED, operatorLibrary, division);
-      ConditionalAddOperator(EQUAL_ALLOWED, operatorLibrary, equal);
-      ConditionalAddOperator(EXPONENTIAL_ALLOWED, operatorLibrary, exponential);
-      ConditionalAddOperator(GREATERTHAN_ALLOWED, operatorLibrary, greaterThan);
-      ConditionalAddOperator(IFTHENELSE_ALLOWED, operatorLibrary, ifThenElse);
-      ConditionalAddOperator(LESSTHAN_ALLOWED, operatorLibrary, lessThan);
-      ConditionalAddOperator(LOGARTIHM_ALLOWED, operatorLibrary, logarithm);
-      ConditionalAddOperator(MULTIPLICATION_ALLOWED, operatorLibrary, multiplication);
-      ConditionalAddOperator(NOT_ALLOWED, operatorLibrary, not);
-      ConditionalAddOperator(POWER_ALLOWED, operatorLibrary, power);
-      ConditionalAddOperator(OR_ALLOWED, operatorLibrary, or);
-      ConditionalAddOperator(SIGNUM_ALLOWED, operatorLibrary, signum);
-      ConditionalAddOperator(SINUS_ALLOWED, operatorLibrary, sinus);
-      ConditionalAddOperator(SQRT_ALLOWED, operatorLibrary, sqrt);
-      ConditionalAddOperator(SUBTRACTION_ALLOWED, operatorLibrary, subtraction);
-      ConditionalAddOperator(TANGENS_ALLOWED, operatorLibrary, tangens);
-      ConditionalAddOperator(XOR_ALLOWED, operatorLibrary, xor);
+      ConditionalAddOperator(DIFFERENTIALS_ALLOWED, functionLibrary, differential);
+      ConditionalAddOperator(VARIABLES_ALLOWED, functionLibrary, variable);
+      ConditionalAddOperator(CONSTANTS_ALLOWED, functionLibrary, constant);
+      ConditionalAddOperator(ADDITION_ALLOWED, functionLibrary, addition);
+      ConditionalAddOperator(AVERAGE_ALLOWED, functionLibrary, average);
+      ConditionalAddOperator(AND_ALLOWED, functionLibrary, and);
+      ConditionalAddOperator(COSINUS_ALLOWED, functionLibrary, cosinus);
+      ConditionalAddOperator(DIVISION_ALLOWED, functionLibrary, division);
+      ConditionalAddOperator(EQUAL_ALLOWED, functionLibrary, equal);
+      ConditionalAddOperator(EXPONENTIAL_ALLOWED, functionLibrary, exponential);
+      ConditionalAddOperator(GREATERTHAN_ALLOWED, functionLibrary, greaterThan);
+      ConditionalAddOperator(IFTHENELSE_ALLOWED, functionLibrary, ifThenElse);
+      ConditionalAddOperator(LESSTHAN_ALLOWED, functionLibrary, lessThan);
+      ConditionalAddOperator(LOGARTIHM_ALLOWED, functionLibrary, logarithm);
+      ConditionalAddOperator(MULTIPLICATION_ALLOWED, functionLibrary, multiplication);
+      ConditionalAddOperator(NOT_ALLOWED, functionLibrary, not);
+      ConditionalAddOperator(POWER_ALLOWED, functionLibrary, power);
+      ConditionalAddOperator(OR_ALLOWED, functionLibrary, or);
+      ConditionalAddOperator(SIGNUM_ALLOWED, functionLibrary, signum);
+      ConditionalAddOperator(SINUS_ALLOWED, functionLibrary, sinus);
+      ConditionalAddOperator(SQRT_ALLOWED, functionLibrary, sqrt);
+      ConditionalAddOperator(SUBTRACTION_ALLOWED, functionLibrary, subtraction);
+      ConditionalAddOperator(TANGENS_ALLOWED, functionLibrary, tangens);
+      ConditionalAddOperator(XOR_ALLOWED, functionLibrary, xor);
 
       variable.SetConstraints(minTimeOffset, maxTimeOffset);
       differential.SetConstraints(minTimeOffset, maxTimeOffset);
 
-      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(FUNCTIONLIBRARY), operatorLibrary));
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(FUNCTIONLIBRARY), functionLibrary));
 
       return null;
     }
 
-    private void ConditionalAddOperator(string condName, IOperator op, List<IOperator> list) {
-      if (GetVariableValue<BoolData>(condName, null, false).Data) list.Add(op);
-    }
-
-    private void ConditionalAddOperator(string condName, GPOperatorLibrary operatorLibrary, IOperator op) {
-      if (GetVariableValue<BoolData>(condName, null, false).Data) operatorLibrary.GPOperatorGroup.AddOperator(op);
-    }
-
-    private void SetAllowedSubOperators(IFunction f, List<IOperator> gs) {
-      foreach (IConstraint c in f.Constraints) {
-        if (c is SubOperatorTypeConstraint) {
-          SubOperatorTypeConstraint typeConstraint = c as SubOperatorTypeConstraint;
-          typeConstraint.Clear();
-          foreach (IOperator g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        } else if (c is AllSubOperatorsTypeConstraint) {
-          AllSubOperatorsTypeConstraint typeConstraint = c as AllSubOperatorsTypeConstraint;
-          typeConstraint.Clear();
-          foreach (IOperator g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        }
+    private void ConditionalAddFunction(string condName, IFunction fun, List<IFunction> list) {
+      if (GetVariableValue<BoolData>(condName, null, false).Data) list.Add(fun);
+    }
+
+    private void ConditionalAddOperator(string condName, FunctionLibrary functionLib, IFunction op) {
+      if (GetVariableValue<BoolData>(condName, null, false).Data) functionLib.AddFunction(op);
+    }
+
+    private void SetAllowedSubOperators(IFunction f, List<IFunction> gs) {
+      for (int i = 0; i < f.MaxArity; i++) {
+        SetAllowedSubOperators(f, i, gs);
       }
     }
 
-    private void SetAllowedSubOperators(IFunction f, int p, List<IOperator> gs) {
-      foreach (IConstraint c in f.Constraints) {
-        if (c is SubOperatorTypeConstraint) {
-          SubOperatorTypeConstraint typeConstraint = c as SubOperatorTypeConstraint;
-          if (typeConstraint.SubOperatorIndex.Data == p) {
-            typeConstraint.Clear();
-            foreach (IOperator g in gs) {
-              typeConstraint.AddOperator(g);
-            }
-          }
-        }
-      }
+    private void SetAllowedSubOperators(IFunction f, int i, List<IFunction> gs) {
+      gs.ForEach((g) => f.AddAllowedSubFunction(g, i));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/GreaterThan.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/GreaterThan.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/GreaterThan.cs	(revision 2202)
@@ -27,5 +27,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class GreaterThan : FunctionBase {
+  public sealed class GreaterThan : BinaryFunction {
     public override string Description {
       get {
@@ -34,10 +34,5 @@
     }
 
-    public GreaterThan()
-      : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-    }
+    public GreaterThan() : base() { }
   }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj	(revision 2202)
@@ -86,4 +86,7 @@
     <Compile Include="Average.cs" />
     <Compile Include="BakedTreeEvaluator.cs" />
+    <Compile Include="BaseClasses\BinaryFunction.cs" />
+    <Compile Include="BaseClasses\Terminal.cs" />
+    <Compile Include="BaseClasses\UnaryFunction.cs" />
     <Compile Include="Constant.cs" />
     <Compile Include="AlgorithmBase.cs" />
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/IfThenElse.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/IfThenElse.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/IfThenElse.cs	(revision 2202)
@@ -38,8 +38,5 @@
     public IfThenElse()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(3, 3));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-      AddConstraint(new SubOperatorTypeConstraint(2));
+      MinArity = 3; MaxArity = 3;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/LessThan.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/LessThan.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/LessThan.cs	(revision 2202)
@@ -28,5 +28,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class LessThan : FunctionBase {
+  public sealed class LessThan : BinaryFunction {
     public override string Description {
       get {
@@ -37,7 +37,4 @@
     public LessThan()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Logarithm.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Logarithm.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Logarithm.cs	(revision 2202)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Logarithm : FunctionBase {
+  public sealed class Logarithm : UnaryFunction {
     public override string Description {
       get { return "Returns the natural (base e) logarithm of the first sub-tree."; }
@@ -36,7 +36,4 @@
     public Logarithm()
       : base() {
-      // must have exactly 1 suboperator
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Multiplication.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Multiplication.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Multiplication.cs	(revision 2202)
@@ -43,8 +43,5 @@
       : base() {
       // 2 - 3 seems like an reasonable defaut (used for +,-,*,/) (discussion with swinkler and maffenze)
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 3));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-      AddConstraint(new SubOperatorTypeConstraint(2));
+      MinArity = 2; MaxArity = 3;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Not.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Not.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Not.cs	(revision 2202)
@@ -28,5 +28,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Not : FunctionBase {
+  public sealed class Not : UnaryFunction {
     public override string Description {
       get {
@@ -37,6 +37,4 @@
     public Not()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Or.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Or.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Or.cs	(revision 2202)
@@ -31,6 +31,5 @@
     public override string Description {
       get {
-        return @"Logical OR operation. Only defined for sub-tree-results 0.0 and 1.0.
-Special form, evaluation stops at first sub-tree that evaluates to 1.0 (true).";
+        return @"Logical OR operation. Only defined for sub-tree-results 0.0 and 1.0.";
       }
     }
@@ -38,8 +37,5 @@
     public Or()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 3));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
-      AddConstraint(new SubOperatorTypeConstraint(2));
+      MinArity = 2; MaxArity = 3;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Power.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Power.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Power.cs	(revision 2202)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Power : FunctionBase {
+  public sealed class Power : BinaryFunction {
     public override string Description {
       get { return "Returns the result of the first sub-tree to the power of the second sub-tree (power(x, y))."; }
@@ -36,8 +36,4 @@
     public Power()
       : base() {
-      // must have exactly 2 suboperators base ^ exponent
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Signum.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Signum.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Signum.cs	(revision 2202)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Signum : FunctionBase {
+  public sealed class Signum : UnaryFunction {
     public override string Description {
       get { return "Returns the signum of the first sub-tree."; }
@@ -36,7 +36,4 @@
     public Signum()
       : base() {
-      // must have exactly 1 suboperator
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Sinus.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Sinus.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Sinus.cs	(revision 2202)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Sinus : FunctionBase {
+  public sealed class Sinus : UnaryFunction {
     public override string Description {
       get { return "Returns the sinus of the first sub-tree."; }
@@ -36,7 +36,4 @@
     public Sinus()
       : base() {
-      // must have exactly 1 suboperator
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Sqrt.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Sqrt.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Sqrt.cs	(revision 2202)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Sqrt : FunctionBase {
+  public sealed class Sqrt : UnaryFunction {
     public override string Description {
       get { return "Returns the square root of the first sub-tree."; }
@@ -36,7 +36,4 @@
     public Sqrt()
       : base() {
-      // must have exactly 1 suboperator
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Subtraction.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Subtraction.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Subtraction.cs	(revision 2202)
@@ -30,5 +30,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Subtraction : FunctionBase {
+  public sealed class Subtraction : BinaryFunction {
     public override string Description {
       get {
@@ -42,9 +42,4 @@
     public Subtraction()
       : base() {
-      // 2 - 3 seems like an reasonable defaut (used for +,-,*,/) (discussion with swinkler and maffenze)
-      //MK changed to only 2 allowed suboperators to be compliant with HL2
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Tangens.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Tangens.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Tangens.cs	(revision 2202)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Tangens : FunctionBase {
+  public sealed class Tangens : UnaryFunction {
     public override string Description {
       get { return "Returns the tangens of the first sub-tree."; }
@@ -36,7 +36,4 @@
     public Tangens()
       : base() {
-      // must have exactly one suboperator
-      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
-      AddConstraint(new SubOperatorTypeConstraint(0));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/TreeEvaluatorBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/TreeEvaluatorBase.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/TreeEvaluatorBase.cs	(revision 2202)
@@ -28,4 +28,5 @@
 using System.Diagnostics;
 using HeuristicLab.DataAnalysis;
+using HeuristicLab.Data;
 
 namespace HeuristicLab.GP.StructureIdentification {
@@ -78,11 +79,11 @@
         case EvaluatorSymbolTable.DIFFERENTIAL:
         case EvaluatorSymbolTable.VARIABLE: {
-            instr.i_arg0 = (short)dataset.GetVariableIndex((string)f.localData[0]); // var
-            instr.d_arg0 = (double)f.localData[1]; // weight
-            instr.i_arg1 = (short)(int)f.localData[2]; // sample-offset
+            instr.i_arg0 = (short)dataset.GetVariableIndex((((StringData)f.localData[1].Value).Data)); // var
+            instr.d_arg0 = ((DoubleData)f.localData[0].Value).Data; // weight
+            instr.i_arg1 = (short)((ConstrainedIntData)f.localData[2].Value).Data; // sample-offset
             break;
           }
         case EvaluatorSymbolTable.CONSTANT: {
-            instr.d_arg0 = (double)f.localData[0]; // value
+            instr.d_arg0 = ((DoubleData)f.localData[0].Value).Data; // value
             break;
           }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Variable.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Variable.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Variable.cs	(revision 2202)
@@ -32,9 +32,10 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public class Variable : FunctionBase {
-
+  public class Variable : Terminal {    
     public const string WEIGHT = "Weight";
     public const string OFFSET = "SampleOffset";
     public const string INDEX = "Variable";
+
+    private BakedFunctionTree variableNodeTemplate;
 
     private int minOffset;
@@ -49,31 +50,35 @@
     }
 
+    public override IEnumerable<string> LocalParameterNames {
+      get {
+        return new string[] { WEIGHT, OFFSET, INDEX };
+      }
+    }
+
+    public override IFunctionTree GetTreeNode() {
+      return (IFunctionTree)variableNodeTemplate.Clone();
+    }
+
     public Variable()
       : base() {
-      AddVariableInfo(new VariableInfo(INDEX, "The variable name", typeof(StringData), VariableKind.None));
-      GetVariableInfo(INDEX).Local = true;
-      AddVariableInfo(new VariableInfo(WEIGHT, "Weight is multiplied to the feature value", typeof(DoubleData), VariableKind.None));
-      GetVariableInfo(WEIGHT).Local = true;
-      AddVariableInfo(new VariableInfo(OFFSET, "SampleOffset is added to the sample index", typeof(ConstrainedIntData), VariableKind.None));
-      GetVariableInfo(OFFSET).Local = true;
-      AddVariableInfo(new VariableInfo(INITIALIZATION, "Initialization operator for variables", typeof(CombinedOperator), VariableKind.None));
-      GetVariableInfo(INITIALIZATION).Local = false;
-      AddVariableInfo(new VariableInfo(MANIPULATION, "Manipulation operator for variables", typeof(CombinedOperator), VariableKind.None));
-      GetVariableInfo(MANIPULATION).Local = false;
+      //AddVariableInfo(new VariableInfo(INDEX, "The variable name", typeof(StringData), VariableKind.None));
+      //GetVariableInfo(INDEX).Local = true;
+      //AddVariableInfo(new VariableInfo(WEIGHT, "Weight is multiplied to the feature value", typeof(DoubleData), VariableKind.None));
+      //GetVariableInfo(WEIGHT).Local = true;
+      //AddVariableInfo(new VariableInfo(OFFSET, "SampleOffset is added to the sample index", typeof(ConstrainedIntData), VariableKind.None));
+      //GetVariableInfo(OFFSET).Local = true;
+      variableNodeTemplate = new BakedFunctionTree(this);
 
       DoubleData weight = new DoubleData();
-      AddVariable(new HeuristicLab.Core.Variable(WEIGHT, weight));
+      variableNodeTemplate.AddVariable(new HeuristicLab.Core.Variable(WEIGHT, weight));
 
       StringData variable = new StringData();
-      AddVariable(new HeuristicLab.Core.Variable(INDEX, variable));
+      variableNodeTemplate.AddVariable(new HeuristicLab.Core.Variable(INDEX, variable));
 
       ConstrainedIntData sampleOffset = new ConstrainedIntData();
-      AddVariable(new HeuristicLab.Core.Variable(OFFSET, sampleOffset));
+      variableNodeTemplate.AddVariable(new HeuristicLab.Core.Variable(OFFSET, sampleOffset));
 
       SetupInitialization();
       SetupManipulation();
-
-      // variable can't have suboperators
-      AddConstraint(new NumberOfSubOperatorsConstraint(0, 0));
     }
 
@@ -104,10 +109,5 @@
       seq.AddSubOperator(weightRandomizer);
       seq.AddSubOperator(offsetRandomizer);
-      HeuristicLab.Core.IVariable initOp = GetVariable(INITIALIZATION);
-      if(initOp == null) {
-        AddVariable(new HeuristicLab.Core.Variable(INITIALIZATION, combinedOp));
-      } else {
-        initOp.Value = combinedOp;
-      }
+      Initializer = combinedOp;
     }
 
@@ -139,14 +139,9 @@
       seq.AddSubOperator(weightRandomAdder);
       seq.AddSubOperator(offsetRandomAdder);
-      HeuristicLab.Core.IVariable manipulationOp = GetVariable(MANIPULATION);
-      if(manipulationOp == null) {
-        AddVariable(new HeuristicLab.Core.Variable(MANIPULATION, combinedOp));
-      } else {
-        manipulationOp.Value = combinedOp;
-      }
+      Manipulator = combinedOp;
     }
 
     public void SetConstraints(int minSampleOffset, int maxSampleOffset) {
-      ConstrainedIntData offset = GetVariableValue<ConstrainedIntData>(OFFSET, null, false);
+      ConstrainedIntData offset = (ConstrainedIntData)variableNodeTemplate.GetLocalVariable(OFFSET).Value;
       IntBoundedConstraint offsetConstraint = new IntBoundedConstraint();
       this.minOffset = minSampleOffset;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Xor.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Xor.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Xor.cs	(revision 2202)
@@ -28,5 +28,5 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public sealed class Xor : FunctionBase {
+  public sealed class Xor : BinaryFunction {
     public override string Description {
       get {
@@ -37,7 +37,4 @@
     public Xor()
       : base() {
-      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
-      AddConstraint(new SubOperatorTypeConstraint(0));
-      AddConstraint(new SubOperatorTypeConstraint(1));
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BakedFunctionTree.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/BakedFunctionTree.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BakedFunctionTree.cs	(revision 2202)
@@ -34,5 +34,5 @@
     public byte arity = 0;
     public IFunction functionType;
-    public List<object> localData = new List<object>();
+    public List<IVariable> localData = new List<IVariable>();
 
     public LightWeightFunction Clone() {
@@ -40,5 +40,5 @@
       clone.arity = arity;
       clone.functionType = functionType;
-      clone.localData.AddRange(localData);
+      clone.localData = localData.Select(v=>(IVariable)v.Clone()).ToList();
       return clone;
     }
@@ -57,5 +57,13 @@
     private List<IFunctionTree> subTrees;
     private bool variablesExpanded = false;
-    private List<IVariable> variables;
+    private List<IVariable> variables = new List<IVariable>();
+
+    public IOperator Initializer {
+      get { return Function.Initializer; }
+    }
+
+    public IOperator Manipulator {
+      get { return Function.Manipulator; }
+    }
 
     public BakedFunctionTree() {
@@ -63,5 +71,5 @@
     }
 
-    internal BakedFunctionTree(IFunction function)
+    public BakedFunctionTree(IFunction function)
       : this() {
       LightWeightFunction fun = new LightWeightFunction();
@@ -72,24 +80,19 @@
       variables = new List<IVariable>();
       variablesExpanded = true;
-      foreach (IVariableInfo variableInfo in function.VariableInfos) {
-        if (variableInfo.Local) {
-          variables.Add((IVariable)function.GetVariable(variableInfo.FormalName).Clone());
-        }
-      }
-    }
-
-    internal BakedFunctionTree(IFunctionTree tree)
-      : this() {
-      LightWeightFunction fun = new LightWeightFunction();
-      fun.functionType = tree.Function;
-      linearRepresentation.Add(fun);
-      foreach (IVariable variable in tree.LocalVariables) {
-        IObjectData value = (IObjectData)variable.Value;
-        fun.localData.Add(value.Data);
-      }
-      foreach (IFunctionTree subTree in tree.SubTrees) {
-        AddSubTree(new BakedFunctionTree(subTree));
-      }
-    }
+    }
+
+    //internal BakedFunctionTree(IFunctionTree tree)
+    //  : this() {
+    //  LightWeightFunction fun = new LightWeightFunction();
+    //  fun.functionType = tree.Function;
+    //  linearRepresentation.Add(fun);
+    //  foreach (IVariable variable in tree.LocalVariables) {
+    //    IObjectData value = (IObjectData)variable.Value;
+    //    fun.localData.Add(value.Data);
+    //  }
+    //  foreach (IFunctionTree subTree in tree.SubTrees) {
+    //    AddSubTree(new BakedFunctionTree(subTree));
+    //  }
+    //}
 
     private int BranchLength(int branchRoot) {
@@ -119,7 +122,8 @@
         linearRepresentation[0].localData.Clear();
         foreach (IVariable variable in variables) {
-          object objData = variable.Value;
-          while (objData is IObjectData) objData = ((IObjectData)objData).Data;
-          linearRepresentation[0].localData.Add(objData);
+          //object objData = variable.Value;
+          //while (objData is IObjectData) objData = ((IObjectData)objData).Data;
+          //linearRepresentation[0].localData[variable.Name] = objData;
+          linearRepresentation[0].localData.Add(variable);
         }
         variablesExpanded = false;
@@ -197,20 +201,17 @@
         if (!variablesExpanded) {
           variables = new List<IVariable>();
-          IFunction function = Function;
-          int localVariableIndex = 0;
-          foreach (IVariableInfo variableInfo in function.VariableInfos) {
-            if (variableInfo.Local) {
-              IVariable clone = (IVariable)function.GetVariable(variableInfo.FormalName).Clone();
-              IObjectData objData = (IObjectData)clone.Value;
-              if (objData is ConstrainedDoubleData) {
-                ((ConstrainedDoubleData)objData).Data = (double)linearRepresentation[0].localData[localVariableIndex];
-              } else if (objData is ConstrainedIntData) {
-                ((ConstrainedIntData)objData).Data = (int)linearRepresentation[0].localData[localVariableIndex];
-              } else {
-                objData.Data = linearRepresentation[0].localData[localVariableIndex];
-              }
-              variables.Add(clone);
-              localVariableIndex++;
-            }
+          IFunction function = Function;          
+          //int localVariableIndex = 0;
+          foreach (IVariable v in linearRepresentation[0].localData) {
+            //IObjectData objData = (IObjectData)clone.Value;
+            //if (objData is ConstrainedDoubleData) {
+            //  ((ConstrainedDoubleData)objData).Data = (double)linearRepresentation[0].localData[localVariableIndex];
+            //} else if (objData is ConstrainedIntData) {
+            //  ((ConstrainedIntData)objData).Data = (int)linearRepresentation[0].localData[localVariableIndex];
+            //} else {
+            //  objData.Data = linearRepresentation[0].localData[localVariableIndex];
+            //}
+            variables.Add(v);
+            //localVariableIndex++;
           }
           variablesExpanded = true;
@@ -233,9 +234,12 @@
 
     public void AddVariable(IVariable variable) {
-      throw new NotSupportedException();
+      if (!variablesExpanded) throw new InvalidOperationException();
+      if (!variables.Exists(v => v.Name == variable.Name))
+        variables.Add(variable);
     }
 
     public void RemoveVariable(string name) {
-      throw new NotSupportedException();
+      if (!variablesExpanded) throw new InvalidOperationException();
+      variables.RemoveAll(v => v.Name == name);
     }
 
@@ -256,25 +260,25 @@
     }
 
-    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
-      FlattenVariables();
-      FlattenTrees();
-      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
-      XmlNode linearRepresentationNode = document.CreateElement("LinearRepresentation");
-      foreach (LightWeightFunction f in linearRepresentation) {
-        XmlNode entryNode = PersistenceManager.Persist("Function", f.functionType, document, persistedObjects);
-        XmlAttribute arityAttribute = document.CreateAttribute("Arity");
-        arityAttribute.Value = XmlConvert.ToString(f.arity);
-        entryNode.Attributes.Append(arityAttribute);
-        foreach (object o in f.localData) {
-          if (f.localData.Count > 0) {
-            entryNode.AppendChild(CreateDataNode(document, o));
-          }
-        }
-        linearRepresentationNode.AppendChild(entryNode);
-      }
-
-      node.AppendChild(linearRepresentationNode);
-      return node;
-    }
+    //public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
+    //  FlattenVariables();
+    //  FlattenTrees();
+    //  XmlNode node = base.GetXmlNode(name, document, persistedObjects);
+    //  XmlNode linearRepresentationNode = document.CreateElement("LinearRepresentation");
+    //  foreach (LightWeightFunction f in linearRepresentation) {
+    //    XmlNode entryNode = PersistenceManager.Persist("Function", f.functionType, document, persistedObjects);
+    //    XmlAttribute arityAttribute = document.CreateAttribute("Arity");
+    //    arityAttribute.Value = XmlConvert.ToString(f.arity);
+    //    entryNode.Attributes.Append(arityAttribute);
+    //    foreach (object o in f.localData) {
+    //      if (f.localData.Count > 0) {
+    //        entryNode.AppendChild(CreateDataNode(document, o));
+    //      }
+    //    }
+    //    linearRepresentationNode.AppendChild(entryNode);
+    //  }
+
+    //  node.AppendChild(linearRepresentationNode);
+    //  return node;
+    //}
 
     private XmlNode CreateDataNode(XmlDocument doc, object o) {
@@ -295,19 +299,19 @@
     }
 
-    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
-      base.Populate(node, restoredObjects);
-      XmlNode linearRepresentationNode = node.SelectSingleNode("LinearRepresentation");
-      foreach (XmlNode entryNode in linearRepresentationNode.ChildNodes) {
-        LightWeightFunction f = new LightWeightFunction();
-        f.arity = XmlConvert.ToByte(entryNode.Attributes["Arity"].Value);
-        foreach (XmlNode dataNode in entryNode.ChildNodes) {
-          f.localData.Add(ParseDataNode(dataNode));
-        }
-        f.functionType = (IFunction)PersistenceManager.Restore(entryNode, restoredObjects);
-        linearRepresentation.Add(f);
-      }
-      treesExpanded = false;
-      variablesExpanded = false;
-    }
+    //public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
+    //  base.Populate(node, restoredObjects);
+    //  XmlNode linearRepresentationNode = node.SelectSingleNode("LinearRepresentation");
+    //  foreach (XmlNode entryNode in linearRepresentationNode.ChildNodes) {
+    //    LightWeightFunction f = new LightWeightFunction();
+    //    f.arity = XmlConvert.ToByte(entryNode.Attributes["Arity"].Value);
+    //    foreach (XmlNode dataNode in entryNode.ChildNodes) {
+    //      f.localData.Add(ParseDataNode(dataNode));
+    //    }
+    //    f.functionType = (IFunction)PersistenceManager.Restore(entryNode, restoredObjects);
+    //    linearRepresentation.Add(f);
+    //  }
+    //  treesExpanded = false;
+    //  variablesExpanded = false;
+    //}
 
     private object ParseDataNode(XmlNode dataNode) {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunView.Designer.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunView.Designer.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunView.Designer.cs	(revision 2202)
@@ -0,0 +1,32 @@
+﻿namespace HeuristicLab.GP {
+  partial class FunView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+    }
+
+    #endregion
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunView.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunView.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunView.cs	(revision 2202)
@@ -0,0 +1,26 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.GP {
+  public partial class FunView : ViewBase {
+    public IFunction Function {
+      get { return (IFunction)base.Item; }
+      set { base.Item = value; }
+    }
+
+    public FunView(IFunction function) : base() {      
+      InitializeComponent();
+    }
+
+    protected override void UpdateControls() {
+      base.UpdateControls();
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/FunctionBase.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionBase.cs	(revision 2202)
@@ -30,17 +30,78 @@
 
 namespace HeuristicLab.GP {
-  /// <summary>
-  /// Functions are like operators except that they do not allow sub-operators and the normal form of evaluation
-  /// is to evaluate all children first.
-  /// </summary>
-  public abstract class FunctionBase : OperatorBase, IFunction {
-    public const string INITIALIZATION = "Initialization";
-    public const string MANIPULATION = "Manipulation";
-    private List<IFunction>[] allowedSubFunctions;
+  public abstract class FunctionBase : ItemBase, IFunction {
+    private List<List<IFunction>> allowedSubFunctions = new List<List<IFunction>>();
     private int minArity = -1;
     private int maxArity = -1;
-
-    public virtual double Apply() {
-      throw new NotImplementedException();
+    private double tickets = 1.0;
+    private IOperator initializer;
+    private IOperator manipulator;
+    private int minTreeHeight = -1;
+    private int minTreeSize = -1;
+
+    public virtual string Name {
+      get { return this.GetType().Name; }
+    }
+
+    public virtual string Description {
+      get { return "Description for this function is missing (TODO)"; }
+    }
+
+    public int MinArity {
+      get {
+        return minArity;
+      }
+      protected set {
+        minArity = value;
+        while (minArity > allowedSubFunctions.Count) allowedSubFunctions.Add(new List<IFunction>());
+      }
+    }
+
+    public int MaxArity {
+      get {
+        return maxArity;
+      }
+      protected set {
+        maxArity = value;
+        while (allowedSubFunctions.Count > maxArity) allowedSubFunctions.RemoveAt(allowedSubFunctions.Count - 1);
+        while (maxArity > allowedSubFunctions.Count) allowedSubFunctions.Add(new List<IFunction>());
+      }
+    }
+
+
+    public int MinTreeSize {
+      get {
+        if (minTreeSize <= 0) RecalculateMinimalTreeSize();
+        return minTreeSize;
+      }
+    }
+
+    public int MinTreeHeight {
+      get {
+        if (minTreeHeight <= 0) RecalculateMinimalTreeHeight();
+        return minTreeHeight;
+      }
+    }
+
+    public double Tickets {
+      get { return tickets; }
+      set {
+        if (value < 0.0) throw new ArgumentException("Number of tickets must be positive");
+        else tickets = value;
+      }
+    }
+
+    public IOperator Initializer {
+      get { return initializer; }
+      set { initializer = value; }
+    }
+
+    public IOperator Manipulator {
+      get { return manipulator; }
+      set { manipulator = value; }
+    }
+
+    public virtual IEnumerable<string> LocalParameterNames {
+      get { return new string[0]; }
     }
 
@@ -49,108 +110,104 @@
     }
 
-    public int MinArity {
-      get {
-        if(minArity < 0) RefreshArity();
-        return minArity;
-      }
-    }
-
-    public int MaxArity {
-      get {
-        if(maxArity < 0) RefreshArity();
-        return maxArity;
-      }
-    }
-
-    private void RefreshArity() {
-      minArity = 2; maxArity = 2; // default arity is 2
-      foreach(IConstraint constraint in Constraints) {
-        NumberOfSubOperatorsConstraint theConstraint = constraint as NumberOfSubOperatorsConstraint;
-        if(theConstraint != null) {
-          minArity = theConstraint.MinOperators.Data;
-          maxArity = theConstraint.MaxOperators.Data;
+
+    //private List<IConstraint> constraints = new List<IConstraint>();
+    //public ICollection<IConstraint> Constraints {
+    //  get { return constraints; }
+    //}
+
+    //private void RefreshArity() {
+    //  minArity = 2; maxArity = 2; // default arity is 2
+    //  foreach (IConstraint constraint in Constraints) {
+    //    NumberOfSubOperatorsConstraint theConstraint = constraint as NumberOfSubOperatorsConstraint;
+    //    if (theConstraint != null) {
+    //      minArity = theConstraint.MinOperators.Data;
+    //      maxArity = theConstraint.MaxOperators.Data;
+    //    }
+    //  }
+    //}
+
+    public ICollection<IFunction> GetAllowedSubFunctions(int index) {
+      if (index < 0 || index > MaxArity) throw new ArgumentException("Index outside of allowed range. index = " + index);
+      //if (allowedSubFunctions == null) {
+      //  // first time: analyze the constraint and create a cached copy of the allowed sub-functions
+      //  allowedSubFunctions = new List<IFunction>[MaxArity];
+      //  for (int i = 0; i < MaxArity; i++) {
+      //    allowedSubFunctions[i] = GetAllowedSubFunctions(i);
+      //  }
+      //}
+      return allowedSubFunctions[index];
+    }
+
+    public void AddAllowedSubFunction(IFunction function, int index) {
+      if (index < 0 || index > MaxArity) throw new ArgumentException("Index outside of allowed range. index = " + index);
+      if (allowedSubFunctions[index] == null) {
+        allowedSubFunctions[index] = new List<IFunction>();
+      }
+      if (!allowedSubFunctions[index].Contains(function)) {
+        allowedSubFunctions[index].Add(function);
+      }
+    }
+
+    public void RemoveAllowedSubFunction(IFunction function, int index) {
+      if (index < 0 || index > MaxArity) throw new ArgumentException("Index outside of allowed range. index = " + index);
+      allowedSubFunctions[index].Add(function);
+    }
+
+    public bool IsAllowedSubFunction(IFunction function, int index) {
+      return GetAllowedSubFunctions(index).Contains(function);
+    }
+
+    //private List<IFunction> GetAllowedSubFunctions(int index) {
+    //  List<IFunction> allowedSubFunctions = new List<IFunction>();
+    //  foreach (IConstraint constraint in Constraints) {
+    //    if (constraint is SubOperatorTypeConstraint) {
+    //      SubOperatorTypeConstraint subOpConstraint = constraint as SubOperatorTypeConstraint;
+    //      if (subOpConstraint.SubOperatorIndex.Data == index) {
+    //        foreach (IFunction f in subOpConstraint.AllowedSubOperators) allowedSubFunctions.Add(f);
+    //        subOpConstraint.Changed += new EventHandler(subOpConstraint_Changed); // register an event-handler to invalidate the cache on constraint changes
+    //        return allowedSubFunctions;
+    //      }
+    //    } else if (constraint is AllSubOperatorsTypeConstraint) {
+    //      AllSubOperatorsTypeConstraint subOpConstraint = constraint as AllSubOperatorsTypeConstraint;
+    //      foreach (IFunction f in subOpConstraint.AllowedSubOperators) allowedSubFunctions.Add(f);
+    //      subOpConstraint.Changed += new EventHandler(subOpConstraint_Changed); // register an event-handler to invalidate the cache on constraint changes
+    //      return allowedSubFunctions;
+    //    }
+    //  }
+    //  return allowedSubFunctions;
+    //}
+
+    //private void subOpConstraint_Changed(object sender, EventArgs e) {
+    //  allowedSubFunctions = null;
+    //}
+
+    public override IView CreateView() {
+      return new FunView(this);
+    }
+
+    private void RecalculateMinimalTreeSize() {
+      minTreeSize = int.MaxValue;
+      int sum = 1;
+      int minSize = int.MaxValue;
+      for (int i = 0; i < MinArity; i++) {
+        foreach (IFunction subFun in GetAllowedSubFunctions(i)) {
+          minSize = Math.Min(minSize, subFun.MinTreeSize);
         }
-      }
-    }
-
-    public IList<IFunction> AllowedSubFunctions(int index) {
-      if(allowedSubFunctions == null) {
-        // first time: analyze the constraint and create a cached copy of the allowed sub-functions
-        allowedSubFunctions = new List<IFunction>[MaxArity];
-        for(int i = 0; i < MaxArity; i++) {
-          allowedSubFunctions[i] = GetAllowedSubFunctions(i);
+        sum += minSize;
+      }
+      minTreeSize = sum;
+    }
+
+    private void RecalculateMinimalTreeHeight() {
+      minTreeHeight = int.MaxValue;
+      int height = 0;
+      int minHeight = int.MaxValue;
+      for (int i = 0; i < MinArity; i++) {
+        foreach (IFunction subFun in GetAllowedSubFunctions(i)) {
+          minHeight = Math.Min(minHeight, subFun.MinTreeHeight);
         }
-      }
-      return allowedSubFunctions[index];
-    }
-
-    private List<IFunction> GetAllowedSubFunctions(int index) {
-      List<IFunction> allowedSubFunctions = new List<IFunction>();
-      foreach(IConstraint constraint in Constraints) {
-        if(constraint is SubOperatorTypeConstraint) {
-          SubOperatorTypeConstraint subOpConstraint = constraint as SubOperatorTypeConstraint;
-          if(subOpConstraint.SubOperatorIndex.Data == index) {
-            foreach(IFunction f in subOpConstraint.AllowedSubOperators) allowedSubFunctions.Add(f);
-            subOpConstraint.Changed += new EventHandler(subOpConstraint_Changed); // register an event-handler to invalidate the cache on constraing changes
-            return allowedSubFunctions;
-          }
-        } else if(constraint is AllSubOperatorsTypeConstraint) {
-          AllSubOperatorsTypeConstraint subOpConstraint = constraint as AllSubOperatorsTypeConstraint;
-          foreach(IFunction f in subOpConstraint.AllowedSubOperators) allowedSubFunctions.Add(f);
-          subOpConstraint.Changed += new EventHandler(subOpConstraint_Changed); // register an event-handler to invalidate the cache on constraint changes
-          return allowedSubFunctions;
-        }
-      }
-      return allowedSubFunctions;
-    }
-
-    private void subOpConstraint_Changed(object sender, EventArgs e) {
-      allowedSubFunctions = null;
-    }
-
-    // operator-tree style evaluation is not supported for functions.
-    public override IOperation Apply(IScope scope) {
-      throw new NotSupportedException();
-    }
-
-    private static readonly List<IOperator> emptySubOperatorList = new List<IOperator>();
-    public override IList<IOperator> SubOperators {
-      get { return emptySubOperatorList; }
-    }
-
-    public override void AddSubOperator(IOperator subOperator) {
-      throw new NotSupportedException();
-    }
-
-    public override bool TryAddSubOperator(IOperator subOperator) {
-      throw new NotSupportedException();
-    }
-
-    public override bool TryAddSubOperator(IOperator subOperator, int index) {
-      throw new NotSupportedException();
-    }
-
-    public override bool TryAddSubOperator(IOperator subOperator, int index, out ICollection<IConstraint> violatedConstraints) {
-      throw new NotSupportedException();
-    }
-
-    public override bool TryAddSubOperator(IOperator subOperator, out ICollection<IConstraint> violatedConstraints) {
-      throw new NotSupportedException();
-    }
-
-    public override void AddSubOperator(IOperator subOperator, int index) {
-      throw new NotSupportedException();
-    }
-
-    public override void RemoveSubOperator(int index) {
-      throw new NotSupportedException();
-    }
-
-    public override bool TryRemoveSubOperator(int index) {
-      throw new NotSupportedException();
-    }
-
-    public override bool TryRemoveSubOperator(int index, out ICollection<IConstraint> violatedConstraints) {
-      throw new NotSupportedException();
+        height = Math.Max(height, minHeight);
+      }
+      minTreeHeight = height + 1;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionGroup.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionGroup.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionGroup.cs	(revision 2202)
@@ -0,0 +1,34 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Data;
+using HeuristicLab.Random;
+using HeuristicLab.Constraints;
+
+namespace HeuristicLab.GP {
+  public class FunctionGroup : StorableBase {
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibrary.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibrary.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibrary.cs	(revision 2202)
@@ -0,0 +1,104 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Data;
+using HeuristicLab.Constraints;
+
+namespace HeuristicLab.GP {
+  public class FunctionLibrary : ItemBase, IEditable {
+    private List<IFunction> functions = new List<IFunction>();
+    public IEnumerable<IFunction> Functions {
+      get { return functions; }
+    }
+
+    public FunctionLibrary()
+      : base() {
+    }
+
+
+    public void AddFunction(IFunction fun) {
+      if (!functions.Contains(fun)) functions.Add(fun);
+      // OnFunctionAdded(fun);
+    }
+
+    //void UpdateTreeBounds(object sender, EventArgs e) {
+    //  RecalculateMinimalTreeBounds();
+    //}
+
+
+    //private void GetMinMaxArity(IOperator op, out int minArity, out int maxArity) {
+    //  foreach (IConstraint constraint in op.Constraints) {
+    //    NumberOfSubOperatorsConstraint theConstraint = constraint as NumberOfSubOperatorsConstraint;
+    //    if (theConstraint != null) {
+    //      minArity = theConstraint.MinOperators.Data;
+    //      maxArity = theConstraint.MaxOperators.Data;
+    //      return;
+    //    }
+    //  }
+    //  // the default arity is 2
+    //  minArity = 2;
+    //  maxArity = 2;
+    //}
+
+    public void RemoveFunction(IFunction fun) {
+      functions.Remove(fun);
+
+      // remove the operator from the allowed sub-functions of the remaining operators
+      foreach (IFunction f in Functions) {
+        if (f != fun) {
+        }
+      }
+      // OnFunctionRemoved(fun);
+    }
+
+    //public event EventHandler FunctionAdded;
+    //public event EventHandler FunctionRemoved;
+
+    //protected virtual void OnFunctionAdded(IFunction fun) {
+    //  if (FunctionAdded != null) {
+    //    FunctionAdded(this, new EventArgs(fun));
+    //  }
+    //}
+    //protected virtual void OnFunctionRemoved(IFunction fun) {
+    //  if (FunctionRemoved != null) {
+    //    FunctionRemoved(this, new EventArgs(fun));
+    //  }
+    //}
+
+    public override IView CreateView() {
+      return new FunctionLibraryEditor(this);
+    }
+
+    #region IEditable Members
+
+    public IEditor CreateEditor() {
+      return new FunctionLibraryEditor(this);
+    }
+
+    #endregion
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.Designer.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.Designer.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.Designer.cs	(revision 2202)
@@ -0,0 +1,238 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+namespace HeuristicLab.GP {
+  partial class FunctionLibraryEditor {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if(disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.operatorLibraryEditor = new HeuristicLab.Core.OperatorLibraryEditor();
+      this.tabControl = new System.Windows.Forms.TabControl();
+      this.operatorLibraryTabPage = new System.Windows.Forms.TabPage();
+      this.initializationTabPage = new System.Windows.Forms.TabPage();
+      this.initSplitContainer = new System.Windows.Forms.SplitContainer();
+      this.initListView = new System.Windows.Forms.ListView();
+      this.initVariableView = new HeuristicLab.Core.VariableView();
+      this.mutationTabPage = new System.Windows.Forms.TabPage();
+      this.mutationSplitContainer = new System.Windows.Forms.SplitContainer();
+      this.mutationListView = new System.Windows.Forms.ListView();
+      this.mutationVariableView = new HeuristicLab.Core.VariableView();
+      this.tabControl.SuspendLayout();
+      this.operatorLibraryTabPage.SuspendLayout();
+      this.initializationTabPage.SuspendLayout();
+      this.initSplitContainer.Panel1.SuspendLayout();
+      this.initSplitContainer.Panel2.SuspendLayout();
+      this.initSplitContainer.SuspendLayout();
+      this.mutationTabPage.SuspendLayout();
+      this.mutationSplitContainer.Panel1.SuspendLayout();
+      this.mutationSplitContainer.Panel2.SuspendLayout();
+      this.mutationSplitContainer.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // operatorLibraryEditor
+      // 
+      this.operatorLibraryEditor.Caption = "Operator Library";
+      this.operatorLibraryEditor.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.operatorLibraryEditor.Filename = null;
+      this.operatorLibraryEditor.Location = new System.Drawing.Point(3, 3);
+      this.operatorLibraryEditor.Name = "operatorLibraryEditor";
+      this.operatorLibraryEditor.OperatorLibrary = null;
+      this.operatorLibraryEditor.Size = new System.Drawing.Size(663, 529);
+      this.operatorLibraryEditor.TabIndex = 0;
+      // 
+      // tabControl
+      // 
+      this.tabControl.Controls.Add(this.operatorLibraryTabPage);
+      this.tabControl.Controls.Add(this.initializationTabPage);
+      this.tabControl.Controls.Add(this.mutationTabPage);
+      this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.tabControl.Location = new System.Drawing.Point(0, 0);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(677, 561);
+      this.tabControl.TabIndex = 1;
+      // 
+      // operatorLibraryTabPage
+      // 
+      this.operatorLibraryTabPage.Controls.Add(this.operatorLibraryEditor);
+      this.operatorLibraryTabPage.Location = new System.Drawing.Point(4, 22);
+      this.operatorLibraryTabPage.Name = "operatorLibraryTabPage";
+      this.operatorLibraryTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.operatorLibraryTabPage.Size = new System.Drawing.Size(669, 535);
+      this.operatorLibraryTabPage.TabIndex = 0;
+      this.operatorLibraryTabPage.Text = "Operator Library";
+      this.operatorLibraryTabPage.UseVisualStyleBackColor = true;
+      // 
+      // initializationTabPage
+      // 
+      this.initializationTabPage.Controls.Add(this.initSplitContainer);
+      this.initializationTabPage.Location = new System.Drawing.Point(4, 22);
+      this.initializationTabPage.Name = "initializationTabPage";
+      this.initializationTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.initializationTabPage.Size = new System.Drawing.Size(669, 535);
+      this.initializationTabPage.TabIndex = 1;
+      this.initializationTabPage.Text = "Initialization";
+      this.initializationTabPage.UseVisualStyleBackColor = true;
+      // 
+      // initSplitContainer
+      // 
+      this.initSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.initSplitContainer.Location = new System.Drawing.Point(3, 3);
+      this.initSplitContainer.Name = "initSplitContainer";
+      // 
+      // initSplitContainer.Panel1
+      // 
+      this.initSplitContainer.Panel1.Controls.Add(this.initListView);
+      // 
+      // initSplitContainer.Panel2
+      // 
+      this.initSplitContainer.Panel2.Controls.Add(this.initVariableView);
+      this.initSplitContainer.Size = new System.Drawing.Size(663, 529);
+      this.initSplitContainer.SplitterDistance = 221;
+      this.initSplitContainer.TabIndex = 0;
+      // 
+      // initListView
+      // 
+      this.initListView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.initListView.Location = new System.Drawing.Point(0, 0);
+      this.initListView.Name = "initListView";
+      this.initListView.Size = new System.Drawing.Size(221, 529);
+      this.initListView.TabIndex = 0;
+      this.initListView.UseCompatibleStateImageBehavior = false;
+      this.initListView.View = System.Windows.Forms.View.List;
+      this.initListView.SelectedIndexChanged += new System.EventHandler(this.initListView_SelectedIndexChanged);
+      // 
+      // initVariableView
+      // 
+      this.initVariableView.Caption = "Variable";
+      this.initVariableView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.initVariableView.Location = new System.Drawing.Point(0, 0);
+      this.initVariableView.Name = "initVariableView";
+      this.initVariableView.Size = new System.Drawing.Size(438, 529);
+      this.initVariableView.TabIndex = 0;
+      this.initVariableView.Variable = null;
+      // 
+      // mutationTabPage
+      // 
+      this.mutationTabPage.Controls.Add(this.mutationSplitContainer);
+      this.mutationTabPage.Location = new System.Drawing.Point(4, 22);
+      this.mutationTabPage.Name = "mutationTabPage";
+      this.mutationTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.mutationTabPage.Size = new System.Drawing.Size(669, 535);
+      this.mutationTabPage.TabIndex = 2;
+      this.mutationTabPage.Text = "Mutation";
+      this.mutationTabPage.UseVisualStyleBackColor = true;
+      // 
+      // mutationSplitContainer
+      // 
+      this.mutationSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.mutationSplitContainer.Location = new System.Drawing.Point(3, 3);
+      this.mutationSplitContainer.Name = "mutationSplitContainer";
+      // 
+      // mutationSplitContainer.Panel1
+      // 
+      this.mutationSplitContainer.Panel1.Controls.Add(this.mutationListView);
+      // 
+      // mutationSplitContainer.Panel2
+      // 
+      this.mutationSplitContainer.Panel2.Controls.Add(this.mutationVariableView);
+      this.mutationSplitContainer.Size = new System.Drawing.Size(663, 529);
+      this.mutationSplitContainer.SplitterDistance = 221;
+      this.mutationSplitContainer.TabIndex = 0;
+      // 
+      // mutationListView
+      // 
+      this.mutationListView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.mutationListView.Location = new System.Drawing.Point(0, 0);
+      this.mutationListView.MultiSelect = false;
+      this.mutationListView.Name = "mutationListView";
+      this.mutationListView.Size = new System.Drawing.Size(221, 529);
+      this.mutationListView.TabIndex = 0;
+      this.mutationListView.UseCompatibleStateImageBehavior = false;
+      this.mutationListView.View = System.Windows.Forms.View.List;
+      this.mutationListView.SelectedIndexChanged += new System.EventHandler(this.mutationListView_SelectedIndexChanged);
+      // 
+      // mutationVariableView
+      // 
+      this.mutationVariableView.Caption = "Variable";
+      this.mutationVariableView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.mutationVariableView.Location = new System.Drawing.Point(0, 0);
+      this.mutationVariableView.Name = "mutationVariableView";
+      this.mutationVariableView.Size = new System.Drawing.Size(438, 529);
+      this.mutationVariableView.TabIndex = 0;
+      this.mutationVariableView.Variable = null;
+      // 
+      // GPOperatorLibraryEditor
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.tabControl);
+      this.Name = "GPOperatorLibraryEditor";
+      this.Size = new System.Drawing.Size(677, 561);
+      this.tabControl.ResumeLayout(false);
+      this.operatorLibraryTabPage.ResumeLayout(false);
+      this.initializationTabPage.ResumeLayout(false);
+      this.initSplitContainer.Panel1.ResumeLayout(false);
+      this.initSplitContainer.Panel2.ResumeLayout(false);
+      this.initSplitContainer.ResumeLayout(false);
+      this.mutationTabPage.ResumeLayout(false);
+      this.mutationSplitContainer.Panel1.ResumeLayout(false);
+      this.mutationSplitContainer.Panel2.ResumeLayout(false);
+      this.mutationSplitContainer.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Core.OperatorLibraryEditor operatorLibraryEditor;
+    private System.Windows.Forms.TabControl tabControl;
+    private System.Windows.Forms.TabPage operatorLibraryTabPage;
+    private System.Windows.Forms.TabPage initializationTabPage;
+    private System.Windows.Forms.TabPage mutationTabPage;
+    private System.Windows.Forms.SplitContainer initSplitContainer;
+    private System.Windows.Forms.SplitContainer mutationSplitContainer;
+    private HeuristicLab.Core.VariableView initVariableView;
+    private HeuristicLab.Core.VariableView mutationVariableView;
+    private System.Windows.Forms.ListView initListView;
+    private System.Windows.Forms.ListView mutationListView;
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.cs	(revision 2202)
@@ -0,0 +1,157 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+using System.Diagnostics;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.GP {
+  public partial class FunctionLibraryEditor : EditorBase {
+    public FunctionLibrary FunctionLibrary {
+      get { return (FunctionLibrary)Item; }
+      set { base.Item = value; }
+    }
+
+    public FunctionLibraryEditor(FunctionLibrary library)
+      : base() {
+      InitializeComponent();
+      FunctionLibrary = library;
+
+      mutationVariableView.Enabled = false;
+      initVariableView.Enabled = false;
+
+      foreach (IFunction fun in library.Functions) {
+        if (fun.Manipulator != null) {
+          ListViewItem item = new ListViewItem();
+          item.Text = fun.Name;
+          item.Name = fun.Name;
+          item.Tag = fun;
+          mutationListView.Items.Add(item);
+        }
+        if (fun.Initializer != null) {
+          ListViewItem item = new ListViewItem();
+          item.Name = fun.Name;
+          item.Text = fun.Name;
+          item.Tag = fun;
+          initListView.Items.Add(item);
+        }
+      }
+    }
+
+    protected override void AddItemEvents() {
+      base.AddItemEvents();
+      base.Item.Changed += (sender, args) => UpdateControls();
+    }
+
+    protected override void UpdateControls() {
+      base.UpdateControls();
+    }
+
+    //private void GPOperatorLibraryView_OperatorAdded(object sender, EventArgs e) {
+    //  IOperator op = ((OperatorEventArgs)e).op;
+    //  if(op.GetVariable(FunctionBase.MANIPULATION) != null) {
+    //    ListViewItem operatorMutationItem = new ListViewItem();
+    //    operatorMutationItem.Name = op.Name;
+    //    operatorMutationItem.Text = op.Name;
+    //    operatorMutationItem.Tag = op;
+    //    mutationListView.Items.Add(operatorMutationItem);
+    //  }
+
+    //  if(op.GetVariable(FunctionBase.INITIALIZATION) != null) {
+    //    ListViewItem operatorInitItem = new ListViewItem();
+    //    operatorInitItem.Name = op.Name;
+    //    operatorInitItem.Text = op.Name;
+    //    operatorInitItem.Tag = op;
+    //    initListView.Items.Add(operatorInitItem);
+    //  }
+
+    //  op.NameChanged += new EventHandler(op_NameChanged);
+    //  Refresh();
+    //}
+
+    //private void op_NameChanged(object sender, EventArgs e) {
+    //  IOperator srcOp = (IOperator)sender;
+    //  foreach(ListViewItem item in mutationListView.Items) {
+    //    if(item.Tag == srcOp) {
+    //      item.Name = srcOp.Name;
+    //      item.Text = srcOp.Name;
+    //      break;
+    //    }
+    //  }
+    //  foreach(ListViewItem item in initListView.Items) {
+    //    if(item.Tag == srcOp) {
+    //      item.Name = srcOp.Name;
+    //      item.Text = srcOp.Name;
+    //      break;
+    //    }
+    //  }
+    //}
+
+
+    //private void GPOperatorGroup_OperatorRemoved(object sender, EventArgs e) {
+    //  IOperator op = ((OperatorEventArgs)e).op;
+
+    //  foreach(ListViewItem item in mutationListView.Items) {
+    //    if(item.Tag == op) {
+    //      mutationListView.Items.Remove(item);
+    //      break;
+    //    }
+    //  }
+
+    //  foreach(ListViewItem item in initListView.Items) {
+    //    if(item.Tag == op) {
+    //      initListView.Items.Remove(item);
+    //      break;
+    //    }
+    //  }
+    //}
+
+    private void mutationListView_SelectedIndexChanged(object sender, EventArgs e) {
+      //if(mutationListView.SelectedItems.Count>0 && mutationListView.SelectedItems[0].Tag != null) {
+      //  IVariable variable = ((IFunction)mutationListView.SelectedItems[0].Tag).Manipulator;
+      //  mutationVariableView.Enabled = true;
+      //  mutationVariableView.Variable = variable;
+      //} else {
+      //  mutationVariableView.Enabled = false;
+      //}
+    }
+
+    private void initListView_SelectedIndexChanged(object sender, EventArgs e) {
+      //if(initListView.SelectedItems.Count>0 && initListView.SelectedItems[0].Tag != null) {
+      //  IVariable variable = ((IFunction)initListView.SelectedItems[0].Tag).Initializer;
+      //  initVariableView.Enabled = true;
+      //  initVariableView.Variable = variable;
+      //} else {
+      //  initVariableView.Enabled = false;
+      //}
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.resx
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.resx	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.resx	(revision 2202)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.Designer.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.Designer.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.Designer.cs	(revision 2202)
@@ -0,0 +1,198 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+namespace HeuristicLab.GP {
+  partial class FunctionTreeView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      if(selectedVariable != null) {
+        selectedVariable.Value.Changed -= new EventHandler(selectedVariable_ValueChanged);
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
+      this.funTreeView = new System.Windows.Forms.TreeView();
+      this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.variablesGroupBox = new System.Windows.Forms.GroupBox();
+      this.variablesSplitContainer = new System.Windows.Forms.SplitContainer();
+      this.variablesListBox = new System.Windows.Forms.ListBox();
+      this.label1 = new System.Windows.Forms.Label();
+      this.templateTextBox = new System.Windows.Forms.TextBox();
+      this.editButton = new System.Windows.Forms.Button();
+      this.treeNodeContextMenu = new System.Windows.Forms.ContextMenu();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.variablesGroupBox.SuspendLayout();
+      this.variablesSplitContainer.Panel1.SuspendLayout();
+      this.variablesSplitContainer.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // funTreeView
+      // 
+      this.funTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.funTreeView.HideSelection = false;
+      this.funTreeView.Location = new System.Drawing.Point(0, 0);
+      this.funTreeView.Name = "funTreeView";
+      this.funTreeView.Size = new System.Drawing.Size(182, 532);
+      this.funTreeView.TabIndex = 0;
+      this.funTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.funTreeView_MouseUp);
+      this.funTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.functionTreeView_AfterSelect);
+      // 
+      // splitContainer
+      // 
+      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer.Location = new System.Drawing.Point(0, 0);
+      this.splitContainer.Name = "splitContainer";
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.funTreeView);
+      // 
+      // splitContainer.Panel2
+      // 
+      this.splitContainer.Panel2.Controls.Add(this.variablesGroupBox);
+      this.splitContainer.Panel2.Controls.Add(this.label1);
+      this.splitContainer.Panel2.Controls.Add(this.templateTextBox);
+      this.splitContainer.Panel2.Controls.Add(this.editButton);
+      this.splitContainer.Size = new System.Drawing.Size(735, 532);
+      this.splitContainer.SplitterDistance = 182;
+      this.splitContainer.TabIndex = 1;
+      // 
+      // variablesGroupBox
+      // 
+      this.variablesGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.variablesGroupBox.Controls.Add(this.variablesSplitContainer);
+      this.variablesGroupBox.Location = new System.Drawing.Point(3, 31);
+      this.variablesGroupBox.Name = "variablesGroupBox";
+      this.variablesGroupBox.Size = new System.Drawing.Size(543, 498);
+      this.variablesGroupBox.TabIndex = 5;
+      this.variablesGroupBox.TabStop = false;
+      this.variablesGroupBox.Text = "Local variables";
+      // 
+      // variablesSplitContainer
+      // 
+      this.variablesSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.variablesSplitContainer.Location = new System.Drawing.Point(3, 16);
+      this.variablesSplitContainer.Name = "variablesSplitContainer";
+      // 
+      // variablesSplitContainer.Panel1
+      // 
+      this.variablesSplitContainer.Panel1.Controls.Add(this.variablesListBox);
+      this.variablesSplitContainer.Size = new System.Drawing.Size(537, 479);
+      this.variablesSplitContainer.SplitterDistance = 179;
+      this.variablesSplitContainer.TabIndex = 0;
+      // 
+      // variablesListBox
+      // 
+      this.variablesListBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.variablesListBox.FormattingEnabled = true;
+      this.variablesListBox.Location = new System.Drawing.Point(0, 0);
+      this.variablesListBox.Name = "variablesListBox";
+      this.variablesListBox.Size = new System.Drawing.Size(179, 472);
+      this.variablesListBox.TabIndex = 0;
+      this.variablesListBox.SelectedIndexChanged += new System.EventHandler(this.variablesListBox_SelectedIndexChanged);
+      // 
+      // label1
+      // 
+      this.label1.AutoSize = true;
+      this.label1.Location = new System.Drawing.Point(3, 10);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(96, 13);
+      this.label1.TabIndex = 3;
+      this.label1.Text = "Function definition:";
+      // 
+      // templateTextBox
+      // 
+      this.templateTextBox.Location = new System.Drawing.Point(105, 7);
+      this.templateTextBox.Name = "templateTextBox";
+      this.templateTextBox.ReadOnly = true;
+      this.templateTextBox.Size = new System.Drawing.Size(190, 20);
+      this.templateTextBox.TabIndex = 2;
+      // 
+      // editButton
+      // 
+      this.editButton.Enabled = false;
+      this.editButton.Location = new System.Drawing.Point(301, 5);
+      this.editButton.Name = "editButton";
+      this.editButton.Size = new System.Drawing.Size(49, 23);
+      this.editButton.TabIndex = 1;
+      this.editButton.Text = "Edit...";
+      this.editButton.UseVisualStyleBackColor = true;
+      this.editButton.Click += new System.EventHandler(this.editButton_Click);
+      // 
+      // treeNodeContextMenu
+      // 
+      this.treeNodeContextMenu.Name = "treeNodeContextMenu";
+      // 
+      // FunctionTreeView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.splitContainer);
+      this.Name = "FunctionTreeView";
+      this.Size = new System.Drawing.Size(735, 532);
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      this.splitContainer.Panel2.PerformLayout();
+      this.splitContainer.ResumeLayout(false);
+      this.variablesGroupBox.ResumeLayout(false);
+      this.variablesSplitContainer.Panel1.ResumeLayout(false);
+      this.variablesSplitContainer.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.TreeView funTreeView;
+    private System.Windows.Forms.SplitContainer splitContainer;
+    private System.Windows.Forms.TextBox templateTextBox;
+    private System.Windows.Forms.Button editButton;
+    private System.Windows.Forms.GroupBox variablesGroupBox;
+    private System.Windows.Forms.SplitContainer variablesSplitContainer;
+    private System.Windows.Forms.ListBox variablesListBox;
+    private System.Windows.Forms.Label label1;
+    private System.Windows.Forms.ContextMenu treeNodeContextMenu;
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.cs	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.cs	(revision 2202)
@@ -0,0 +1,188 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.GP {
+  public partial class FunctionTreeView : ViewBase {
+    private IFunctionTree functionTree;
+
+    private IFunctionTree selectedBranch;
+    private IVariable selectedVariable;
+    private IFunctionTreeNameGenerator nameGenerator;
+    private IFunctionTreeNameGenerator[] allNameGenerators;
+    private MenuItem representationsMenu;
+
+    public FunctionTreeView() {
+      nameGenerator = new DefaultFunctionTreeNameGenerator();
+      InitializeComponent();
+
+      DiscoveryService discoveryService = new DiscoveryService();
+      allNameGenerators = discoveryService.GetInstances<IFunctionTreeNameGenerator>();
+      representationsMenu = new MenuItem();
+      representationsMenu.Text = "Tree representation";
+      representationsMenu.Name = "Tree representation";
+      foreach (IFunctionTreeNameGenerator generator in allNameGenerators) {
+        MenuItem mi = new MenuItem(generator.Name, MakeNameGeneratorDelegate(generator), Shortcut.None);
+        if (generator is DefaultFunctionTreeNameGenerator) mi.Checked = true;
+        else mi.Checked = false;
+        mi.Tag = generator;
+        representationsMenu.MenuItems.Add(mi);
+      }
+    }
+
+    public FunctionTreeView(IFunctionTree functionTree)
+      : this() {
+      this.functionTree = functionTree;
+      Refresh();
+    }
+
+    protected override void UpdateControls() {
+      funTreeView.Nodes.Clear();
+      TreeNode rootNode = new TreeNode();
+      rootNode.Name = functionTree.Function.Name;
+      rootNode.Text = nameGenerator.GetName(functionTree);
+      rootNode.Tag = functionTree;
+      treeNodeContextMenu.MenuItems.Clear();
+      treeNodeContextMenu.MenuItems.Add(representationsMenu);
+      DiscoveryService discoveryService = new DiscoveryService();
+      IFunctionTreeExporter[] exporters = discoveryService.GetInstances<IFunctionTreeExporter>();
+      foreach (IFunctionTreeExporter exporter in exporters) {
+        string result;
+        // register a menu item for the exporter
+        MenuItem item = new MenuItem("Copy to clip-board (" + exporter.Name + ")",
+          MakeExporterDelegate(exporter), Shortcut.None);
+        // try to export the whole tree 
+        if (exporter.TryExport(functionTree, out result)) {
+          // if it worked enable the context-menu item
+          item.Enabled = true;
+        } else {
+          item.Enabled = false;
+        }
+        treeNodeContextMenu.MenuItems.Add(item);
+      }
+      rootNode.ContextMenu = treeNodeContextMenu;
+      funTreeView.Nodes.Add(rootNode);
+
+      foreach (IFunctionTree subTree in functionTree.SubTrees) {
+        CreateTree(rootNode, subTree);
+      }
+      funTreeView.ExpandAll();
+    }
+
+    private EventHandler MakeNameGeneratorDelegate(IFunctionTreeNameGenerator generator) {
+      return delegate(object source, EventArgs args) {
+        IFunctionTreeNameGenerator g = (IFunctionTreeNameGenerator)((MenuItem)source).Tag;
+        this.nameGenerator = g;
+        foreach (MenuItem otherMenuItem in representationsMenu.MenuItems) otherMenuItem.Checked = false;
+        ((MenuItem)source).Checked = true;
+        UpdateControls();
+      };
+    }
+
+    private EventHandler MakeExporterDelegate(IFunctionTreeExporter exporter) {
+      return delegate(object source, EventArgs args) {
+        TreeNode node = funTreeView.SelectedNode;
+        if (node == null || node.Tag == null) return;
+        Clipboard.SetText(exporter.Export((IFunctionTree)node.Tag));
+      };
+    }
+
+    private void CreateTree(TreeNode rootNode, IFunctionTree functionTree) {
+      TreeNode node = new TreeNode();
+      node.Name = functionTree.Function.Name;
+      node.Text = nameGenerator.GetName(functionTree);
+      node.Tag = functionTree;
+      node.ContextMenu = treeNodeContextMenu;
+      rootNode.Nodes.Add(node);
+      foreach (IFunctionTree subTree in functionTree.SubTrees) {
+        CreateTree(node, subTree);
+      }
+    }
+
+    private void functionTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
+      variablesListBox.Items.Clear();
+      variablesSplitContainer.Panel2.Controls.Clear();
+      templateTextBox.Clear();
+      editButton.Enabled = false;
+      if (funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) {
+        IFunctionTree selectedBranch = (IFunctionTree)funTreeView.SelectedNode.Tag;
+        UpdateVariablesList(selectedBranch);
+        templateTextBox.Text = nameGenerator.GetName(selectedBranch);
+        this.selectedBranch = selectedBranch;
+        editButton.Enabled = true;
+      }
+    }
+
+    private void UpdateVariablesList(IFunctionTree functionTree) {
+      foreach (IVariable variable in functionTree.LocalVariables) {
+        variablesListBox.Items.Add(variable.Name);
+      }
+    }
+
+    private void variablesListBox_SelectedIndexChanged(object sender, EventArgs e) {
+      // in case we had an event-handler registered for a different variable => unregister the event-handler
+      if (selectedVariable != null) {
+        selectedVariable.Value.Changed -= new EventHandler(selectedVariable_ValueChanged);
+      }
+      if (variablesListBox.SelectedItem != null) {
+        string selectedVariableName = (string)variablesListBox.SelectedItem;
+        selectedVariable = selectedBranch.GetLocalVariable(selectedVariableName);
+        variablesSplitContainer.Panel2.Controls.Clear();
+        Control editor = (Control)selectedVariable.CreateView();
+        variablesSplitContainer.Panel2.Controls.Add(editor);
+        editor.Dock = DockStyle.Fill;
+        // register an event handler that updates the treenode when the value of the variable is changed by the user
+        selectedVariable.Value.Changed += new EventHandler(selectedVariable_ValueChanged);
+      } else {
+        variablesSplitContainer.Panel2.Controls.Clear();
+      }
+    }
+
+    void selectedVariable_ValueChanged(object sender, EventArgs e) {
+      if (funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) {
+        TreeNode node = funTreeView.SelectedNode;
+        node.Text = nameGenerator.GetName(functionTree);
+      }
+    }
+
+    protected virtual void editButton_Click(object sender, EventArgs e) {
+      PluginManager.ControlManager.ShowControl(selectedBranch.Function.CreateView());
+    }
+
+    private void funTreeView_MouseUp(object sender, MouseEventArgs e) {
+      if (e.Button == MouseButtons.Right) {
+        // Select the clicked node
+        funTreeView.SelectedNode = funTreeView.GetNodeAt(e.X, e.Y);
+      }
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.resx
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.resx	(revision 2202)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.resx	(revision 2202)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="representationContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>180, 17</value>
+  </metadata>
+  <metadata name="treeNodeContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/FunctionView.Designer.cs	(revision 2174)
+++ 	(revision )
@@ -1,198 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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/>.
- */
-#endregion
-
-using System;
-namespace HeuristicLab.GP {
-  partial class FunctionTreeView {
-    /// <summary> 
-    /// Required designer variable.
-    /// </summary>
-    private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing && (components != null)) {
-        components.Dispose();
-      }
-      if(selectedVariable != null) {
-        selectedVariable.Value.Changed -= new EventHandler(selectedVariable_ValueChanged);
-      }
-      base.Dispose(disposing);
-    }
-
-    #region Component Designer generated code
-
-    /// <summary> 
-    /// Required method for Designer support - do not modify 
-    /// the contents of this method with the code editor.
-    /// </summary>
-    private void InitializeComponent() {
-      this.components = new System.ComponentModel.Container();
-      this.funTreeView = new System.Windows.Forms.TreeView();
-      this.splitContainer = new System.Windows.Forms.SplitContainer();
-      this.variablesGroupBox = new System.Windows.Forms.GroupBox();
-      this.variablesSplitContainer = new System.Windows.Forms.SplitContainer();
-      this.variablesListBox = new System.Windows.Forms.ListBox();
-      this.label1 = new System.Windows.Forms.Label();
-      this.templateTextBox = new System.Windows.Forms.TextBox();
-      this.editButton = new System.Windows.Forms.Button();
-      this.treeNodeContextMenu = new System.Windows.Forms.ContextMenu();
-      this.splitContainer.Panel1.SuspendLayout();
-      this.splitContainer.Panel2.SuspendLayout();
-      this.splitContainer.SuspendLayout();
-      this.variablesGroupBox.SuspendLayout();
-      this.variablesSplitContainer.Panel1.SuspendLayout();
-      this.variablesSplitContainer.SuspendLayout();
-      this.SuspendLayout();
-      // 
-      // funTreeView
-      // 
-      this.funTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.funTreeView.HideSelection = false;
-      this.funTreeView.Location = new System.Drawing.Point(0, 0);
-      this.funTreeView.Name = "funTreeView";
-      this.funTreeView.Size = new System.Drawing.Size(182, 532);
-      this.funTreeView.TabIndex = 0;
-      this.funTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.funTreeView_MouseUp);
-      this.funTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.functionTreeView_AfterSelect);
-      // 
-      // splitContainer
-      // 
-      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.splitContainer.Location = new System.Drawing.Point(0, 0);
-      this.splitContainer.Name = "splitContainer";
-      // 
-      // splitContainer.Panel1
-      // 
-      this.splitContainer.Panel1.Controls.Add(this.funTreeView);
-      // 
-      // splitContainer.Panel2
-      // 
-      this.splitContainer.Panel2.Controls.Add(this.variablesGroupBox);
-      this.splitContainer.Panel2.Controls.Add(this.label1);
-      this.splitContainer.Panel2.Controls.Add(this.templateTextBox);
-      this.splitContainer.Panel2.Controls.Add(this.editButton);
-      this.splitContainer.Size = new System.Drawing.Size(735, 532);
-      this.splitContainer.SplitterDistance = 182;
-      this.splitContainer.TabIndex = 1;
-      // 
-      // variablesGroupBox
-      // 
-      this.variablesGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.variablesGroupBox.Controls.Add(this.variablesSplitContainer);
-      this.variablesGroupBox.Location = new System.Drawing.Point(3, 31);
-      this.variablesGroupBox.Name = "variablesGroupBox";
-      this.variablesGroupBox.Size = new System.Drawing.Size(543, 498);
-      this.variablesGroupBox.TabIndex = 5;
-      this.variablesGroupBox.TabStop = false;
-      this.variablesGroupBox.Text = "Local variables";
-      // 
-      // variablesSplitContainer
-      // 
-      this.variablesSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.variablesSplitContainer.Location = new System.Drawing.Point(3, 16);
-      this.variablesSplitContainer.Name = "variablesSplitContainer";
-      // 
-      // variablesSplitContainer.Panel1
-      // 
-      this.variablesSplitContainer.Panel1.Controls.Add(this.variablesListBox);
-      this.variablesSplitContainer.Size = new System.Drawing.Size(537, 479);
-      this.variablesSplitContainer.SplitterDistance = 179;
-      this.variablesSplitContainer.TabIndex = 0;
-      // 
-      // variablesListBox
-      // 
-      this.variablesListBox.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.variablesListBox.FormattingEnabled = true;
-      this.variablesListBox.Location = new System.Drawing.Point(0, 0);
-      this.variablesListBox.Name = "variablesListBox";
-      this.variablesListBox.Size = new System.Drawing.Size(179, 472);
-      this.variablesListBox.TabIndex = 0;
-      this.variablesListBox.SelectedIndexChanged += new System.EventHandler(this.variablesListBox_SelectedIndexChanged);
-      // 
-      // label1
-      // 
-      this.label1.AutoSize = true;
-      this.label1.Location = new System.Drawing.Point(3, 10);
-      this.label1.Name = "label1";
-      this.label1.Size = new System.Drawing.Size(96, 13);
-      this.label1.TabIndex = 3;
-      this.label1.Text = "Function definition:";
-      // 
-      // templateTextBox
-      // 
-      this.templateTextBox.Location = new System.Drawing.Point(105, 7);
-      this.templateTextBox.Name = "templateTextBox";
-      this.templateTextBox.ReadOnly = true;
-      this.templateTextBox.Size = new System.Drawing.Size(190, 20);
-      this.templateTextBox.TabIndex = 2;
-      // 
-      // editButton
-      // 
-      this.editButton.Enabled = false;
-      this.editButton.Location = new System.Drawing.Point(301, 5);
-      this.editButton.Name = "editButton";
-      this.editButton.Size = new System.Drawing.Size(49, 23);
-      this.editButton.TabIndex = 1;
-      this.editButton.Text = "Edit...";
-      this.editButton.UseVisualStyleBackColor = true;
-      this.editButton.Click += new System.EventHandler(this.editButton_Click);
-      // 
-      // treeNodeContextMenu
-      // 
-      this.treeNodeContextMenu.Name = "treeNodeContextMenu";
-      // 
-      // FunctionTreeView
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.splitContainer);
-      this.Name = "FunctionTreeView";
-      this.Size = new System.Drawing.Size(735, 532);
-      this.splitContainer.Panel1.ResumeLayout(false);
-      this.splitContainer.Panel2.ResumeLayout(false);
-      this.splitContainer.Panel2.PerformLayout();
-      this.splitContainer.ResumeLayout(false);
-      this.variablesGroupBox.ResumeLayout(false);
-      this.variablesSplitContainer.Panel1.ResumeLayout(false);
-      this.variablesSplitContainer.ResumeLayout(false);
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    private System.Windows.Forms.TreeView funTreeView;
-    private System.Windows.Forms.SplitContainer splitContainer;
-    private System.Windows.Forms.TextBox templateTextBox;
-    private System.Windows.Forms.Button editButton;
-    private System.Windows.Forms.GroupBox variablesGroupBox;
-    private System.Windows.Forms.SplitContainer variablesSplitContainer;
-    private System.Windows.Forms.ListBox variablesListBox;
-    private System.Windows.Forms.Label label1;
-    private System.Windows.Forms.ContextMenu treeNodeContextMenu;
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionView.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/FunctionView.cs	(revision 2174)
+++ 	(revision )
@@ -1,188 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using HeuristicLab.Core;
-using HeuristicLab.PluginInfrastructure;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.GP {
-  public partial class FunctionTreeView : ViewBase {
-    private IFunctionTree functionTree;
-
-    private IFunctionTree selectedBranch;
-    private IVariable selectedVariable;
-    private IFunctionTreeNameGenerator nameGenerator;
-    private IFunctionTreeNameGenerator[] allNameGenerators;
-    private MenuItem representationsMenu;
-
-    public FunctionTreeView() {
-      nameGenerator = new DefaultFunctionTreeNameGenerator();
-      InitializeComponent();
-
-      DiscoveryService discoveryService = new DiscoveryService();
-      allNameGenerators = discoveryService.GetInstances<IFunctionTreeNameGenerator>();
-      representationsMenu = new MenuItem();
-      representationsMenu.Text = "Tree representation";
-      representationsMenu.Name = "Tree representation";
-      foreach (IFunctionTreeNameGenerator generator in allNameGenerators) {
-        MenuItem mi = new MenuItem(generator.Name, MakeNameGeneratorDelegate(generator), Shortcut.None);
-        if (generator is DefaultFunctionTreeNameGenerator) mi.Checked = true;
-        else mi.Checked = false;
-        mi.Tag = generator;
-        representationsMenu.MenuItems.Add(mi);
-      }
-    }
-
-    public FunctionTreeView(IFunctionTree functionTree)
-      : this() {
-      this.functionTree = functionTree;
-      Refresh();
-    }
-
-    protected override void UpdateControls() {
-      funTreeView.Nodes.Clear();
-      TreeNode rootNode = new TreeNode();
-      rootNode.Name = functionTree.Function.Name;
-      rootNode.Text = nameGenerator.GetName(functionTree);
-      rootNode.Tag = functionTree;
-      treeNodeContextMenu.MenuItems.Clear();
-      treeNodeContextMenu.MenuItems.Add(representationsMenu);
-      DiscoveryService discoveryService = new DiscoveryService();
-      IFunctionTreeExporter[] exporters = discoveryService.GetInstances<IFunctionTreeExporter>();
-      foreach (IFunctionTreeExporter exporter in exporters) {
-        string result;
-        // register a menu item for the exporter
-        MenuItem item = new MenuItem("Copy to clip-board (" + exporter.Name + ")",
-          MakeExporterDelegate(exporter), Shortcut.None);
-        // try to export the whole tree 
-        if (exporter.TryExport(functionTree, out result)) {
-          // if it worked enable the context-menu item
-          item.Enabled = true;
-        } else {
-          item.Enabled = false;
-        }
-        treeNodeContextMenu.MenuItems.Add(item);
-      }
-      rootNode.ContextMenu = treeNodeContextMenu;
-      funTreeView.Nodes.Add(rootNode);
-
-      foreach (IFunctionTree subTree in functionTree.SubTrees) {
-        CreateTree(rootNode, subTree);
-      }
-      funTreeView.ExpandAll();
-    }
-
-    private EventHandler MakeNameGeneratorDelegate(IFunctionTreeNameGenerator generator) {
-      return delegate(object source, EventArgs args) {
-        IFunctionTreeNameGenerator g = (IFunctionTreeNameGenerator)((MenuItem)source).Tag;
-        this.nameGenerator = g;
-        foreach (MenuItem otherMenuItem in representationsMenu.MenuItems) otherMenuItem.Checked = false;
-        ((MenuItem)source).Checked = true;
-        UpdateControls();
-      };
-    }
-
-    private EventHandler MakeExporterDelegate(IFunctionTreeExporter exporter) {
-      return delegate(object source, EventArgs args) {
-        TreeNode node = funTreeView.SelectedNode;
-        if (node == null || node.Tag == null) return;
-        Clipboard.SetText(exporter.Export((IFunctionTree)node.Tag));
-      };
-    }
-
-    private void CreateTree(TreeNode rootNode, IFunctionTree functionTree) {
-      TreeNode node = new TreeNode();
-      node.Name = functionTree.Function.Name;
-      node.Text = nameGenerator.GetName(functionTree);
-      node.Tag = functionTree;
-      node.ContextMenu = treeNodeContextMenu;
-      rootNode.Nodes.Add(node);
-      foreach (IFunctionTree subTree in functionTree.SubTrees) {
-        CreateTree(node, subTree);
-      }
-    }
-
-    private void functionTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
-      variablesListBox.Items.Clear();
-      variablesSplitContainer.Panel2.Controls.Clear();
-      templateTextBox.Clear();
-      editButton.Enabled = false;
-      if (funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) {
-        IFunctionTree selectedBranch = (IFunctionTree)funTreeView.SelectedNode.Tag;
-        UpdateVariablesList(selectedBranch);
-        templateTextBox.Text = nameGenerator.GetName(selectedBranch);
-        this.selectedBranch = selectedBranch;
-        editButton.Enabled = true;
-      }
-    }
-
-    private void UpdateVariablesList(IFunctionTree functionTree) {
-      foreach (IVariable variable in functionTree.LocalVariables) {
-        variablesListBox.Items.Add(variable.Name);
-      }
-    }
-
-    private void variablesListBox_SelectedIndexChanged(object sender, EventArgs e) {
-      // in case we had an event-handler registered for a different variable => unregister the event-handler
-      if (selectedVariable != null) {
-        selectedVariable.Value.Changed -= new EventHandler(selectedVariable_ValueChanged);
-      }
-      if (variablesListBox.SelectedItem != null) {
-        string selectedVariableName = (string)variablesListBox.SelectedItem;
-        selectedVariable = selectedBranch.GetLocalVariable(selectedVariableName);
-        variablesSplitContainer.Panel2.Controls.Clear();
-        Control editor = (Control)selectedVariable.CreateView();
-        variablesSplitContainer.Panel2.Controls.Add(editor);
-        editor.Dock = DockStyle.Fill;
-        // register an event handler that updates the treenode when the value of the variable is changed by the user
-        selectedVariable.Value.Changed += new EventHandler(selectedVariable_ValueChanged);
-      } else {
-        variablesSplitContainer.Panel2.Controls.Clear();
-      }
-    }
-
-    void selectedVariable_ValueChanged(object sender, EventArgs e) {
-      if (funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) {
-        TreeNode node = funTreeView.SelectedNode;
-        node.Text = nameGenerator.GetName(functionTree);
-      }
-    }
-
-    protected virtual void editButton_Click(object sender, EventArgs e) {
-      PluginManager.ControlManager.ShowControl(selectedBranch.Function.CreateView());
-    }
-
-    private void funTreeView_MouseUp(object sender, MouseEventArgs e) {
-      if (e.Button == MouseButtons.Right) {
-        // Select the clicked node
-        funTreeView.SelectedNode = funTreeView.GetNodeAt(e.X, e.Y);
-      }
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionView.resx
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/FunctionView.resx	(revision 2174)
+++ 	(revision )
@@ -1,126 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="representationContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>180, 17</value>
-  </metadata>
-  <metadata name="treeNodeContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-</root>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GPOperatorGroup.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/GPOperatorGroup.cs	(revision 2174)
+++ 	(revision )
@@ -1,228 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Operators;
-using HeuristicLab.Data;
-using HeuristicLab.Random;
-using HeuristicLab.Constraints;
-
-namespace HeuristicLab.GP {
-  public class GPOperatorGroup : OperatorGroup {
-    private Dictionary<IOperator, int> minTreeHeight = new Dictionary<IOperator, int>();
-    private Dictionary<IOperator, int> minTreeSize = new Dictionary<IOperator, int>();
-    private SubOperatorsConstraintAnalyser constraintAnalyser = new SubOperatorsConstraintAnalyser();
-
-    public GPOperatorGroup()
-      : base() {
-    }
-
-    public override void AddOperator(IOperator op) {
-      base.AddOperator(op);
-      var localVariableInfos = op.VariableInfos.Where(f => f.Local);
-
-      if(op.GetVariable(GPOperatorLibrary.MIN_TREE_HEIGHT) == null) {
-        op.AddVariable(new Variable(GPOperatorLibrary.MIN_TREE_HEIGHT, new IntData(-1)));
-      }
-      if(op.GetVariable(GPOperatorLibrary.MIN_TREE_SIZE) == null) {
-        op.AddVariable(new Variable(GPOperatorLibrary.MIN_TREE_SIZE, new IntData(-1)));
-      }
-      if(op.GetVariable(GPOperatorLibrary.TICKETS) == null) {
-        op.AddVariable(new Variable(GPOperatorLibrary.TICKETS, new DoubleData(1.0)));
-      }
-      foreach(IConstraint c in op.Constraints) {
-        if(c is SubOperatorTypeConstraint || c is AllSubOperatorsTypeConstraint) c.Changed += new EventHandler(UpdateTreeBounds);
-      }
-      RecalculateMinimalTreeBounds();
-      OnOperatorAdded(op);
-    }
-
-    void UpdateTreeBounds(object sender, EventArgs e) {
-      RecalculateMinimalTreeBounds();
-    }
-
-    private void RecalculateMinimalTreeBounds() {
-      minTreeHeight.Clear();
-      minTreeSize.Clear();
-      constraintAnalyser.AllPossibleOperators = Operators;
-
-      foreach(IOperator op in Operators) {
-        ((IntData)op.GetVariable(GPOperatorLibrary.MIN_TREE_HEIGHT).Value).Data = RecalculateMinimalTreeHeight(op);
-        ((IntData)op.GetVariable(GPOperatorLibrary.MIN_TREE_SIZE).Value).Data = RecalculateMinimalTreeSize(op);
-      }
-    }
-
-    private int RecalculateMinimalTreeSize(IOperator op) {
-      // check for memoized value
-      if(minTreeSize.ContainsKey(op)) {
-        return minTreeSize[op];
-      }
-
-      int minArity;
-      int maxArity;
-      GetMinMaxArity(op, out minArity, out maxArity);
-      // no suboperators possible => minimalTreeSize == 1 (the current node)
-      if(minArity == 0 && maxArity == 0) {
-        minTreeSize[op] = 1;
-        return 1;
-      }
-
-      // when suboperators are necessary we have to find the smallest possible tree (recursively)
-      // the minimal size of the parent is 1 + the sum of the minimal sizes of all subtrees
-      int subTreeSizeSum = 0;
-
-      // mark the currently processed operator to prevent infinite recursions and stack overflow
-      minTreeSize[op] = 9999;
-      for(int i = 0; i < minArity; i++) {
-        // calculate the minTreeSize of all allowed sub-operators 
-        // if the list of allowed suboperators is empty because the operator needs suboperators 
-        // but there are no valid suboperators defined in the current group then we just use an impossible 
-        // tree size here to indicate that there was a problem.
-        // usually as more operators are added to the group the problem will be corrected (by adding the missing operator).
-        // however if the missing operator is never added the high min tree size here has the effect that this operator
-        // will not be included in generated subtrees because the resulting size would always be higher than a reasonably set 
-        // maximal tree size.
-        int minSubTreeSize = constraintAnalyser.GetAllowedOperators(op, i).Select(subOp => RecalculateMinimalTreeSize(subOp))
-          .Concat(Enumerable.Repeat(9999, 1)).Min();
-        subTreeSizeSum += minSubTreeSize;
-      }
-
-      minTreeSize[op] = subTreeSizeSum + 1;
-      return subTreeSizeSum + 1;
-    }
-
-    private int RecalculateMinimalTreeHeight(IOperator op) {
-      // check for memoized value
-      if(minTreeHeight.ContainsKey(op)) {
-        return minTreeHeight[op];
-      }
-
-      int minArity;
-      int maxArity;
-      GetMinMaxArity(op, out minArity, out maxArity);
-      // no suboperators possible => minimalTreeHeight == 1
-      if(minArity == 0 && maxArity == 0) {
-        minTreeHeight[op] = 1;
-        return 1;
-      }
-
-      // when suboperators are necessary we have to find the smallest possible tree (recursively)
-      // the minimal height of the parent is 1 + the height of the largest subtree
-      int maxSubTreeHeight = 0;
-
-      // mark the currently processed operator to prevent infinite recursions leading to stack overflow
-      minTreeHeight[op] = 9999;
-      for(int i = 0; i < minArity; i++) {
-        // calculate the minTreeHeight of all possible sub-operators.
-        // use the smallest possible subTree as lower bound for the subTreeHeight.
-        // if the list of allowed suboperators is empty because the operator needs suboperators 
-        // but there are no valid suboperators defined in the current group then we use an impossible tree height
-        // to indicate that there was a problem.
-        // usually as more operators are added to the group the problem will be corrected (by adding the missing operator).
-        // however if the missing operator is never added the high min tree height here has the effect that this operator
-        // will not be included in generated subtrees because the resulting (virtual) height would always be higher than a reasonably set 
-        // maximal tree height.
-        int minSubTreeHeight = constraintAnalyser.GetAllowedOperators(op, i).Select(subOp => RecalculateMinimalTreeHeight(subOp))
-          .Concat(Enumerable.Repeat(9999, 1)).Min();
-
-        // if the smallest height of this subtree is larger than all other subtrees before we have to update the min height of the parent
-        if(minSubTreeHeight > maxSubTreeHeight) {
-          maxSubTreeHeight = minSubTreeHeight;
-        }
-      }
-
-      minTreeHeight[op] = maxSubTreeHeight + 1;
-      return maxSubTreeHeight + 1;
-    }
-
-    private void GetMinMaxArity(IOperator op, out int minArity, out int maxArity) {
-      foreach(IConstraint constraint in op.Constraints) {
-        NumberOfSubOperatorsConstraint theConstraint = constraint as NumberOfSubOperatorsConstraint;
-        if(theConstraint != null) {
-          minArity = theConstraint.MinOperators.Data;
-          maxArity = theConstraint.MaxOperators.Data;
-          return;
-        }
-      }
-      // the default arity is 2
-      minArity = 2;
-      maxArity = 2;
-    }
-
-    public override void AddSubGroup(IOperatorGroup group) {
-      throw new NotSupportedException();
-    }
-
-    public override void RemoveOperator(IOperator op) {
-      base.RemoveOperator(op);
-      op.RemoveVariable(GPOperatorLibrary.MIN_TREE_SIZE);
-      op.RemoveVariable(GPOperatorLibrary.MIN_TREE_HEIGHT);
-      op.RemoveVariable(GPOperatorLibrary.TICKETS);
-      foreach(IConstraint c in op.Constraints) {
-        if(c is SubOperatorTypeConstraint || c is AllSubOperatorsTypeConstraint) c.Changed -= new EventHandler(UpdateTreeBounds);
-      }
-
-      // remove the operator from the allowed sub-functions of the remaining operators
-      foreach(IOperator o in Operators) {
-        if(o != op) {
-          foreach(IConstraint c in o.Constraints) {
-            if(c is SubOperatorTypeConstraint) {
-              ((SubOperatorTypeConstraint)c).RemoveOperator(op);
-            } else if(c is AllSubOperatorsTypeConstraint) {
-              ((AllSubOperatorsTypeConstraint)c).RemoveOperator(op);
-            }
-          }
-        }
-      }
-      OnOperatorRemoved(op);
-    }
-
-    public override void RemoveSubGroup(IOperatorGroup group) {
-      throw new NotSupportedException();
-    }
-
-    public event EventHandler OperatorAdded;
-    public event EventHandler OperatorRemoved;
-
-    protected virtual void OnOperatorAdded(IOperator op) {
-      if(OperatorAdded != null) {
-        OperatorAdded(this, new OperatorEventArgs(op));
-      }
-    }
-    protected virtual void OnOperatorRemoved(IOperator op) {
-      if(OperatorRemoved != null) {
-        OperatorRemoved(this, new OperatorEventArgs(op));
-      }
-    }
-  }
-
-  internal class OperatorEventArgs : EventArgs {
-    public IOperator op;
-
-    public OperatorEventArgs(IOperator op) {
-      this.op = op;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GPOperatorLibrary.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/GPOperatorLibrary.cs	(revision 2174)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Core;
-using System.Xml;
-
-namespace HeuristicLab.GP {
-  public class GPOperatorLibrary : ItemBase, IOperatorLibrary, IEditable  {
-    // constants for variable names
-    internal const string MIN_TREE_HEIGHT = "MinTreeHeight";
-    internal const string MIN_TREE_SIZE = "MinTreeSize";
-    internal const string TICKETS = "Tickets";
-
-    private GPOperatorGroup group;
-
-    public GPOperatorGroup GPOperatorGroup {
-      get { return group; }
-    }
-    #region IOperatorLibrary Members
-
-    public IOperatorGroup Group {
-      get { return group; }
-    }
-
-    #endregion
-
-
-    public GPOperatorLibrary()
-      : base() {
-      group = new GPOperatorGroup();
-    }
-
-    public override IView CreateView() {
-      return new GPOperatorLibraryEditor(this);
-    }
-
-    public override object Clone(IDictionary<Guid, object> clonedObjects) {
-      GPOperatorLibrary clone = (GPOperatorLibrary)base.Clone(clonedObjects);
-      clone.group = (GPOperatorGroup)group.Clone(clonedObjects);
-      return clone;
-    }
-
-    #region persistence
-    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
-      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
-      node.AppendChild(PersistenceManager.Persist("Group", group, document, persistedObjects));
-      return node;
-    }
-
-    public override void Populate(System.Xml.XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
-      base.Populate(node, restoredObjects);
-      group = (GPOperatorGroup) PersistenceManager.Restore(node.SelectSingleNode("Group"), restoredObjects);
-    }
-    #endregion
-
-    #region IEditable Members
-
-    public IEditor CreateEditor() {
-      return new GPOperatorLibraryEditor(this);
-    }
-
-    #endregion
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GPOperatorLibraryEditor.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/GPOperatorLibraryEditor.Designer.cs	(revision 2174)
+++ 	(revision )
@@ -1,238 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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/>.
- */
-#endregion
-
-namespace HeuristicLab.GP {
-  partial class GPOperatorLibraryEditor {
-    /// <summary> 
-    /// Required designer variable.
-    /// </summary>
-    private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if(disposing && (components != null)) {
-        components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
-    #region Component Designer generated code
-
-    /// <summary> 
-    /// Required method for Designer support - do not modify 
-    /// the contents of this method with the code editor.
-    /// </summary>
-    private void InitializeComponent() {
-      this.operatorLibraryEditor = new HeuristicLab.Core.OperatorLibraryEditor();
-      this.tabControl = new System.Windows.Forms.TabControl();
-      this.operatorLibraryTabPage = new System.Windows.Forms.TabPage();
-      this.initializationTabPage = new System.Windows.Forms.TabPage();
-      this.initSplitContainer = new System.Windows.Forms.SplitContainer();
-      this.initListView = new System.Windows.Forms.ListView();
-      this.initVariableView = new HeuristicLab.Core.VariableView();
-      this.mutationTabPage = new System.Windows.Forms.TabPage();
-      this.mutationSplitContainer = new System.Windows.Forms.SplitContainer();
-      this.mutationListView = new System.Windows.Forms.ListView();
-      this.mutationVariableView = new HeuristicLab.Core.VariableView();
-      this.tabControl.SuspendLayout();
-      this.operatorLibraryTabPage.SuspendLayout();
-      this.initializationTabPage.SuspendLayout();
-      this.initSplitContainer.Panel1.SuspendLayout();
-      this.initSplitContainer.Panel2.SuspendLayout();
-      this.initSplitContainer.SuspendLayout();
-      this.mutationTabPage.SuspendLayout();
-      this.mutationSplitContainer.Panel1.SuspendLayout();
-      this.mutationSplitContainer.Panel2.SuspendLayout();
-      this.mutationSplitContainer.SuspendLayout();
-      this.SuspendLayout();
-      // 
-      // operatorLibraryEditor
-      // 
-      this.operatorLibraryEditor.Caption = "Operator Library";
-      this.operatorLibraryEditor.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.operatorLibraryEditor.Filename = null;
-      this.operatorLibraryEditor.Location = new System.Drawing.Point(3, 3);
-      this.operatorLibraryEditor.Name = "operatorLibraryEditor";
-      this.operatorLibraryEditor.OperatorLibrary = null;
-      this.operatorLibraryEditor.Size = new System.Drawing.Size(663, 529);
-      this.operatorLibraryEditor.TabIndex = 0;
-      // 
-      // tabControl
-      // 
-      this.tabControl.Controls.Add(this.operatorLibraryTabPage);
-      this.tabControl.Controls.Add(this.initializationTabPage);
-      this.tabControl.Controls.Add(this.mutationTabPage);
-      this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.tabControl.Location = new System.Drawing.Point(0, 0);
-      this.tabControl.Name = "tabControl";
-      this.tabControl.SelectedIndex = 0;
-      this.tabControl.Size = new System.Drawing.Size(677, 561);
-      this.tabControl.TabIndex = 1;
-      // 
-      // operatorLibraryTabPage
-      // 
-      this.operatorLibraryTabPage.Controls.Add(this.operatorLibraryEditor);
-      this.operatorLibraryTabPage.Location = new System.Drawing.Point(4, 22);
-      this.operatorLibraryTabPage.Name = "operatorLibraryTabPage";
-      this.operatorLibraryTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.operatorLibraryTabPage.Size = new System.Drawing.Size(669, 535);
-      this.operatorLibraryTabPage.TabIndex = 0;
-      this.operatorLibraryTabPage.Text = "Operator Library";
-      this.operatorLibraryTabPage.UseVisualStyleBackColor = true;
-      // 
-      // initializationTabPage
-      // 
-      this.initializationTabPage.Controls.Add(this.initSplitContainer);
-      this.initializationTabPage.Location = new System.Drawing.Point(4, 22);
-      this.initializationTabPage.Name = "initializationTabPage";
-      this.initializationTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.initializationTabPage.Size = new System.Drawing.Size(669, 535);
-      this.initializationTabPage.TabIndex = 1;
-      this.initializationTabPage.Text = "Initialization";
-      this.initializationTabPage.UseVisualStyleBackColor = true;
-      // 
-      // initSplitContainer
-      // 
-      this.initSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.initSplitContainer.Location = new System.Drawing.Point(3, 3);
-      this.initSplitContainer.Name = "initSplitContainer";
-      // 
-      // initSplitContainer.Panel1
-      // 
-      this.initSplitContainer.Panel1.Controls.Add(this.initListView);
-      // 
-      // initSplitContainer.Panel2
-      // 
-      this.initSplitContainer.Panel2.Controls.Add(this.initVariableView);
-      this.initSplitContainer.Size = new System.Drawing.Size(663, 529);
-      this.initSplitContainer.SplitterDistance = 221;
-      this.initSplitContainer.TabIndex = 0;
-      // 
-      // initListView
-      // 
-      this.initListView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.initListView.Location = new System.Drawing.Point(0, 0);
-      this.initListView.Name = "initListView";
-      this.initListView.Size = new System.Drawing.Size(221, 529);
-      this.initListView.TabIndex = 0;
-      this.initListView.UseCompatibleStateImageBehavior = false;
-      this.initListView.View = System.Windows.Forms.View.List;
-      this.initListView.SelectedIndexChanged += new System.EventHandler(this.initListView_SelectedIndexChanged);
-      // 
-      // initVariableView
-      // 
-      this.initVariableView.Caption = "Variable";
-      this.initVariableView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.initVariableView.Location = new System.Drawing.Point(0, 0);
-      this.initVariableView.Name = "initVariableView";
-      this.initVariableView.Size = new System.Drawing.Size(438, 529);
-      this.initVariableView.TabIndex = 0;
-      this.initVariableView.Variable = null;
-      // 
-      // mutationTabPage
-      // 
-      this.mutationTabPage.Controls.Add(this.mutationSplitContainer);
-      this.mutationTabPage.Location = new System.Drawing.Point(4, 22);
-      this.mutationTabPage.Name = "mutationTabPage";
-      this.mutationTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.mutationTabPage.Size = new System.Drawing.Size(669, 535);
-      this.mutationTabPage.TabIndex = 2;
-      this.mutationTabPage.Text = "Mutation";
-      this.mutationTabPage.UseVisualStyleBackColor = true;
-      // 
-      // mutationSplitContainer
-      // 
-      this.mutationSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.mutationSplitContainer.Location = new System.Drawing.Point(3, 3);
-      this.mutationSplitContainer.Name = "mutationSplitContainer";
-      // 
-      // mutationSplitContainer.Panel1
-      // 
-      this.mutationSplitContainer.Panel1.Controls.Add(this.mutationListView);
-      // 
-      // mutationSplitContainer.Panel2
-      // 
-      this.mutationSplitContainer.Panel2.Controls.Add(this.mutationVariableView);
-      this.mutationSplitContainer.Size = new System.Drawing.Size(663, 529);
-      this.mutationSplitContainer.SplitterDistance = 221;
-      this.mutationSplitContainer.TabIndex = 0;
-      // 
-      // mutationListView
-      // 
-      this.mutationListView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.mutationListView.Location = new System.Drawing.Point(0, 0);
-      this.mutationListView.MultiSelect = false;
-      this.mutationListView.Name = "mutationListView";
-      this.mutationListView.Size = new System.Drawing.Size(221, 529);
-      this.mutationListView.TabIndex = 0;
-      this.mutationListView.UseCompatibleStateImageBehavior = false;
-      this.mutationListView.View = System.Windows.Forms.View.List;
-      this.mutationListView.SelectedIndexChanged += new System.EventHandler(this.mutationListView_SelectedIndexChanged);
-      // 
-      // mutationVariableView
-      // 
-      this.mutationVariableView.Caption = "Variable";
-      this.mutationVariableView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.mutationVariableView.Location = new System.Drawing.Point(0, 0);
-      this.mutationVariableView.Name = "mutationVariableView";
-      this.mutationVariableView.Size = new System.Drawing.Size(438, 529);
-      this.mutationVariableView.TabIndex = 0;
-      this.mutationVariableView.Variable = null;
-      // 
-      // GPOperatorLibraryEditor
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.tabControl);
-      this.Name = "GPOperatorLibraryEditor";
-      this.Size = new System.Drawing.Size(677, 561);
-      this.tabControl.ResumeLayout(false);
-      this.operatorLibraryTabPage.ResumeLayout(false);
-      this.initializationTabPage.ResumeLayout(false);
-      this.initSplitContainer.Panel1.ResumeLayout(false);
-      this.initSplitContainer.Panel2.ResumeLayout(false);
-      this.initSplitContainer.ResumeLayout(false);
-      this.mutationTabPage.ResumeLayout(false);
-      this.mutationSplitContainer.Panel1.ResumeLayout(false);
-      this.mutationSplitContainer.Panel2.ResumeLayout(false);
-      this.mutationSplitContainer.ResumeLayout(false);
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    private HeuristicLab.Core.OperatorLibraryEditor operatorLibraryEditor;
-    private System.Windows.Forms.TabControl tabControl;
-    private System.Windows.Forms.TabPage operatorLibraryTabPage;
-    private System.Windows.Forms.TabPage initializationTabPage;
-    private System.Windows.Forms.TabPage mutationTabPage;
-    private System.Windows.Forms.SplitContainer initSplitContainer;
-    private System.Windows.Forms.SplitContainer mutationSplitContainer;
-    private HeuristicLab.Core.VariableView initVariableView;
-    private HeuristicLab.Core.VariableView mutationVariableView;
-    private System.Windows.Forms.ListView initListView;
-    private System.Windows.Forms.ListView mutationListView;
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GPOperatorLibraryEditor.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/GPOperatorLibraryEditor.cs	(revision 2174)
+++ 	(revision )
@@ -1,153 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using HeuristicLab.Core;
-using System.Diagnostics;
-using HeuristicLab.Data;
-using HeuristicLab.Operators;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP {
-  public partial class GPOperatorLibraryEditor : EditorBase {
-    public IOperatorLibrary OperatorLibrary {
-      get { return (IOperatorLibrary)Item; }
-      set { base.Item = value; }
-    }
-
-    public GPOperatorLibraryEditor(GPOperatorLibrary library)
-      : base() {
-      InitializeComponent();
-      OperatorLibrary = library;
-      operatorLibraryEditor.OperatorLibrary = library;
-
-      library.GPOperatorGroup.OperatorAdded += new EventHandler(GPOperatorLibraryView_OperatorAdded);
-      library.GPOperatorGroup.OperatorRemoved += new EventHandler(GPOperatorGroup_OperatorRemoved);
-
-      mutationVariableView.Enabled = false;
-      initVariableView.Enabled = false;
-
-      foreach(IOperator op in library.Group.Operators) {
-        if(op.GetVariable(FunctionBase.MANIPULATION) != null) {
-          ListViewItem item = new ListViewItem();
-          item.Text = op.Name;
-          item.Name = op.Name;
-          item.Tag = op;
-          mutationListView.Items.Add(item);
-        }
-        if(op.GetVariable(FunctionBase.INITIALIZATION) != null) {
-          ListViewItem item = new ListViewItem();
-          item.Name = op.Name;
-          item.Text = op.Name;
-          item.Tag = op;
-          initListView.Items.Add(item);
-        }
-      }
-    }
-
-
-    private void GPOperatorLibraryView_OperatorAdded(object sender, EventArgs e) {
-      IOperator op = ((OperatorEventArgs)e).op;
-      if(op.GetVariable(FunctionBase.MANIPULATION) != null) {
-        ListViewItem operatorMutationItem = new ListViewItem();
-        operatorMutationItem.Name = op.Name;
-        operatorMutationItem.Text = op.Name;
-        operatorMutationItem.Tag = op;
-        mutationListView.Items.Add(operatorMutationItem);
-      }
-
-      if(op.GetVariable(FunctionBase.INITIALIZATION) != null) {
-        ListViewItem operatorInitItem = new ListViewItem();
-        operatorInitItem.Name = op.Name;
-        operatorInitItem.Text = op.Name;
-        operatorInitItem.Tag = op;
-        initListView.Items.Add(operatorInitItem);
-      }
-
-      op.NameChanged += new EventHandler(op_NameChanged);
-      Refresh();
-    }
-
-    private void op_NameChanged(object sender, EventArgs e) {
-      IOperator srcOp = (IOperator)sender;
-      foreach(ListViewItem item in mutationListView.Items) {
-        if(item.Tag == srcOp) {
-          item.Name = srcOp.Name;
-          item.Text = srcOp.Name;
-          break;
-        }
-      }
-      foreach(ListViewItem item in initListView.Items) {
-        if(item.Tag == srcOp) {
-          item.Name = srcOp.Name;
-          item.Text = srcOp.Name;
-          break;
-        }
-      }
-    }
-
-
-    private void GPOperatorGroup_OperatorRemoved(object sender, EventArgs e) {
-      IOperator op = ((OperatorEventArgs)e).op;
-
-      foreach(ListViewItem item in mutationListView.Items) {
-        if(item.Tag == op) {
-          mutationListView.Items.Remove(item);
-          break;
-        }
-      }
-
-      foreach(ListViewItem item in initListView.Items) {
-        if(item.Tag == op) {
-          initListView.Items.Remove(item);
-          break;
-        }
-      }
-    }
-
-    private void mutationListView_SelectedIndexChanged(object sender, EventArgs e) {
-      if(mutationListView.SelectedItems.Count>0 && mutationListView.SelectedItems[0].Tag != null) {
-        IVariable variable = ((IOperator)mutationListView.SelectedItems[0].Tag).GetVariable(FunctionBase.MANIPULATION);
-        mutationVariableView.Enabled = true;
-        mutationVariableView.Variable = variable;
-      } else {
-        mutationVariableView.Enabled = false;
-      }
-    }
-
-    private void initListView_SelectedIndexChanged(object sender, EventArgs e) {
-      if(initListView.SelectedItems.Count>0 && initListView.SelectedItems[0].Tag != null) {
-        IVariable variable = ((IOperator)initListView.SelectedItems[0].Tag).GetVariable(FunctionBase.INITIALIZATION);
-        initVariableView.Enabled = true;
-        initVariableView.Variable = variable;
-      } else {
-        initVariableView.Enabled = false;
-      }
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GPOperatorLibraryEditor.resx
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/GPOperatorLibraryEditor.resx	(revision 2174)
+++ 	(revision )
@@ -1,120 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj	(revision 2202)
@@ -83,4 +83,23 @@
   <ItemGroup>
     <Compile Include="BakedFunctionTree.cs" />
+    <Compile Include="FunctionLibrary.cs" />
+    <Compile Include="FunctionLibraryEditor.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="FunctionLibraryEditor.Designer.cs">
+      <DependentUpon>FunctionLibraryEditor.cs</DependentUpon>
+    </Compile>
+    <Compile Include="FunctionTreeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="FunctionTreeView.Designer.cs">
+      <DependentUpon>FunctionTreeView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="FunView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="FunView.Designer.cs">
+      <DependentUpon>FunView.cs</DependentUpon>
+    </Compile>
     <Compile Include="TrainingWindowSlider.cs" />
     <Compile Include="DefaultFunctionTreeNameGenerator.cs" />
@@ -95,18 +114,4 @@
     <Compile Include="IFunctionTreeExporter.cs" />
     <Compile Include="FunctionBase.cs" />
-    <Compile Include="FunctionView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="FunctionView.Designer.cs">
-      <DependentUpon>FunctionView.cs</DependentUpon>
-    </Compile>
-    <Compile Include="GPOperatorGroup.cs" />
-    <Compile Include="GPOperatorLibrary.cs" />
-    <Compile Include="GPOperatorLibraryEditor.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="GPOperatorLibraryEditor.Designer.cs">
-      <DependentUpon>GPOperatorLibraryEditor.cs</DependentUpon>
-    </Compile>
     <Compile Include="HeuristicLabGPPlugin.cs" />
     <Compile Include="IFunction.cs" />
@@ -162,11 +167,9 @@
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="FunctionView.resx">
-      <DependentUpon>FunctionView.cs</DependentUpon>
-      <SubType>Designer</SubType>
+    <EmbeddedResource Include="FunctionLibraryEditor.resx">
+      <DependentUpon>FunctionLibraryEditor.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="GPOperatorLibraryEditor.resx">
-      <DependentUpon>GPOperatorLibraryEditor.cs</DependentUpon>
-      <SubType>Designer</SubType>
+    <EmbeddedResource Include="FunctionTreeView.resx">
+      <DependentUpon>FunctionTreeView.cs</DependentUpon>
     </EmbeddedResource>
   </ItemGroup>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/IFunction.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/IFunction.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/IFunction.cs	(revision 2202)
@@ -26,10 +26,19 @@
 
 namespace HeuristicLab.GP {
-  public interface IFunction : IOperator {
+  public interface IFunction : IItem {
+    string Name { get; }
     IFunctionTree GetTreeNode();
-    double Apply();
-    IList<IFunction> AllowedSubFunctions(int index);
+    ICollection<IFunction> GetAllowedSubFunctions(int index);
+    void AddAllowedSubFunction(IFunction f, int index);
+    void RemoveAllowedSubFunction(IFunction f, int index);
+    bool IsAllowedSubFunction(IFunction f, int index);
     int MinArity { get; }
     int MaxArity { get; }
+    int MinTreeHeight { get; }
+    int MinTreeSize { get; }
+    double Tickets { get; }
+    IEnumerable<string> LocalParameterNames { get; }
+    IOperator Initializer { get; }
+    IOperator Manipulator { get; }
   }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/IFunctionTree.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/IFunctionTree.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/IFunctionTree.cs	(revision 2202)
@@ -32,4 +32,6 @@
     ICollection<IVariable> LocalVariables { get; }
     IFunction Function { get; }
+    IOperator Manipulator { get; }
+    IOperator Initializer { get; }
     IVariable GetLocalVariable(string name);
     void AddVariable(IVariable variable);
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/ChangeNodeTypeManipulation.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Manipulation/ChangeNodeTypeManipulation.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/ChangeNodeTypeManipulation.cs	(revision 2202)
@@ -45,5 +45,5 @@
       : base() {
       AddVariableInfo(new VariableInfo("Random", "Uniform random number generator", typeof(MersenneTwister), VariableKind.In));
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeHeight", "The maximal allowed height of the tree", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeSize", "The maximal allowed size (number of nodes) of the tree", typeof(IntData), VariableKind.In));
@@ -57,5 +57,5 @@
       IFunctionTree root = GetVariableValue<IFunctionTree>("FunctionTree", scope, false);
       MersenneTwister random = GetVariableValue<MersenneTwister>("Random", scope, true);
-      GPOperatorLibrary library = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary library = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       IntData treeSize = GetVariableValue<IntData>("TreeSize", scope, false);
       IntData treeHeight = GetVariableValue<IntData>("TreeHeight", scope, false);
@@ -148,5 +148,5 @@
       // first let's choose the function we want to use instead of the old child. For this we have to determine the
       // pool of allowed functions based on constraints of the parent if there is one.
-      IList<IFunction> allowedFunctions = gardener.GetAllowedSubFunctions(parent!=null?parent.Function:null, childIndex);
+      List<IFunction> allowedFunctions = new List<IFunction>(gardener.GetAllowedSubFunctions(parent != null ? parent.Function : null, childIndex));
       // try to make a tree with the same arity as the old child.
       int actualArity = child.SubTrees.Count;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/CutOutNodeManipulation.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Manipulation/CutOutNodeManipulation.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/CutOutNodeManipulation.cs	(revision 2202)
@@ -50,5 +50,5 @@
       : base() {
       AddVariableInfo(new VariableInfo("Random", "Uniform random number generator", typeof(MersenneTwister), VariableKind.In));
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeHeight", "The maximal allowed height of the tree", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeSize", "The maximal allowed size (number of nodes) of the tree", typeof(IntData), VariableKind.In));
@@ -62,5 +62,5 @@
       IFunctionTree root = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
       MersenneTwister random = GetVariableValue<MersenneTwister>("Random", scope, true);
-      GPOperatorLibrary library = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary library = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       int maxTreeHeight = GetVariableValue<IntData>("MaxTreeHeight", scope, true).Data;
       int maxTreeSize = GetVariableValue<IntData>("MaxTreeSize", scope, true).Data;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/DeleteSubTreeManipulation.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Manipulation/DeleteSubTreeManipulation.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/DeleteSubTreeManipulation.cs	(revision 2202)
@@ -40,5 +40,5 @@
       : base() {
       AddVariableInfo(new VariableInfo("Random", "Uniform random number generator", typeof(MersenneTwister), VariableKind.In));
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeHeight", "The maximal allowed height of the tree", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeSize", "The maximal allowed size (number of nodes) of the tree", typeof(IntData), VariableKind.In));
@@ -52,5 +52,5 @@
       IFunctionTree root = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
       MersenneTwister random = GetVariableValue<MersenneTwister>("Random", scope, true);
-      GPOperatorLibrary library = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary library = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       TreeGardener gardener = new TreeGardener(random, library);
       IFunctionTree parent = gardener.GetRandomParentNode(root);
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/FullTreeShaker.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Manipulation/FullTreeShaker.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/FullTreeShaker.cs	(revision 2202)
@@ -33,5 +33,5 @@
   public class FullTreeShaker : DelegatingOperator {
     public override string Description {
-      get { return "Manipulates all tree nodes for which a '" + FunctionBase.MANIPULATION + "' variable is defined."; }
+      get { return "Manipulates all tree nodes for which a manipulator is defined."; }
     }
 
@@ -39,5 +39,5 @@
       : base() {
       AddVariableInfo(new VariableInfo("Random", "A random generator (uniform)", typeof(MersenneTwister), VariableKind.In));
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "Operator library that defines operator mutations", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "Operator library that defines operator mutations", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("ShakingFactor", "Variable that determines the force of the shaking operation", typeof(DoubleData), VariableKind.In));
       AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be mutated", typeof(IFunctionTree), VariableKind.In | VariableKind.Out));
@@ -45,5 +45,5 @@
 
     public override IOperation Apply(IScope scope) {
-      GPOperatorLibrary library = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary library = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, false);
       MersenneTwister mt = GetVariableValue<MersenneTwister>("Random", scope, true);
@@ -56,7 +56,7 @@
 
       TreeGardener gardener = new TreeGardener(mt, library);
-      var parametricBranches = gardener.GetAllSubTrees(tree).Where(branch => branch.Function.GetVariable(FunctionBase.MANIPULATION) != null);
+      var parametricBranches = gardener.GetAllSubTrees(tree).Where(branch => branch.Manipulator!= null);
       foreach(IFunctionTree subTree in parametricBranches) {
-        IOperator mutation = (IOperator)subTree.Function.GetVariable(FunctionBase.MANIPULATION).Value;
+        IOperator mutation = subTree.Manipulator;
 
         // store all local variables into a temporary scope
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/OnePointShaker.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Manipulation/OnePointShaker.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/OnePointShaker.cs	(revision 2202)
@@ -33,10 +33,10 @@
   public class OnePointShaker : DelegatingOperator {
     public override string Description {
-      get { return "Selects a random node of all tree-nodes that have a '"+FunctionBase.MANIPULATION+"' variable defined and manipulates the selected node."; }
+      get { return "Selects a random node of all tree-nodes that have a manipulator defined and manipulates the selected node."; }
     }
 
     public OnePointShaker()
       : base() {
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "Operator library that defines mutation operations for operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "Operator library that defines mutation operations for operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("Random", "A random generator (uniform)", typeof(MersenneTwister), VariableKind.In));
       AddVariableInfo(new VariableInfo("ShakingFactor", "Factor that determines the force of the shaking operation", typeof(DoubleData), VariableKind.In));
@@ -45,5 +45,5 @@
 
     public override IOperation Apply(IScope scope) {
-      GPOperatorLibrary library = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary library = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, false);
       MersenneTwister mt = GetVariableValue<MersenneTwister>("Random", scope, true);
@@ -51,10 +51,10 @@
 
       // get all nodes for which a manipulation is defined
-      var parametricBranches = gardener.GetAllSubTrees(tree).Where(branch => branch.Function.GetVariable(FunctionBase.MANIPULATION) != null);
+      var parametricBranches = gardener.GetAllSubTrees(tree).Where(branch => branch.Manipulator != null);
 
       if(parametricBranches.Count() == 0) return null; // don't manipulate anything if there are no nodes with a manipulation operator
 
       IFunctionTree selectedBranch = parametricBranches.ElementAt(mt.Next(parametricBranches.Count()));
-      IOperator mutation = (IOperator)selectedBranch.Function.GetVariable(FunctionBase.MANIPULATION).Value;
+      IOperator mutation = selectedBranch.Manipulator;
       CompositeOperation next = new CompositeOperation();
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/SubstituteSubTreeManipulation.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Manipulation/SubstituteSubTreeManipulation.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/SubstituteSubTreeManipulation.cs	(revision 2202)
@@ -39,5 +39,5 @@
       : base() {
       AddVariableInfo(new VariableInfo("Random", "Uniform random number generator", typeof(MersenneTwister), VariableKind.In));
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeHeight", "The maximal allowed height of the tree", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeSize", "The maximal allowed size (number of nodes) of the tree", typeof(IntData), VariableKind.In));
@@ -50,5 +50,5 @@
       IFunctionTree root = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
       MersenneTwister random = GetVariableValue<MersenneTwister>("Random", scope, true);
-      GPOperatorLibrary library = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary library = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       int maxTreeHeight = GetVariableValue<IntData>("MaxTreeHeight", scope, true).Data;
       int maxTreeSize = GetVariableValue<IntData>("MaxTreeSize", scope, true).Data;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/ProbabilisticTreeCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/ProbabilisticTreeCreator.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/ProbabilisticTreeCreator.cs	(revision 2202)
@@ -39,5 +39,5 @@
       : base() {
       AddVariableInfo(new VariableInfo("Random", "Uniform random number generator", typeof(MersenneTwister), VariableKind.In));
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("MinTreeSize", "The minimal allowed size of the tree", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeSize", "The maximal allowed size of the tree", typeof(IntData), VariableKind.In));
@@ -50,5 +50,5 @@
     public override IOperation Apply(IScope scope) {
       IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-      GPOperatorLibrary opLibrary = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary opLibrary = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       int minTreeSize = GetVariableValue<IntData>("MinTreeSize", scope, true).Data;
       int maxTreeSize = GetVariableValue<IntData>("MaxTreeSize", scope, true).Data;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/RampedTreeCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/RampedTreeCreator.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/RampedTreeCreator.cs	(revision 2202)
@@ -37,5 +37,5 @@
       : base() {
       AddVariableInfo(new VariableInfo("Random", "Uniform random number generator", typeof(MersenneTwister), VariableKind.In));
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("MinTreeHeight", "The minimal allowed height of the tree", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("MaxTreeHeight", "The maximal allowed height of the tree", typeof(IntData), VariableKind.In));
@@ -48,5 +48,5 @@
     public override IOperation Apply(IScope scope) {
       IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-      GPOperatorLibrary opLibrary = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary opLibrary = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       int minTreeHeight = GetVariableValue<IntData>("MinTreeHeight", scope, true).Data;
       int maxTreeHeight = GetVariableValue<IntData>("MaxTreeHeight", scope, true).Data;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/GPCrossoverBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Recombination/GPCrossoverBase.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/GPCrossoverBase.cs	(revision 2202)
@@ -36,5 +36,5 @@
     public GPCrossoverBase()
       : base() {
-      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
+      AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(FunctionLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("FunctionTree", "The tree to mutate", typeof(IFunctionTree), VariableKind.In | VariableKind.New));
       AddVariableInfo(new VariableInfo("TreeSize", "The size (number of nodes) of the tree", typeof(IntData), VariableKind.New));
@@ -45,5 +45,5 @@
 
     protected override void Cross(IScope scope, IRandom random) {
-      GPOperatorLibrary opLibrary = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
+      FunctionLibrary opLibrary = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
       TreeGardener gardener = new TreeGardener(random, opLibrary);
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/SizeFairCrossOver.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Recombination/SizeFairCrossOver.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/SizeFairCrossOver.cs	(revision 2202)
@@ -68,5 +68,5 @@
 
     private IFunctionTree GetReplacementBranch(MersenneTwister random, TreeGardener gardener, IFunctionTree intoTree, IFunctionTree parent, int replacedBranchIndex, IFunctionTree fromTree, int maxTreeSize, int maxTreeHeight) {
-      IList<IFunction> allowedFunctions = gardener.GetAllowedSubFunctions(parent.Function, replacedBranchIndex);
+      IList<IFunction> allowedFunctions = new List<IFunction>(gardener.GetAllowedSubFunctions(parent.Function, replacedBranchIndex));
       int removedBranchSize = parent.SubTrees[replacedBranchIndex].Size;
       int maxBranchSize = maxTreeSize - (intoTree.Size - removedBranchSize);
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/StandardCrossOver.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/Recombination/StandardCrossOver.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Recombination/StandardCrossOver.cs	(revision 2202)
@@ -60,5 +60,5 @@
         int maxInsertedBranchHeight = maxTreeHeight - gardener.GetBranchLevel(tree0, parent0); // branchlevel is 1 if tree0==parent0
 
-        IList<IFunction> allowedFunctions = gardener.GetAllowedSubFunctions(parent0.Function, replacedChildIndex);
+        IList<IFunction> allowedFunctions = new List<IFunction>(gardener.GetAllowedSubFunctions(parent0.Function, replacedChildIndex));
         allowedCrossoverPoints = GetPossibleCrossoverPoints(gardener, tree1, maxInsertedBranchSize, maxInsertedBranchHeight, allowedFunctions);
       } while (allowedCrossoverPoints.Count == 0 && tries++ < MaxRecombinationTries);
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/TreeGardener.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/3.3/TreeGardener.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/TreeGardener.cs	(revision 2202)
@@ -36,5 +36,5 @@
   internal class TreeGardener {
     private IRandom random;
-    private GPOperatorLibrary funLibrary;
+    private FunctionLibrary funLibrary;
     private List<IFunction> functions;
 
@@ -50,5 +50,5 @@
 
     #region constructors
-    internal TreeGardener(IRandom random, GPOperatorLibrary funLibrary) {
+    internal TreeGardener(IRandom random, FunctionLibrary funLibrary) {
       this.random = random;
       this.funLibrary = funLibrary;
@@ -57,5 +57,5 @@
       functions = new List<IFunction>();
       // init functions and terminals based on constraints
-      foreach(IFunction fun in funLibrary.Group.Operators) {
+      foreach(IFunction fun in funLibrary.Functions) {
         if(fun.MaxArity == 0) {
           terminals.Add(fun);
@@ -112,5 +112,5 @@
       }
       int actualArity = random.Next(minArity, maxArity + 1);
-      totalListMinSize += GetMinimalTreeSize(root.Function) - 1;
+      totalListMinSize += root.Function.MinTreeSize - 1;
       for(int i = 0; i < actualArity; i++) {
         // insert a dummy sub-tree and add the pending extension to the list
@@ -134,5 +134,5 @@
         } else {
           IFunction selectedFunction = RandomSelect(GetAllowedSubFunctions(parent.Function, a).Where(
-            f => !IsTerminal(f) && GetMinimalTreeHeight(f) + (d - 1) <= maxDepth).ToArray());
+            f => !IsTerminal(f) && f.MinTreeHeight + (d - 1) <= maxDepth).ToArray());
           IFunctionTree newTree = selectedFunction.GetTreeNode();
           parent.RemoveSubTree(a);
@@ -152,5 +152,5 @@
             list.Add(new object[] { newTree, i, d + 1 });
           }
-          totalListMinSize += GetMinimalTreeSize(newTree.Function) - 1;
+          totalListMinSize += newTree.Function.MinTreeSize - 1;
         }
       }
@@ -178,9 +178,9 @@
     internal IFunctionTree CreateRandomTree(ICollection<IFunction> allowedFunctions, int maxTreeSize, int maxTreeHeight) {
       // get the minimal needed height based on allowed functions and extend the max-height if necessary
-      int minTreeHeight = allowedFunctions.Select(f => GetMinimalTreeHeight(f)).Min();
+      int minTreeHeight = allowedFunctions.Select(f => f.MinTreeHeight).Min();
       if(minTreeHeight > maxTreeHeight)
         maxTreeHeight = minTreeHeight;
       // get the minimal needed size based on allowed functions and extend the max-size if necessary
-      int minTreeSize = allowedFunctions.Select(f => GetMinimalTreeSize(f)).Min();
+      int minTreeSize = allowedFunctions.Select(f => f.MinTreeSize).Min();
       if(minTreeSize > maxTreeSize)
         maxTreeSize = minTreeSize;
@@ -191,6 +191,6 @@
 
       // filter the set of allowed functions and select only from those that fit into the given maximal size and height limits
-      IFunction[] possibleFunctions = allowedFunctions.Where(f => GetMinimalTreeHeight(f) <= treeHeight &&
-        GetMinimalTreeSize(f) <= treeSize).ToArray();
+      IFunction[] possibleFunctions = allowedFunctions.Where(f => f.MinTreeHeight <= treeHeight &&
+        f.MinTreeSize <= treeSize).ToArray();
       IFunction selectedFunction = RandomSelect(possibleFunctions);
 
@@ -206,8 +206,8 @@
       Scope tempScope = new Scope("Temp. initialization scope");
 
-      var parametricTrees = trees.Where(t => t.Function.GetVariable(FunctionBase.INITIALIZATION) != null);
+      var parametricTrees = trees.Where(t => t.Initializer != null);
       foreach(IFunctionTree tree in parametricTrees) {
         // enqueue an initialization operation for each operator with local variables 
-        IOperator initialization = (IOperator)tree.Function.GetVariable(FunctionBase.INITIALIZATION).Value;
+        IOperator initialization = tree.Initializer;
         Scope initScope = new Scope();
         // copy the local variables into a temporary scope used for initialization
@@ -280,5 +280,5 @@
     internal bool IsValidTree(IFunctionTree tree) {
       for(int i = 0; i < tree.SubTrees.Count; i++) {
-        if(!tree.Function.AllowedSubFunctions(i).Contains(tree.SubTrees[i].Function)) return false;
+        if(!tree.Function.GetAllowedSubFunctions(i).Contains(tree.SubTrees[i].Function)) return false;
       }
 
@@ -329,5 +329,5 @@
       // we only count those slots that can hold at least one of the children that we should combine
       for(int slot = 0; slot < nSlots; slot++) {
-        HashSet<IFunction> functionSet = new HashSet<IFunction>(f.AllowedSubFunctions(slot));
+        HashSet<IFunction> functionSet = new HashSet<IFunction>(f.GetAllowedSubFunctions(slot));
         if(functionSet.Count() > 0) {
           slotSets.Add(functionSet);
@@ -378,9 +378,9 @@
       return f.MinArity == 0 && f.MaxArity == 0;
     }
-    internal IList<IFunction> GetAllowedSubFunctions(IFunction f, int index) {
+    internal ICollection<IFunction> GetAllowedSubFunctions(IFunction f, int index) {
       if(f == null) {
         return allFunctions;
       } else {
-        return f.AllowedSubFunctions(index);
+        return f.GetAllowedSubFunctions(index);
       }
     }
@@ -393,6 +393,6 @@
         return selectedTerminal;
       } else {
-        IFunction[] possibleFunctions = functions.Where(f => GetMinimalTreeHeight(f) <= maxTreeHeight &&
-          GetMinimalTreeSize(f) <= maxTreeSize).ToArray();
+        IFunction[] possibleFunctions = functions.Where(f => f.MinTreeHeight <= maxTreeHeight &&
+          f.MinTreeSize <= maxTreeSize).ToArray();
         IFunction selectedFunction = RandomSelect(possibleFunctions);
         return selectedFunction;
@@ -409,5 +409,5 @@
         IFunctionTree parentTree = parent.GetTreeNode();
         for(int i = 0; i < actualArity; i++) {
-          IFunction[] possibleFunctions = GetAllowedSubFunctions(parent, i).Where(f => GetMinimalTreeHeight(f) <= maxTreeHeight).ToArray();
+          IFunction[] possibleFunctions = GetAllowedSubFunctions(parent, i).Where(f => f.MinTreeHeight <= maxTreeHeight).ToArray();
           IFunction selectedFunction = RandomSelect(possibleFunctions);
           IFunctionTree newSubTree = MakeUnbalancedTree(selectedFunction, maxTreeHeight - 1);
@@ -431,5 +431,5 @@
         for(int i = 0; i < actualArity; i++) {
           // first try to find a function that fits into the maxHeight limit
-          IFunction[] possibleFunctions = GetAllowedSubFunctions(parent, i).Where(f => GetMinimalTreeHeight(f) <= maxTreeHeight &&
+          IFunction[] possibleFunctions = GetAllowedSubFunctions(parent, i).Where(f => f.MinTreeHeight <= maxTreeHeight &&
             !IsTerminal(f)).ToArray();
           // no possible function found => extend function set to terminals
@@ -450,12 +450,4 @@
     }
 
-    private int GetMinimalTreeHeight(IOperator op) {
-      return ((IntData)op.GetVariable(GPOperatorLibrary.MIN_TREE_HEIGHT).Value).Data;
-    }
-
-    private int GetMinimalTreeSize(IOperator op) {
-      return ((IntData)op.GetVariable(GPOperatorLibrary.MIN_TREE_SIZE).Value).Data;
-    }
-
     private void TreeForEach(IFunctionTree tree, Action<IFunctionTree> action) {
       action(tree);
@@ -479,5 +471,5 @@
       // precalculate the slot-sizes
       foreach(IFunction function in functionSet) {
-        ticketAccumulator += ((DoubleData)function.GetVariable(GPOperatorLibrary.TICKETS).Value).Data;
+        ticketAccumulator += function.Tickets;
         accumulatedTickets[i] = ticketAccumulator;
         i++;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.Hive.Server.Core/3.2/app.config
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/3.2/app.config	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.Hive.Server.Core/3.2/app.config	(revision 2202)
@@ -9,5 +9,5 @@
     <HeuristicLab.Hive.Server.Core.Properties.Settings>
       <setting name="HiveServerConnectionString" serializeAs="String">
-        <value>Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Hive;Persist Security Info=True;User ID=hive;Password=hive;Pooling=true;MultipleActiveResultSets=true</value>
+        <value>Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Hive_Milestone3;Persist Security Info=True;User ID=hive;Password=hive;Pooling=true;MultipleActiveResultSets=true</value>
       </setting>
     </HeuristicLab.Hive.Server.Core.Properties.Settings>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.LinearRegression/3.2/LinearRegressionOperator.cs
===================================================================
--- trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegressionOperator.cs	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.LinearRegression/3.2/LinearRegressionOperator.cs	(revision 2202)
@@ -54,5 +54,5 @@
       double[] targetVector = PrepareTargetVector(dataset, targetVariable, allowedRows);
       double[] coefficients = CalculateCoefficients(inputMatrix, targetVector);
-      IFunctionTree tree = CreateModel(coefficients, allowedColumns);
+      IFunctionTree tree = CreateModel(coefficients, allowedColumns.Select(i => dataset.GetVariableName(i)).ToList());
 
       scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("LinearRegressionModel"), tree));
@@ -66,5 +66,5 @@
     }
 
-    private IFunctionTree CreateModel(double[] coefficients, List<int> allowedColumns) {
+    private IFunctionTree CreateModel(double[] coefficients, List<string> allowedVariables) {
       IFunctionTree root = new Addition().GetTreeNode();
       IFunctionTree actNode = root;
@@ -73,13 +73,14 @@
       GP.StructureIdentification.Variable v;
       for (int i = 0; i < coefficients.Length - 1; i++) {
-        v = new GP.StructureIdentification.Variable();
-        v.GetVariable(GP.StructureIdentification.Variable.INDEX).Value = new ConstrainedIntData(allowedColumns[i]);
-        v.GetVariable(GP.StructureIdentification.Variable.WEIGHT).Value = new ConstrainedDoubleData(coefficients[i]);
-        v.GetVariable(GP.StructureIdentification.Variable.OFFSET).Value = new ConstrainedIntData(0);
-        nodes.Enqueue(v.GetTreeNode());
+        var vNode = new GP.StructureIdentification.Variable().GetTreeNode();
+        vNode.GetLocalVariable(GP.StructureIdentification.Variable.INDEX).Value = new StringData(allowedVariables[i]);
+        vNode.GetLocalVariable(GP.StructureIdentification.Variable.WEIGHT).Value = new DoubleData(coefficients[i]);
+        vNode.GetLocalVariable(GP.StructureIdentification.Variable.OFFSET).Value = new ConstrainedIntData(0);
+        nodes.Enqueue(vNode);
       }
-      GP.StructureIdentification.Constant c = new Constant();
-      c.GetVariable(GP.StructureIdentification.Constant.VALUE).Value = new ConstrainedDoubleData(coefficients[coefficients.Length - 1]);
-      nodes.Enqueue(c.GetTreeNode());
+      var cNode = new Constant().GetTreeNode();
+
+      cNode.GetLocalVariable(GP.StructureIdentification.Constant.VALUE).Value = new DoubleData(coefficients[coefficients.Length - 1]);
+      nodes.Enqueue(cNode);
 
       IFunctionTree newTree;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.Tracing/3.2/HeuristicLab.Hive.log4net.xml
===================================================================
--- trunk/sources/HeuristicLab.Tracing/3.2/HeuristicLab.Hive.log4net.xml	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.Tracing/3.2/HeuristicLab.Hive.log4net.xml	(revision 2202)
@@ -18,5 +18,5 @@
     <lossy value="true" />
     <evaluator type="log4net.Core.LevelEvaluator">
-        <threshold value="INFO"/>
+        <threshold value="DEBUG"/>
     </evaluator>
     <appender-ref ref="RollingFileAppender" />
@@ -24,5 +24,5 @@
   
   <root>
-    <level value="INFO" />
+    <level value="DEBUG" />
     <appender-ref ref="BufferingForwardingAppender" />
   </root>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.sln
===================================================================
--- trunk/sources/HeuristicLab.sln	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.sln	(revision 2202)
@@ -922,4 +922,5 @@
 		{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.Modeling Debug|x64.Build.0 = Debug|x64
 		{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.Modeling Debug|x86.ActiveCfg = Debug|x86
+		{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.Modeling Debug|x86.Build.0 = Debug|x86
 		{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}.Release|Any CPU.Build.0 = Release|Any CPU
Index: branches/GP-Refactoring-713/sources/HeuristicLab/CopyAssemblies.cmd
===================================================================
--- trunk/sources/HeuristicLab/CopyAssemblies.cmd	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab/CopyAssemblies.cmd	(revision 2202)
@@ -8,5 +8,5 @@
 
 copy "%SolutionDir%\HeuristicLab.AdvancedOptimizationFrontend\3.2\%Outdir%\HeuristicLab.AdvancedOptimizationFrontend-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.AdvancedOptimizationFrontend\3.3\%Outdir%\HeuristicLab.AdvancedOptimizationFrontend-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.AdvancedOptimizationFrontend\3.3\%Outdir%\HeuristicLab.AdvancedOptimizationFrontend-3.3.dll" .\plugins
 copy "%SolutionDir%\WinFormsUI\%Outdir%\WeifenLuo.WinFormsUI.Docking.dll" .\plugins
 copy "%SolutionDir%\WinFormsUI\%Outdir%\WeifenLuo.WinFormsUI.Docking License.txt" .\plugins
@@ -21,29 +21,29 @@
 copy "%SolutionDir%\HeuristicLab.CEDMA.Server\3.3\%Outdir%\HeuristicLab.CEDMA.Server-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Charting\3.2\%Outdir%\HeuristicLab.Charting-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Charting\3.3\%Outdir%\HeuristicLab.Charting-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Charting\3.3\%Outdir%\HeuristicLab.Charting-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Charting.Data\3.2\%Outdir%\HeuristicLab.Charting.Data-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Charting.Data\3.3\%Outdir%\HeuristicLab.Charting.Data-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Charting.Data\3.3\%Outdir%\HeuristicLab.Charting.Data-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Communication.Data\3.2\%Outdir%\HeuristicLab.Communication.Data-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Communication.Operators\3.2\%Outdir%\HeuristicLab.Communication.Operators-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Core\3.2\%Outdir%\HeuristicLab.Core-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Core\3.3\%Outdir%\HeuristicLab.Core-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Core\3.3\%Outdir%\HeuristicLab.Core-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Constraints\3.2\%Outdir%\HeuristicLab.Constraints-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Constraints\3.3\%Outdir%\HeuristicLab.Constraints-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Constraints\3.3\%Outdir%\HeuristicLab.Constraints-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Data\3.2\%Outdir%\HeuristicLab.Data-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Data\3.3\%Outdir%\HeuristicLab.Data-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Data\3.3\%Outdir%\HeuristicLab.Data-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.DataAccess\3.2\%Outdir%\HeuristicLab.DataAccess-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.DataAccess.ADOHelper\3.2\%Outdir%\HeuristicLab.DataAccess.ADOHelper-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.DataAnalysis\3.2\%Outdir%\HeuristicLab.DataAnalysis-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.DataAnalysis\3.3\%Outdir%\HeuristicLab.DataAnalysis-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.DataAnalysis\3.3\%Outdir%\HeuristicLab.DataAnalysis-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.DistributedEngine\3.2\%Outdir%\HeuristicLab.DistributedEngine-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.ES\3.2\%Outdir%\HeuristicLab.ES-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Evolutionary\3.2\%Outdir%\HeuristicLab.Evolutionary-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Evolutionary\3.3\%Outdir%\HeuristicLab.Evolutionary-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Evolutionary\3.3\%Outdir%\HeuristicLab.Evolutionary-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.GP\3.3\%Outdir%\HeuristicLab.GP-3.3.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.GP\3.4\%Outdir%\HeuristicLab.GP-3.4.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.GP\3.4\%Outdir%\HeuristicLab.GP-3.4.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.GP.Boolean\3.3\%Outdir%\HeuristicLab.GP.Boolean-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.GP.SantaFe\3.3\%Outdir%\HeuristicLab.GP.SantaFe-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.GP.StructureIdentification\3.3\%Outdir%\HeuristicLab.GP.StructureIdentification-3.3.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.GP.StructureIdentification\3.4\%Outdir%\HeuristicLab.GP.StructureIdentification-3.4.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.GP.StructureIdentification\3.4\%Outdir%\HeuristicLab.GP.StructureIdentification-3.4.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.GP.StructureIdentification.Classification\3.3\%Outdir%\HeuristicLab.GP.StructureIdentification.Classification-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.GP.StructureIdentification.ConditionalEvaluation\3.3\%Outdir%\HeuristicLab.GP.StructureIdentification.ConditionalEvaluation-3.3.dll" .\plugins
@@ -72,35 +72,35 @@
 copy "%SolutionDir%\HeuristicLab.LinearRegression\3.2\%Outdir%\ALGLIB License.txt" .\plugins
 copy "%SolutionDir%\HeuristicLab.Logging\3.2\%Outdir%\HeuristicLab.Logging-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Logging\3.3\%Outdir%\HeuristicLab.Logging-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Logging\3.3\%Outdir%\HeuristicLab.Logging-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Modeling\3.2\%Outdir%\HeuristicLab.Modeling-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Modeling\3.3\%Outdir%\HeuristicLab.Modeling-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Modeling\3.3\%Outdir%\HeuristicLab.Modeling-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Operators\3.2\%Outdir%\HeuristicLab.Operators-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Operators\3.3\%Outdir%\HeuristicLab.Operators-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Operators\3.3\%Outdir%\HeuristicLab.Operators-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Operators.Metaprogramming\3.2\%Outdir%\HeuristicLab.Operators.Metaprogramming-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Operators.Programmable\3.2\%Outdir%\HeuristicLab.Operators.Programmable-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Operators.Programmable\3.3\%Outdir%\HeuristicLab.Operators.Programmable-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Operators.Programmable\3.3\%Outdir%\HeuristicLab.Operators.Programmable-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Operators.Stopwatch\3.2\%Outdir%\HeuristicLab.Operators.Stopwatch-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.OptimizationFrontend\3.2\%Outdir%\HeuristicLab.OptimizationFrontend-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.OptimizationFrontend\3.3\%Outdir%\HeuristicLab.OptimizationFrontend-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.OptimizationFrontend\3.3\%Outdir%\HeuristicLab.OptimizationFrontend-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Permutation\3.2\%Outdir%\HeuristicLab.Permutation-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Permutation\3.3\%Outdir%\HeuristicLab.Permutation-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Permutation\3.3\%Outdir%\HeuristicLab.Permutation-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Persistence\3.3\%Outdir%\HeuristicLab.Persistence-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Persistence.GUI\3.3\%Outdir%\HeuristicLab.Persistence.GUI-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Random\3.2\%Outdir%\HeuristicLab.Random-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Random\3.3\%Outdir%\HeuristicLab.Random-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Random\3.3\%Outdir%\HeuristicLab.Random-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.RealVector\3.2\%Outdir%\HeuristicLab.RealVector-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Routing.TSP\3.2\%Outdir%\HeuristicLab.Routing.TSP-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Routing.TSP\3.3\%Outdir%\HeuristicLab.Routing.TSP-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Routing.TSP\3.3\%Outdir%\HeuristicLab.Routing.TSP-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.SA\3.2\%Outdir%\HeuristicLab.SA-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Scheduling.JSSP\3.2\%Outdir%\HeuristicLab.Scheduling.JSSP-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Selection\3.2\%Outdir%\HeuristicLab.Selection-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Selection\3.3\%Outdir%\HeuristicLab.Selection-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Selection\3.3\%Outdir%\HeuristicLab.Selection-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Selection.OffspringSelection\3.2\%Outdir%\HeuristicLab.Selection.OffspringSelection-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.Selection.OffspringSelection\3.3\%Outdir%\HeuristicLab.Selection.OffspringSelection-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.Selection.OffspringSelection\3.3\%Outdir%\HeuristicLab.Selection.OffspringSelection-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Selection.Uncertainty\3.2\%Outdir%\HeuristicLab.Selection.Uncertainty-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.SequentialEngine\3.2\%Outdir%\HeuristicLab.SequentialEngine-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.SequentialEngine\3.3\%Outdir%\HeuristicLab.SequentialEngine-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.SequentialEngine\3.3\%Outdir%\HeuristicLab.SequentialEngine-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.SGA\3.2\%Outdir%\HeuristicLab.SGA-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.SGA\3.3\%Outdir%\HeuristicLab.SGA-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.SGA\3.3\%Outdir%\HeuristicLab.SGA-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.FixedOperators\3.2\%Outdir%\HeuristicLab.FixedOperators-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.SimOpt\3.2\%Outdir%\HeuristicLab.SimOpt-3.2.dll" .\plugins
@@ -112,7 +112,7 @@
 copy "%SolutionDir%\LibSVM\%Outdir%\LibSVM.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.TestFunctions\3.2\%Outdir%\HeuristicLab.TestFunctions-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.TestFunctions\3.3\%Outdir%\HeuristicLab.TestFunctions-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.TestFunctions\3.3\%Outdir%\HeuristicLab.TestFunctions-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.ThreadParallelEngine\3.2\%Outdir%\HeuristicLab.ThreadParallelEngine-3.2.dll" .\plugins
-copy "%SolutionDir%\HeuristicLab.ThreadParallelEngine\3.3\%Outdir%\HeuristicLab.ThreadParallelEngine-3.3.dll" .\plugins
+REM copy "%SolutionDir%\HeuristicLab.ThreadParallelEngine\3.3\%Outdir%\HeuristicLab.ThreadParallelEngine-3.3.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Tracing\3.2\%Outdir%\HeuristicLab.Tracing-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Tracing\3.2\%Outdir%\log4net.dll" .\plugins
Index: branches/GP-Refactoring-713/sources/HeuristicLab/app.config
===================================================================
--- trunk/sources/HeuristicLab/app.config	(revision 2174)
+++ branches/GP-Refactoring-713/sources/HeuristicLab/app.config	(revision 2202)
@@ -10,5 +10,7 @@
   <system.serviceModel>
   </system.serviceModel>
-  
+  <runtime>
+    <gcServer enabled="true" />
+  </runtime>  
   <system.data>
     <DbProviderFactories>
