Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/And.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/And.cs	(revision 2215)
+++ 	(revision )
@@ -1,43 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.Boolean{
-  public sealed class And : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public And()
-      : base() {
-      MinArity = 2; MaxArity = 2;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/BooleanTreeInterpreter.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/BooleanTreeInterpreter.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/BooleanTreeInterpreter.cs	(revision 2216)
@@ -24,9 +24,10 @@
 using System.Linq;
 using System.Text;
-using HeuristicLab.DataAnalysis;
 using HeuristicLab.Core;
 using System.Xml;
 using System.Diagnostics;
 using HeuristicLab.Data;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.DataAnalysis;
 
 namespace HeuristicLab.GP.Boolean {
@@ -34,12 +35,11 @@
     private const double EPSILON = 0.00001;
     private Dataset dataset;
-    private List<LightWeightFunction> expression;
+    private IFunctionTree tree;
     private int targetVariable;
     private int currentRow;
-    private int pc;
 
-    public void Reset(Dataset dataset, BakedFunctionTree tree, int targetVariable) {
+    public void Reset(Dataset dataset, IFunctionTree tree, int targetVariable) {
       this.dataset = dataset;
-      this.expression = tree.LinearRepresentation;
+      this.tree = tree;
       this.targetVariable = targetVariable;
     }
@@ -48,7 +48,6 @@
       int errors = 0;
       for (int i = start; i < end; i++) {
-        pc = 0;
         currentRow = i;
-        int result = Step() ? 1 : 0;
+        int result = Step(tree) ? 1 : 0;
         if (Math.Abs(result - dataset.GetValue(i, targetVariable)) > EPSILON) errors++;
       }
@@ -56,21 +55,26 @@
     }
 
-    internal bool Step() {
-      LightWeightFunction curFun = expression[pc++];
-      int symbol = SymbolTable.MapFunction(curFun.functionType);
+    internal bool Step(IFunctionTree t) {
+      int symbol = SymbolTable.MapFunction(t.Function);
       switch (symbol) {
-        case SymbolTable.AND: return Step() & Step();
-        case SymbolTable.OR: return Step() | Step();
-        case SymbolTable.NOT: return !Step();
-        case SymbolTable.XOR: return Step() ^ Step();
-        case SymbolTable.NAND: return !(Step() & Step());
-        case SymbolTable.NOR: return !(Step() | Step());
-        case SymbolTable.VARIABLE:
-          return dataset.GetValue(currentRow, (int)curFun.localData[0]) != 0.0;
+        case SymbolTable.AND: return Step(t.SubTrees[0]) && Step(t.SubTrees[1]);
+        case SymbolTable.OR: return Step(t.SubTrees[0]) || Step(t.SubTrees[1]);
+        case SymbolTable.NOT: return !Step(t.SubTrees[0]);
+        case SymbolTable.XOR: return Step(t.SubTrees[0]) ^ Step(t.SubTrees[1]);
+        case SymbolTable.NAND: return !(Step(t.SubTrees[0]) && Step(t.SubTrees[1]));
+        case SymbolTable.NOR: return !(Step(t.SubTrees[0]) || Step(t.SubTrees[1]));
+        case SymbolTable.VARIABLE: {
+            var varNode = (VariableFunctionTree)t;
+            int index = dataset.GetVariableIndex(varNode.VariableName);
+            return !IsAlmost(dataset.GetValue(currentRow, index), 0.0);
+          }
         case SymbolTable.UNKNOWN:
         default:
-          throw new InvalidOperationException(curFun.functionType.ToString());
+          throw new UnknownFunctionException(t.Function.Name);
+      }
+    }
 
-      }
+    private bool IsAlmost(double x, double y) {
+      return Math.Abs(x - y) < EPSILON;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Evaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Evaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Evaluator.cs	(revision 2216)
@@ -26,4 +26,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.GP.Interfaces;
 using HeuristicLab.DataAnalysis;
 
@@ -32,5 +33,5 @@
     public Evaluator()
       : base() {
-      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(BakedFunctionTree), VariableKind.In));
+      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the boolean expression to evaluate", typeof(IGeneticProgrammingModel), VariableKind.In));
       AddVariableInfo(new VariableInfo("Dataset", "The boolean dataset (values 0.0 = false, 1.0=true)", typeof(Dataset), VariableKind.In));
       AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In));
@@ -41,5 +42,5 @@
 
     public override IOperation Apply(IScope scope) {
-      BakedFunctionTree tree = GetVariableValue<BakedFunctionTree>("FunctionTree", scope, true);
+      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, true);
       Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true);
       int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data;
@@ -48,5 +49,5 @@
 
       BooleanTreeInterpreter interpreter = new BooleanTreeInterpreter();
-      interpreter.Reset(dataset, tree, targetVariable);
+      interpreter.Reset(dataset, gpModel.FunctionTree, targetVariable);
       int errors = interpreter.GetNumberOfErrors(start, end);
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/FunctionLibraryInjector.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/FunctionLibraryInjector.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/FunctionLibraryInjector.cs	(revision 2216)
@@ -27,14 +27,9 @@
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
-using HeuristicLab.Constraints;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.GP.SantaFe;
 
 namespace HeuristicLab.GP.Boolean {
-  public class FunctionLibraryInjector : OperatorBase {
-    private const string TARGETVARIABLE = "TargetVariable";
-    private const string OPERATORLIBRARY = "FunctionLibrary";
-
-    private FunctionLibrary operatorLibrary;
-    private Variable variable;
-
+  public class FunctionLibraryInjector : FunctionLibraryInjectorBase {
     public override string Description {
       get { return @"Injects a function library for boolean logic."; }
@@ -43,33 +38,22 @@
     public FunctionLibraryInjector()
       : base() {
-      AddVariableInfo(new VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), VariableKind.In));
-      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(FunctionLibrary), VariableKind.New));
     }
 
-    public override IOperation Apply(IScope scope) {
-      int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;
-
-      InitDefaultOperatorLibrary();
-
-      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(OPERATORLIBRARY), operatorLibrary));
-      return null;
-    }
-
-    private void InitDefaultOperatorLibrary() {
+    protected override FunctionLibrary CreateFunctionLibrary() {
       And and = new And();
       Or or = new Or();
-      //Not not = new Not();
+      Not not = new Not();
       Nand nand = new Nand();
       Nor nor = new Nor();
-      //Xor xor = new Xor();
-      variable = new HeuristicLab.GP.Boolean.Variable();
+      Xor xor = new Xor();
+      Variable variable = new Variable();
 
       IFunction[] allFunctions = new IFunction[] {
         and,
         or,
-        //not,
+        not,
         nand,
         nor,
-        //xor,
+        xor,
         variable
       };
@@ -77,35 +61,18 @@
       SetAllowedSubOperators(and, allFunctions);
       SetAllowedSubOperators(or, allFunctions);
-      //SetAllowedSubOperators(not, allFunctions);
+      SetAllowedSubOperators(not, allFunctions);
       SetAllowedSubOperators(nand, allFunctions);
       SetAllowedSubOperators(nor, allFunctions);
-      //SetAllowedSubOperators(xor, allFunctions);
+      SetAllowedSubOperators(xor, allFunctions);
 
-      operatorLibrary = new FunctionLibrary();
-      operatorLibrary.FunctionGroup.AddFunction(and);
-      operatorLibrary.FunctionGroup.AddFunction(or);
-      //operatorLibrary.GPOperatorGroup.AddOperator(not);
-      operatorLibrary.FunctionGroup.AddFunction(nand);
-      operatorLibrary.FunctionGroup.AddFunction(nor);
-      //operatorLibrary.GPOperatorGroup.AddOperator(xor);
-      operatorLibrary.FunctionGroup.AddFunction(variable);
-    }
-
-    private void SetAllowedSubOperators(IFunction f, IFunction[] gs) {
-      foreach (IConstraint c in f.Constraints) {
-        if (c is SubOperatorTypeConstraint) {
-          SubOperatorTypeConstraint typeConstraint = c as SubOperatorTypeConstraint;
-          typeConstraint.Clear();
-          foreach (IFunction g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        } else if (c is AllSubOperatorsTypeConstraint) {
-          AllSubOperatorsTypeConstraint typeConstraint = c as AllSubOperatorsTypeConstraint;
-          typeConstraint.Clear();
-          foreach (IFunction g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        }
-      }
+      var functionLibrary = new FunctionLibrary();
+      functionLibrary.AddFunction(and);
+      functionLibrary.AddFunction(or);
+      functionLibrary.AddFunction(not);
+      functionLibrary.AddFunction(nand);
+      functionLibrary.AddFunction(nor);
+      functionLibrary.AddFunction(xor);
+      functionLibrary.AddFunction(variable);
+      return functionLibrary;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/HeuristicLab.GP.Boolean-3.3.csproj
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/HeuristicLab.GP.Boolean-3.3.csproj	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/HeuristicLab.GP.Boolean-3.3.csproj	(revision 2216)
@@ -81,16 +81,17 @@
   <ItemGroup>
     <Compile Include="BooleanTreeInterpreter.cs" />
-    <Compile Include="Not.cs" />
-    <Compile Include="Xor.cs" />
-    <Compile Include="Or.cs" />
-    <Compile Include="Nand.cs" />
-    <Compile Include="Nor.cs" />
+    <Compile Include="Symbols\And.cs" />
+    <Compile Include="Symbols\Nand.cs" />
+    <Compile Include="Symbols\Nor.cs" />
+    <Compile Include="Symbols\Not.cs" />
+    <Compile Include="Symbols\Or.cs" />
+    <Compile Include="Symbols\SymbolTable.cs" />
+    <Compile Include="Symbols\Variable.cs" />
+    <Compile Include="Symbols\VariableFunctionTree.cs" />
+    <Compile Include="Symbols\Xor.cs" />
     <Compile Include="Evaluator.cs" />
     <Compile Include="FunctionLibraryInjector.cs" />
     <Compile Include="HeuristicLabGPBooleanPlugin.cs" />
-    <Compile Include="And.cs" />
-    <Compile Include="Variable.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="SymbolTable.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -99,8 +100,4 @@
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\HeuristicLab.Constraints\3.2\HeuristicLab.Constraints-3.2.csproj">
-      <Project>{FCD62C6F-4793-4593-AE9A-0BDCA256EE99}</Project>
-      <Name>HeuristicLab.Constraints-3.2</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
       <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
@@ -114,4 +111,8 @@
       <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
       <Name>HeuristicLab.Data-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.GP.Interfaces\3.3\HeuristicLab.GP.Interfaces-3.3.csproj">
+      <Project>{924B6BEA-9A99-40FE-9334-5C01E8D540EC}</Project>
+      <Name>HeuristicLab.GP.Interfaces-3.3</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.GP\3.3\HeuristicLab.GP-3.3.csproj">
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/HeuristicLabGPBooleanPlugin.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/HeuristicLabGPBooleanPlugin.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/HeuristicLabGPBooleanPlugin.cs	(revision 2216)
@@ -28,9 +28,9 @@
   [ClassInfo(Name = "HeuristicLab.GP.Boolean-3.3")]
   [PluginFile(Filename = "HeuristicLab.GP.Boolean-3.3.dll", Filetype = PluginFileType.Assembly)]
-  [Dependency(Dependency = "HeuristicLab.Constraints-3.2")]
-  [Dependency(Dependency = "HeuristicLab.GP-3.3")]
   [Dependency(Dependency = "HeuristicLab.Core-3.2")]
   [Dependency(Dependency = "HeuristicLab.Data-3.2")]
   [Dependency(Dependency = "HeuristicLab.DataAnalysis-3.2")]
+  [Dependency(Dependency = "HeuristicLab.GP-3.3")]
+  [Dependency(Dependency = "HeuristicLab.GP.Interfaces-3.3")]
   [Dependency(Dependency = "HeuristicLab.Operators-3.2")]
   [Dependency(Dependency = "HeuristicLab.Random-3.2")]
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nand.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nand.cs	(revision 2215)
+++ 	(revision )
@@ -1,43 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.Boolean{
-  public sealed class Nand : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Nand()
-      : base() {
-      MinArity = 2; MaxArity = 2;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nor.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Nor.cs	(revision 2215)
+++ 	(revision )
@@ -1,43 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.Boolean{
-  public sealed class Nor : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Nor()
-      : base() {
-      MinArity = 2; MaxArity = 2;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Not.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Not.cs	(revision 2215)
+++ 	(revision )
@@ -1,43 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.Boolean{
-  public sealed class Not : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Not()
-      : base() {
-      MinArity = 1; MaxArity = 1;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Or.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Or.cs	(revision 2215)
+++ 	(revision )
@@ -1,43 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.Boolean{
-  public sealed class Or : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Or()
-      : base() {
-      MinArity = 2; MaxArity = 2;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/SymbolTable.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/SymbolTable.cs	(revision 2215)
+++ 	(revision )
@@ -1,58 +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.Boolean {
-  class SymbolTable : StorableBase {
-    public const int VARIABLE = 1;
-    public const int NOT = 2;
-    public const int AND = 3;
-    public const int OR = 4;
-    public const int NAND = 5;
-    public const int NOR = 6;
-    public const int XOR = 7;
-    public const int UNKNOWN = 8;
-    private static Dictionary<Type, int> staticTypes = new Dictionary<Type, int>();
-
-    // needs to be public for persistence mechanism (Activator.CreateInstance needs empty constructor)
-    static SymbolTable() {
-      staticTypes = new Dictionary<Type, int>();
-      staticTypes[typeof(Variable)] = VARIABLE;
-      staticTypes[typeof(Not)] = NOT;
-      staticTypes[typeof(And)] = AND;
-      staticTypes[typeof(Or)] = OR;
-      staticTypes[typeof(Nand)] = NAND;
-      staticTypes[typeof(Nor)] = NOR;
-      staticTypes[typeof(Xor)] = XOR;
-    }
-
-    internal static int MapFunction(IFunction function) {
-      if(staticTypes.ContainsKey(function.GetType())) return staticTypes[function.GetType()];
-      else return UNKNOWN;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/And.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/And.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/And.cs	(revision 2216)
@@ -0,0 +1,26 @@
+#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.Boolean{
+  public sealed class And : BinaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Nand.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Nand.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Nand.cs	(revision 2216)
@@ -0,0 +1,26 @@
+#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.Boolean{
+  public sealed class Nand : BinaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Nor.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Nor.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Nor.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.Boolean{
+  public sealed class Nor : BinaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Not.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Not.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Not.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.Boolean{
+  public sealed class Not : UnaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Or.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Or.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Or.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.Boolean{
+  public sealed class Or : BinaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/SymbolTable.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/SymbolTable.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/SymbolTable.cs	(revision 2216)
@@ -0,0 +1,56 @@
+﻿#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 HeuristicLab.Core;
+using HeuristicLab.GP.Interfaces;
+
+namespace HeuristicLab.GP.Boolean {
+  class SymbolTable : StorableBase {
+    public const int VARIABLE = 1;
+    public const int NOT = 2;
+    public const int AND = 3;
+    public const int OR = 4;
+    public const int NAND = 5;
+    public const int NOR = 6;
+    public const int XOR = 7;
+    public const int UNKNOWN = 8;
+    private static Dictionary<Type, int> staticTypes = new Dictionary<Type, int>();
+
+    // needs to be public for persistence mechanism (Activator.CreateInstance needs empty constructor)
+    static SymbolTable() {
+      staticTypes = new Dictionary<Type, int>();
+      staticTypes[typeof(Variable)] = VARIABLE;
+      staticTypes[typeof(Not)] = NOT;
+      staticTypes[typeof(And)] = AND;
+      staticTypes[typeof(Or)] = OR;
+      staticTypes[typeof(Nand)] = NAND;
+      staticTypes[typeof(Nor)] = NOR;
+      staticTypes[typeof(Xor)] = XOR;
+    }
+
+    internal static int MapFunction(IFunction function) {
+      if(staticTypes.ContainsKey(function.GetType())) return staticTypes[function.GetType()];
+      else return UNKNOWN;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Variable.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Variable.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Variable.cs	(revision 2216)
@@ -0,0 +1,76 @@
+#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.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Operators;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.GP.Boolean {
+  public sealed class Variable : Terminal {
+    public const string VARIABLENAME = "Variable";
+
+    public Variable()
+      : base() {
+      SetupInitialization();
+      SetupManipulation();
+    }
+
+    public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() {
+      return new VariableFunctionTree(this);
+    }
+
+    private void SetupInitialization() {
+      CombinedOperator combinedOp = new CombinedOperator();
+      SequentialProcessor seq = new SequentialProcessor();
+      UniformItemChooser variableRandomizer = new UniformItemChooser();
+      variableRandomizer.GetVariableInfo("Value").ActualName = VARIABLENAME;
+      variableRandomizer.GetVariableInfo("Values").ActualName = "InputVariables";
+      variableRandomizer.Name = "Variable randomizer";
+
+      combinedOp.OperatorGraph.AddOperator(seq);
+      combinedOp.OperatorGraph.AddOperator(variableRandomizer);
+      combinedOp.OperatorGraph.InitialOperator = seq;
+      seq.AddSubOperator(variableRandomizer);
+      Initializer = combinedOp;
+    }
+
+    private void SetupManipulation() {
+      // manipulation operator
+      CombinedOperator combinedOp = new CombinedOperator();
+      SequentialProcessor seq = new SequentialProcessor();
+      UniformItemChooser variableRandomizer = new UniformItemChooser();
+      variableRandomizer.GetVariableInfo("Value").ActualName = VARIABLENAME;
+      variableRandomizer.GetVariableInfo("Values").ActualName = "InputVariables";
+      variableRandomizer.Name = "Variable randomizer";
+
+      combinedOp.OperatorGraph.AddOperator(seq);
+      combinedOp.OperatorGraph.AddOperator(variableRandomizer);
+      combinedOp.OperatorGraph.InitialOperator = seq;
+      seq.AddSubOperator(variableRandomizer);
+      Manipulator = combinedOp;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/VariableFunctionTree.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/VariableFunctionTree.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/VariableFunctionTree.cs	(revision 2216)
@@ -0,0 +1,72 @@
+#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.Collections.Generic;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.GP.Interfaces;
+
+namespace HeuristicLab.GP.Boolean {
+  public class VariableFunctionTree : TerminalTreeNode {
+    public string VariableName { get; set; }
+
+    public VariableFunctionTree(Variable variable)
+      : base(variable) {
+    }
+
+    protected VariableFunctionTree(VariableFunctionTree original)
+      : base(original) {
+      VariableName = original.VariableName;
+    }
+
+    public override bool HasLocalParameters {
+      get {
+        return true;
+      }
+    }
+
+    public override IOperation CreateShakingOperation(IScope scope) {
+      Scope myVariableScope = new Scope();
+      scope.AddSubScope(myVariableScope);
+      myVariableScope.AddVariable(CreateVariableIndexVariable());
+      return new AtomicOperation(Function.Manipulator, myVariableScope);
+    }
+
+    public override IOperation CreateInitOperation(IScope scope) {
+      Scope myVariableScope = new Scope();
+      scope.AddSubScope(myVariableScope);
+      myVariableScope.AddVariable(CreateVariableIndexVariable());
+      return new AtomicOperation(Function.Initializer, myVariableScope);
+    }
+
+    public override IFunctionTree Clone() {
+      return new VariableFunctionTree(this);
+    }
+
+    private IVariable CreateVariableIndexVariable() {
+      StringData data = new StringData(VariableName);
+      data.Changed += (sender, args) => VariableName = data.Data;
+      var variable = new HeuristicLab.Core.Variable(Variable.VARIABLENAME, data);
+      variable.ValueChanged += (sender, args) => VariableName = ((StringData)variable.Value).Data;
+      return variable;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Xor.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Xor.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Symbols/Xor.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.Boolean{
+  public sealed class Xor : BinaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Variable.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Variable.cs	(revision 2215)
+++ 	(revision )
@@ -1,139 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Operators;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP.Boolean {
-  public sealed class Variable : FunctionBase {
-    public const string INDEX = "Variable";
-
-    private int minIndex;
-    private int maxIndex;
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Variable()
-      : base() {
-      AddVariableInfo(new VariableInfo(INDEX, "Index of the variable in the dataset representing this feature", typeof(ConstrainedIntData), VariableKind.None));
-      GetVariableInfo(INDEX).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;
-
-      MinArity = 0; MaxArity = 0;
-
-      ConstrainedIntData variable = new ConstrainedIntData();
-      AddVariable(new HeuristicLab.Core.Variable(INDEX, variable));
-      minIndex = 0; maxIndex = 100;
-
-      SetupInitialization();
-      SetupManipulation();
-
-    }
-
-    private void SetupInitialization() {
-      CombinedOperator combinedOp = new CombinedOperator();
-      SequentialProcessor seq = new SequentialProcessor();
-      UniformRandomizer indexRandomizer = new UniformRandomizer();
-      indexRandomizer.Min = minIndex;
-      indexRandomizer.Max = maxIndex + 1; // uniform randomizer generates numbers in the range [min, max[
-      indexRandomizer.GetVariableInfo("Value").ActualName = INDEX;
-      indexRandomizer.Name = "Index Randomizer";
-
-      combinedOp.OperatorGraph.AddOperator(seq);
-      combinedOp.OperatorGraph.AddOperator(indexRandomizer);
-      combinedOp.OperatorGraph.InitialOperator = seq;
-      seq.AddSubOperator(indexRandomizer);
-      Initializer = combinedOp;
-    }
-
-    private void SetupManipulation() {
-      // manipulation operator
-      CombinedOperator combinedOp = new CombinedOperator();
-      SequentialProcessor seq = new SequentialProcessor();
-      UniformRandomizer indexRandomizer = new UniformRandomizer();
-      indexRandomizer.Min = minIndex;
-      indexRandomizer.Max = maxIndex + 1;
-      indexRandomizer.GetVariableInfo("Value").ActualName = INDEX;
-      indexRandomizer.Name = "Index Randomizer";
-
-      combinedOp.OperatorGraph.AddOperator(seq);
-      combinedOp.OperatorGraph.AddOperator(indexRandomizer);
-      combinedOp.OperatorGraph.InitialOperator = seq;
-      seq.AddSubOperator(indexRandomizer);
-      Manipulator = combinedOp;
-    }
-
-    public void SetConstraints(int[] allowedIndexes) {
-      //ConstrainedIntData index = GetVariableValue<ConstrainedIntData>(INDEX, null, false);
-      Array.Sort(allowedIndexes);
-      minIndex = allowedIndexes[0]; maxIndex = allowedIndexes[allowedIndexes.Length - 1];
-      List<IConstraint> constraints = new List<IConstraint>();
-      int start = allowedIndexes[0];
-      int prev = start;
-      for(int i = 1; i < allowedIndexes.Length; i++) {
-        if(allowedIndexes[i] != prev + 1) {
-          IntBoundedConstraint lastRange = new IntBoundedConstraint();
-          lastRange.LowerBound = start;
-          lastRange.LowerBoundEnabled = true;
-          lastRange.LowerBoundIncluded = true;
-          lastRange.UpperBound = prev;
-          lastRange.UpperBoundEnabled = true;
-          lastRange.UpperBoundIncluded = true;
-          constraints.Add(lastRange);
-          start = allowedIndexes[i];
-          prev = start;
-        }
-        prev = allowedIndexes[i];
-      }
-      IntBoundedConstraint range = new IntBoundedConstraint();
-      range.LowerBound = start;
-      range.LowerBoundEnabled = true;
-      range.LowerBoundIncluded = true;
-      range.UpperBound = prev;
-      range.UpperBoundEnabled = true;
-      range.UpperBoundIncluded = true;
-      constraints.Add(range);
-      if(constraints.Count > 1) {
-        OrConstraint or = new OrConstraint();
-        foreach(IConstraint c in constraints) or.Clauses.Add(c);
-        index.AddConstraint(or);
-      } else {
-        index.AddConstraint(constraints[0]);
-      }
-
-      SetupInitialization();
-      SetupManipulation();
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Xor.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Boolean/3.3/Xor.cs	(revision 2215)
+++ 	(revision )
@@ -1,43 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-
-namespace HeuristicLab.GP.Boolean{
-  public sealed class Xor : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Xor()
-      : base() {
-      MinArity = 2; MaxArity = 2;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/HeuristicLab.GP.Interfaces-3.3.csproj
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/HeuristicLab.GP.Interfaces-3.3.csproj	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/HeuristicLab.GP.Interfaces-3.3.csproj	(revision 2216)
@@ -83,9 +83,9 @@
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="IFunctionTreeSerializer.cs" />
     <Compile Include="IGeneticProgrammingModel.cs" />
     <Compile Include="HeuristicLabGPInterfacesPlugin.cs" />
     <Compile Include="IFunction.cs" />
     <Compile Include="IFunctionTree.cs" />
-    <Compile Include="IFunctionTreeExporter.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/IFunctionTreeExporter.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/IFunctionTreeExporter.cs	(revision 2215)
+++ 	(revision )
@@ -1,33 +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.Text;
-using HeuristicLab.Core;
-
-namespace HeuristicLab.GP.Interfaces {
-  public interface IFunctionTreeExporter {
-    string Name { get; }
-    string Export(IFunctionTree tree);
-    bool TryExport(IFunctionTree tree, out string exported);
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/IFunctionTreeSerializer.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/IFunctionTreeSerializer.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.Interfaces/3.3/IFunctionTreeSerializer.cs	(revision 2216)
@@ -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.Text;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.GP.Interfaces {
+  public interface IFunctionTreeSerializer {
+    string Name { get; }
+    string Export(IFunctionTree tree);
+    bool TryExport(IFunctionTree tree, out string exported);
+    IFunctionTree Import(string tree);
+    bool TryImport(string tree, out IFunctionTree importedTree);
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/AntInterpreter.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/AntInterpreter.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/AntInterpreter.cs	(revision 2216)
@@ -21,11 +21,5 @@
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Core;
-using System.Xml;
-using System.Diagnostics;
+using HeuristicLab.GP.Interfaces;
 
 namespace HeuristicLab.GP.SantaFe {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Evaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Evaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Evaluator.cs	(revision 2216)
@@ -20,11 +20,7 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.DataAnalysis;
+using HeuristicLab.GP.Interfaces;
 
 namespace HeuristicLab.GP.SantaFe {
@@ -32,13 +28,13 @@
     public Evaluator()
       : base() {
-      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(IFunctionTree), VariableKind.In));
+      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(IGeneticProgrammingModel), VariableKind.In));
       AddVariableInfo(new VariableInfo("FoodEaten", "Number of food items that the ant found", typeof(DoubleData), VariableKind.New | VariableKind.Out));
     }
 
     public override IOperation Apply(IScope scope) {
-      IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, false);
+      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, false);
       AntInterpreter interpreter = new AntInterpreter();
       interpreter.MaxTimeSteps = 600;
-      interpreter.Run(tree);
+      interpreter.Run(gpModel.FunctionTree);
 
       scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("FoodEaten"), new DoubleData(interpreter.FoodEaten)));
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/FunctionLibraryInjector.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/FunctionLibraryInjector.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/FunctionLibraryInjector.cs	(revision 2216)
@@ -20,18 +20,8 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Constraints;
+using HeuristicLab.GP.Interfaces;
 
 namespace HeuristicLab.GP.SantaFe {
-  public class FunctionLibraryInjector : OperatorBase {
-    private const string OPERATORLIBRARY = "FunctionLibrary";
-
-    private FunctionLibrary operatorLibrary;
+  public class FunctionLibraryInjector : FunctionLibraryInjectorBase {
 
     public override string Description {
@@ -41,14 +31,8 @@
     public FunctionLibraryInjector()
       : base() {
-      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(FunctionLibrary), VariableKind.New));
     }
 
-    public override IOperation Apply(IScope scope) {
-      InitDefaultOperatorLibrary();
-      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(OPERATORLIBRARY), operatorLibrary));
-      return null;
-    }
-
-    private void InitDefaultOperatorLibrary() {
+    protected override FunctionLibrary CreateFunctionLibrary() {
+      FunctionLibrary funLib = new FunctionLibrary();
       IfFoodAhead ifFoodAhead = new IfFoodAhead();
       Prog2 prog2 = new Prog2();
@@ -71,29 +55,11 @@
       SetAllowedSubOperators(prog3, allFunctions);
 
-      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);
-    }
-
-    private void SetAllowedSubOperators(IFunction f, IFunction[] gs) {
-      foreach(IConstraint c in f.Constraints) {
-        if(c is SubOperatorTypeConstraint) {
-          SubOperatorTypeConstraint typeConstraint = c as SubOperatorTypeConstraint;
-          typeConstraint.Clear();
-          foreach(IFunction g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        } else if(c is AllSubOperatorsTypeConstraint) {
-          AllSubOperatorsTypeConstraint typeConstraint = c as AllSubOperatorsTypeConstraint;
-          typeConstraint.Clear();
-          foreach(IFunction g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        }
-      }
+      funLib.AddFunction(ifFoodAhead);
+      funLib.AddFunction(prog2);
+      funLib.AddFunction(prog3);
+      funLib.AddFunction(move);
+      funLib.AddFunction(left);
+      funLib.AddFunction(right);
+      return funLib;
     }
   }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/HeuristicLab.GP.SantaFe-3.3.csproj
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/HeuristicLab.GP.SantaFe-3.3.csproj	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/HeuristicLab.GP.SantaFe-3.3.csproj	(revision 2216)
@@ -83,31 +83,27 @@
     <Compile Include="AntInterpreter.cs" />
     <Compile Include="FunctionLibraryInjector.cs" />
-    <Compile Include="Prog3.cs" />
-    <Compile Include="Prog2.cs" />
-    <Compile Include="IfFoodAhead.cs" />
-    <Compile Include="Right.cs" />
-    <Compile Include="Left.cs" />
-    <Compile Include="Move.cs" />
     <Compile Include="HeuristicLabGPSantaFePlugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Evaluator.cs" />
-    <Compile Include="SymbolTable.cs" />
+    <Compile Include="Symbols\IfFoodAhead.cs" />
+    <Compile Include="Symbols\Left.cs" />
+    <Compile Include="Symbols\Move.cs" />
+    <Compile Include="Symbols\Prog2.cs" />
+    <Compile Include="Symbols\Prog3.cs" />
+    <Compile Include="Symbols\Right.cs" />
+    <Compile Include="Symbols\SymbolTable.cs" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\HeuristicLab.Constraints\3.2\HeuristicLab.Constraints-3.2.csproj">
-      <Project>{FCD62C6F-4793-4593-AE9A-0BDCA256EE99}</Project>
-      <Name>HeuristicLab.Constraints-3.2</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
       <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
       <Name>HeuristicLab.Core-3.2</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\HeuristicLab.DataAnalysis\3.2\HeuristicLab.DataAnalysis-3.2.csproj">
-      <Project>{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}</Project>
-      <Name>HeuristicLab.DataAnalysis-3.2</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Data\3.2\HeuristicLab.Data-3.2.csproj">
       <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
       <Name>HeuristicLab.Data-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.GP.Interfaces\3.3\HeuristicLab.GP.Interfaces-3.3.csproj">
+      <Project>{924B6BEA-9A99-40FE-9334-5C01E8D540EC}</Project>
+      <Name>HeuristicLab.GP.Interfaces-3.3</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.GP\3.3\HeuristicLab.GP-3.3.csproj">
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/HeuristicLabGPSantaFePlugin.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/HeuristicLabGPSantaFePlugin.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/HeuristicLabGPSantaFePlugin.cs	(revision 2216)
@@ -28,8 +28,8 @@
   [ClassInfo(Name = "HeuristicLab.GP.SantaFe-3.3")]
   [PluginFile(Filename = "HeuristicLab.GP.SantaFe-3.3.dll", Filetype = PluginFileType.Assembly)]
-  [Dependency(Dependency = "HeuristicLab.Constraints-3.2")]
-  [Dependency(Dependency = "HeuristicLab.GP-3.3")]
   [Dependency(Dependency = "HeuristicLab.Core-3.2")]
   [Dependency(Dependency = "HeuristicLab.Data-3.2")]
+  [Dependency(Dependency = "HeuristicLab.GP-3.3")]
+  [Dependency(Dependency = "HeuristicLab.GP.Interfaces-3.3")]
   [Dependency(Dependency = "HeuristicLab.DataAnalysis-3.2")]
   [Dependency(Dependency = "HeuristicLab.Random-3.2")]
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/IfFoodAhead.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/IfFoodAhead.cs	(revision 2215)
+++ 	(revision )
@@ -1,44 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP.SantaFe {
-  public sealed class IfFoodAhead : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public IfFoodAhead()
-      : base() {
-      MinArity = 2; MaxArity = 2;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Left.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Left.cs	(revision 2215)
+++ 	(revision )
@@ -1,44 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP.SantaFe {
-  public sealed class Left : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Left()
-      : base() {
-      MinArity = 0; MaxArity = 0;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Move.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Move.cs	(revision 2215)
+++ 	(revision )
@@ -1,44 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP.SantaFe {
-  public sealed class Move : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Move()
-      : base() {
-      MinArity = 0; MaxArity = 0;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog2.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog2.cs	(revision 2215)
+++ 	(revision )
@@ -1,44 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP.SantaFe {
-  public sealed class Prog2 : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Prog2()
-      : base() {
-      MinArity = 2; MaxArity = 2;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog3.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Prog3.cs	(revision 2215)
+++ 	(revision )
@@ -1,44 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP.SantaFe {
-  public sealed class Prog3 : FunctionBase {
-
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Prog3()
-      : base() {
-      MinArity = 3; MaxArity = 3;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Right.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Right.cs	(revision 2215)
+++ 	(revision )
@@ -1,43 +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.Text;
-using HeuristicLab.Data;
-using HeuristicLab.Core;
-using System.Xml;
-using HeuristicLab.Constraints;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-
-namespace HeuristicLab.GP.SantaFe {
-  public sealed class Right : FunctionBase {
-    public override string Description {
-      get { return ""; }
-    }
-
-    public Right()
-      : base() {
-      MinArity = 0; MaxArity = 0;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/SymbolTable.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/SymbolTable.cs	(revision 2215)
+++ 	(revision )
@@ -1,56 +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.SantaFe {
-  class SymbolTable : StorableBase {
-    public const int IF_FOOD_AHEAD = 1;
-    public const int LEFT = 2;
-    public const int RIGHT = 3;
-    public const int MOVE = 4;
-    public const int PROG2 = 5;
-    public const int PROG3 = 6;
-    public const int UNKNOWN = 7;
-    private static Dictionary<Type, int> staticTypes = new Dictionary<Type, int>();
-
-    // needs to be public for persistence mechanism (Activator.CreateInstance needs empty constructor)
-    static SymbolTable() {
-      staticTypes = new Dictionary<Type, int>();
-      staticTypes[typeof(IfFoodAhead)] = IF_FOOD_AHEAD;
-      staticTypes[typeof(Left)] = LEFT;
-      staticTypes[typeof(Right)] = RIGHT;
-      staticTypes[typeof(Move)] = MOVE;
-      staticTypes[typeof(Prog2)] = PROG2;
-      staticTypes[typeof(Prog3)] = PROG3;
-    }
-
-    internal static int MapFunction(IFunction function) {
-      if(staticTypes.ContainsKey(function.GetType())) return staticTypes[function.GetType()];
-      else return UNKNOWN;
-    }
-  }
-}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/IfFoodAhead.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/IfFoodAhead.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/IfFoodAhead.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.SantaFe {
+  public sealed class IfFoodAhead : BinaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Left.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Left.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Left.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.SantaFe {
+  public sealed class Left : Terminal {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Move.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Move.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Move.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.SantaFe {
+  public sealed class Move : Terminal {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Prog2.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Prog2.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Prog2.cs	(revision 2216)
@@ -0,0 +1,26 @@
+#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.SantaFe {
+  public sealed class Prog2 : BinaryFunction {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Prog3.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Prog3.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Prog3.cs	(revision 2216)
@@ -0,0 +1,30 @@
+#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.SantaFe {
+  public sealed class Prog3 : FunctionBase {
+
+    public Prog3()
+      : base() {
+      MinSubTrees = 3; MaxSubTrees = 3;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Right.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Right.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/Right.cs	(revision 2216)
@@ -0,0 +1,25 @@
+#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.SantaFe {
+  public sealed class Right : Terminal {
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/SymbolTable.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/SymbolTable.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Symbols/SymbolTable.cs	(revision 2216)
@@ -0,0 +1,54 @@
+﻿#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 HeuristicLab.Core;
+using HeuristicLab.GP.Interfaces;
+
+namespace HeuristicLab.GP.SantaFe {
+  class SymbolTable : StorableBase {
+    public const int IF_FOOD_AHEAD = 1;
+    public const int LEFT = 2;
+    public const int RIGHT = 3;
+    public const int MOVE = 4;
+    public const int PROG2 = 5;
+    public const int PROG3 = 6;
+    public const int UNKNOWN = 7;
+    private static Dictionary<Type, int> staticTypes = new Dictionary<Type, int>();
+
+    // needs to be public for persistence mechanism (Activator.CreateInstance needs empty constructor)
+    static SymbolTable() {
+      staticTypes = new Dictionary<Type, int>();
+      staticTypes[typeof(IfFoodAhead)] = IF_FOOD_AHEAD;
+      staticTypes[typeof(Left)] = LEFT;
+      staticTypes[typeof(Right)] = RIGHT;
+      staticTypes[typeof(Move)] = MOVE;
+      staticTypes[typeof(Prog2)] = PROG2;
+      staticTypes[typeof(Prog3)] = PROG3;
+    }
+
+    internal static int MapFunction(IFunction function) {
+      if(staticTypes.ContainsKey(function.GetType())) return staticTypes[function.GetType()];
+      else return UNKNOWN;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/AccuracyEvaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/AccuracyEvaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/AccuracyEvaluator.cs	(revision 2216)
@@ -21,10 +21,6 @@
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.GP.StructureIdentification;
 using HeuristicLab.DataAnalysis;
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs	(revision 2216)
@@ -21,10 +21,6 @@
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.GP.StructureIdentification;
 
 namespace HeuristicLab.GP.StructureIdentification.Classification {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ConfusionMatrixEvaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ConfusionMatrixEvaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ConfusionMatrixEvaluator.cs	(revision 2216)
@@ -20,11 +20,6 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.GP.StructureIdentification;
 
 namespace HeuristicLab.GP.StructureIdentification.Classification {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/CrossValidation.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/CrossValidation.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/CrossValidation.cs	(revision 2216)
@@ -21,54 +21,47 @@
 
 using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
 
-namespace HeuristicLab.GP.StructureIdentification.Classification
-{
-    public class CrossValidation : OperatorBase
-    {
+namespace HeuristicLab.GP.StructureIdentification.Classification {
+  public class CrossValidation : OperatorBase {
 
-        private const string DATASET = "Dataset";
-        private const string NFOLD = "n-Fold";
-        private const string TRAININGSAMPLESSTART = "TrainingSamplesStart";
-        private const string TRAININGSAMPLESEND = "TrainingSamplesEnd";
-        private const string VALIDATIONSAMPLESSTART = "ValidationSamplesStart";
-        private const string VALIDATIONSAMPLESEND = "ValidationSamplesEnd";
-        private const string TESTSAMPLESSTART = "TestSamplesStart";
-        private const string TESTSAMPLESEND = "TestSamplesEnd";
+    private const string DATASET = "Dataset";
+    private const string NFOLD = "n-Fold";
+    private const string TRAININGSAMPLESSTART = "TrainingSamplesStart";
+    private const string TRAININGSAMPLESEND = "TrainingSamplesEnd";
+    private const string VALIDATIONSAMPLESSTART = "ValidationSamplesStart";
+    private const string VALIDATIONSAMPLESEND = "ValidationSamplesEnd";
+    private const string TESTSAMPLESSTART = "TestSamplesStart";
+    private const string TESTSAMPLESEND = "TestSamplesEnd";
 
-        public override string Description
-        {
-            get { return @"TASK"; }
-        }
+    public override string Description {
+      get { return @"TASK"; }
+    }
 
-        public CrossValidation()
-            : base()
-        {
-            AddVariableInfo(new VariableInfo(DATASET, "The original dataset and the new datasets in the newly created subscopes", typeof(Dataset), VariableKind.In));
-            AddVariableInfo(new VariableInfo(NFOLD, "Number of folds for the cross-validation", typeof(IntData), VariableKind.In));
-            AddVariableInfo(new VariableInfo(TRAININGSAMPLESSTART, "The start of training samples in the original dataset and starts of training samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
-            AddVariableInfo(new VariableInfo(TRAININGSAMPLESEND, "The end of training samples in the original dataset and ends of training samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
-            AddVariableInfo(new VariableInfo(VALIDATIONSAMPLESSTART, "The start of validation samples in the original dataset and starts of validation samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
-            AddVariableInfo(new VariableInfo(VALIDATIONSAMPLESEND, "The end of validation samples in the original dataset and ends of validation samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
-            AddVariableInfo(new VariableInfo(TESTSAMPLESSTART, "The start of the test samples in the new datasets", typeof(IntData), VariableKind.New));
-            AddVariableInfo(new VariableInfo(TESTSAMPLESEND, "The end of the test samples in the new datasets", typeof(IntData), VariableKind.New));
-        }
+    public CrossValidation()
+      : base() {
+      AddVariableInfo(new VariableInfo(DATASET, "The original dataset and the new datasets in the newly created subscopes", typeof(Dataset), VariableKind.In));
+      AddVariableInfo(new VariableInfo(NFOLD, "Number of folds for the cross-validation", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo(TRAININGSAMPLESSTART, "The start of training samples in the original dataset and starts of training samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
+      AddVariableInfo(new VariableInfo(TRAININGSAMPLESEND, "The end of training samples in the original dataset and ends of training samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
+      AddVariableInfo(new VariableInfo(VALIDATIONSAMPLESSTART, "The start of validation samples in the original dataset and starts of validation samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
+      AddVariableInfo(new VariableInfo(VALIDATIONSAMPLESEND, "The end of validation samples in the original dataset and ends of validation samples in the new datasets", typeof(IntData), VariableKind.In | VariableKind.New));
+      AddVariableInfo(new VariableInfo(TESTSAMPLESSTART, "The start of the test samples in the new datasets", typeof(IntData), VariableKind.New));
+      AddVariableInfo(new VariableInfo(TESTSAMPLESEND, "The end of the test samples in the new datasets", typeof(IntData), VariableKind.New));
+    }
 
-        public override IOperation Apply(IScope scope) {
+    public override IOperation Apply(IScope scope) {
       Dataset origDataset = GetVariableValue<Dataset>(DATASET, scope, true);
       int nFolds = GetVariableValue<IntData>(NFOLD, scope, true).Data;
-      if (nFolds < 2) throw new ArgumentException("The number of folds (nFolds) has to be >=2 for cross validation"); 
+      if (nFolds < 2) throw new ArgumentException("The number of folds (nFolds) has to be >=2 for cross validation");
       int origTrainingSamplesStart = GetVariableValue<IntData>(TRAININGSAMPLESSTART, scope, true).Data;
       int origTrainingSamplesEnd = GetVariableValue<IntData>(TRAININGSAMPLESEND, scope, true).Data;
       int origValidationSamplesStart = GetVariableValue<IntData>(VALIDATIONSAMPLESSTART, scope, true).Data;
       int origValidationSamplesEnd = GetVariableValue<IntData>(VALIDATIONSAMPLESEND, scope, true).Data;
-      int n=origDataset.Rows;
-      int origTrainingSamples = (origTrainingSamplesEnd-origTrainingSamplesStart);
-      int origValidationSamples = (origValidationSamplesEnd-origValidationSamplesStart);
+      int n = origDataset.Rows;
+      int origTrainingSamples = (origTrainingSamplesEnd - origTrainingSamplesStart);
+      int origValidationSamples = (origValidationSamplesEnd - origValidationSamplesStart);
 
       double percentTrainingSamples = origTrainingSamples / (double)(origValidationSamples + origTrainingSamples);
@@ -82,5 +75,5 @@
       int newTestSamplesEnd = n;
 
-      for(int i = 0; i < nFolds; i++) {
+      for (int i = 0; i < nFolds; i++) {
         Scope childScope = new Scope(i.ToString());
         Dataset rotatedSet = new Dataset();
@@ -106,10 +99,9 @@
     }
 
-        private void RotateArray(double[] samples, int p)
-        {
-            Array.Reverse(samples, 0, p);
-            Array.Reverse(samples, p, samples.Length - p);
-            Array.Reverse(samples);
-        }
+    private void RotateArray(double[] samples, int p) {
+      Array.Reverse(samples, 0, p);
+      Array.Reverse(samples, p, samples.Length - p);
+      Array.Reverse(samples);
     }
+  }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs	(revision 2216)
@@ -21,10 +21,6 @@
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.GP.StructureIdentification;
 using HeuristicLab.DataAnalysis;
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/HeuristicLabGPClassificationPlugin.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/HeuristicLabGPClassificationPlugin.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/HeuristicLabGPClassificationPlugin.cs	(revision 2216)
@@ -28,5 +28,4 @@
   [ClassInfo(Name = "HeuristicLab.GP.StructureIdentification.Classification-3.3")]
   [PluginFile(Filename = "HeuristicLab.GP.StructureIdentification.Classification-3.3.dll", Filetype = PluginFileType.Assembly)]
-  [Dependency(Dependency = "HeuristicLab.Constraints-3.2")]
   [Dependency(Dependency = "HeuristicLab.Core-3.2")]
   [Dependency(Dependency = "HeuristicLab.Data-3.2")]
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassModeller.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassModeller.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassModeller.cs	(revision 2216)
@@ -22,6 +22,4 @@
 using System;
 using System.Collections.Generic;
-using System.Text;
-using System.Xml;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs	(revision 2216)
@@ -21,11 +21,7 @@
 
 using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
 using HeuristicLab.DataAnalysis;
-using HeuristicLab.GP.StructureIdentification;
 using HeuristicLab.GP.Interfaces;
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs	(revision 2216)
@@ -20,14 +20,5 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
-using System.Xml;
-using System.Diagnostics;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-using HeuristicLab.Data;
 using HeuristicLab.Modeling;
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ROCAnalyzer.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ROCAnalyzer.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ROCAnalyzer.cs	(revision 2216)
@@ -20,11 +20,8 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.DataAnalysis;
 
 
@@ -89,5 +86,5 @@
       foreach (double key in classes.Keys)
         classes[key].Sort();
-  
+
       //calculate ROC Curve
       foreach (double key in classes.Keys) {
@@ -133,7 +130,7 @@
           }
         }
-          myAucValues.Add(new DoubleData(bestAUC));
-          myRocValues.Add(Convert(bestROC));
-        
+        myAucValues.Add(new DoubleData(bestAUC));
+        myRocValues.Add(Convert(bestROC));
+
       } else { //last class
         actNegatives = negatives.Where<double>(value => value > classes[positiveClassKey].Min<double>()).ToList<double>();
@@ -158,5 +155,5 @@
 
       actTP = positives.Count<double>(value => minThreshold <= value && value <= negatives.Max<double>());
-      actFP = negatives.Count<double>(value => minThreshold <= value );
+      actFP = negatives.Count<double>(value => minThreshold <= value);
       //add point (1,TPR) for AUC 'correct' calculation
       roc.Add(new KeyValuePair<double, double>(1, actTP / positives.Count));
@@ -222,5 +219,5 @@
 
         //stop calculation if truePositiveRate == 0 => straight line with y=0 & save runtime
-        if (actTP == 0 || actFP==0)
+        if (actTP == 0 || actFP == 0)
           break;
       }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs	(revision 2216)
@@ -20,16 +20,7 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
-using System.Xml;
-using System.Diagnostics;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Random;
-using HeuristicLab.Data;
+using HeuristicLab.Modeling;
 using HeuristicLab.Operators;
-using HeuristicLab.Modeling;
 
 namespace HeuristicLab.GP.StructureIdentification.Classification {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs	(revision 2216)
@@ -21,10 +21,6 @@
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.GP.StructureIdentification;
 
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.csproj
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.csproj	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.csproj	(revision 2216)
@@ -91,8 +91,4 @@
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\HeuristicLab.Constraints\3.2\HeuristicLab.Constraints-3.2.csproj">
-      <Project>{FCD62C6F-4793-4593-AE9A-0BDCA256EE99}</Project>
-      <Name>HeuristicLab.Constraints-3.2</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
       <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLabGPTimeSeriesPlugin.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLabGPTimeSeriesPlugin.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLabGPTimeSeriesPlugin.cs	(revision 2216)
@@ -35,6 +35,6 @@
   [Dependency(Dependency = "HeuristicLab.GP.Interfaces-3.3")]
   [Dependency(Dependency = "HeuristicLab.GP.StructureIdentification-3.3")]
+  [Dependency(Dependency = "HeuristicLab.Logging-3.2")]
   [Dependency(Dependency = "HeuristicLab.Modeling-3.2")]
-  [Dependency(Dependency = "HeuristicLab.Logging-3.2")]
   [Dependency(Dependency = "HeuristicLab.Operators-3.2")]
   public class HeuristicLabGPTimeSeriesPlugin : PluginBase {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs	(revision 2216)
@@ -20,16 +20,7 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
-using System.Xml;
-using System.Diagnostics;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Data;
+using HeuristicLab.Modeling;
 using HeuristicLab.Operators;
-using HeuristicLab.Logging;
-using HeuristicLab.Modeling;
 
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs	(revision 2216)
@@ -20,11 +20,6 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.GP.StructureIdentification;
 
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs	(revision 2216)
@@ -20,16 +20,9 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
-using System.Xml;
-using System.Diagnostics;
-using HeuristicLab.DataAnalysis;
 using HeuristicLab.Data;
-using HeuristicLab.Operators;
 using HeuristicLab.Logging;
 using HeuristicLab.Modeling;
+using HeuristicLab.Operators;
 
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/TheilInequalityCoefficientEvaluator.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/TheilInequalityCoefficientEvaluator.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/TheilInequalityCoefficientEvaluator.cs	(revision 2216)
@@ -21,10 +21,6 @@
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.GP.StructureIdentification;
 using HeuristicLab.DataAnalysis;
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs	(revision 2216)
@@ -24,9 +24,8 @@
 using HeuristicLab.Data;
 using HeuristicLab.GP.Interfaces;
+using HeuristicLab.GP.SantaFe;
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public class FunctionLibraryInjector : OperatorBase {
-    private const string FUNCTIONLIBRARY = "FunctionLibrary";
-    private const string TARGETVARIABLE = "TargetVariable";
+  public class FunctionLibraryInjector : FunctionLibraryInjectorBase {
     private const string MINTIMEOFFSET = "MinTimeOffset";
     private const string MAXTIMEOFFSET = "MaxTimeOffset";
@@ -57,4 +56,6 @@
     private const string XOR_ALLOWED = "Xor";
 
+    private int minTimeOffset;
+    private int maxTimeOffset;
 
     public override string Description {
@@ -64,8 +65,6 @@
     public FunctionLibraryInjector()
       : base() {
-      AddVariableInfo(new VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), VariableKind.In));
       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 function library", typeof(FunctionLibrary), VariableKind.New));
 
       AddVariable(DIFFERENTIALS_ALLOWED, false);
@@ -102,13 +101,16 @@
 
     public override IOperation Apply(IScope scope) {
-      FunctionLibrary functionLibrary = new FunctionLibrary();
-      int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;
-
       // try to get minTimeOffset (use 0 as default if not available)
       IItem minTimeOffsetItem = GetVariableValue(MINTIMEOFFSET, scope, true, false);
-      int minTimeOffset = minTimeOffsetItem == null ? 0 : ((IntData)minTimeOffsetItem).Data;
+      minTimeOffset = minTimeOffsetItem == null ? 0 : ((IntData)minTimeOffsetItem).Data;
       // try to get maxTimeOffset (use 0 as default if not available)
       IItem maxTimeOffsetItem = GetVariableValue(MAXTIMEOFFSET, scope, true, false);
-      int maxTimeOffset = maxTimeOffsetItem == null ? 0 : ((IntData)maxTimeOffsetItem).Data;
+      maxTimeOffset = maxTimeOffsetItem == null ? 0 : ((IntData)maxTimeOffsetItem).Data;
+
+      return base.Apply(scope);
+    }
+
+    protected override FunctionLibrary CreateFunctionLibrary() {
+      FunctionLibrary functionLibrary = new FunctionLibrary();
 
       Variable variable = new Variable();
@@ -218,7 +220,5 @@
       differential.SetConstraints(minTimeOffset, maxTimeOffset);
 
-      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(FUNCTIONLIBRARY), functionLibrary));
-
-      return null;
+      return functionLibrary;
     }
 
@@ -230,14 +230,4 @@
       if (GetVariableValue<BoolData>(condName, null, false).Data) functionLib.AddFunction(op);
     }
-
-    private void SetAllowedSubOperators(IFunction f, List<IFunction> gs) {
-      for (int i = 0; i < f.MaxSubTrees; i++) {
-        SetAllowedSubOperators(f, i, gs);
-      }
-    }
-
-    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/ModelAnalyzerExporter.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/ModelAnalyzerExporter.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/ModelAnalyzerExporter.cs	(revision 2216)
@@ -21,7 +21,8 @@
 
 using HeuristicLab.GP.Interfaces;
+using System;
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public class ModelAnalyzerExporter : IFunctionTreeExporter, IFunctionTreeNameGenerator {
+  public class ModelAnalyzerExporter : IFunctionTreeSerializer, IFunctionTreeNameGenerator {
     #region IFunctionTreeExporter Members
 
@@ -53,4 +54,19 @@
       if(tree.SubTrees.Count > 0) result += ")";
       return result;
+    }
+
+    public IFunctionTree Import(string tree) {
+      throw new UnknownFunctionException(tree);
+    }
+
+    public bool TryImport(string tree, out IFunctionTree importedTree) {
+      try {
+        importedTree = Import(tree);
+        return true;
+      }
+      catch (UnknownFunctionException) {
+        importedTree = null;
+        return false;
+      }
     }
 
@@ -104,4 +120,6 @@
 
     #endregion
+
+
   }
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs	(revision 2216)
@@ -22,7 +22,9 @@
 using System.Text;
 using HeuristicLab.GP.Interfaces;
+using System;
+using System.Collections.Generic;
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public class SymbolicExpressionExporter : IFunctionTreeExporter, IFunctionTreeNameGenerator {
+  public class SymbolicExpressionExporter : IFunctionTreeSerializer, IFunctionTreeNameGenerator {
     private StringBuilder builder;
     private string currentIndent;
@@ -48,4 +50,54 @@
       } catch(UnknownFunctionException) {
         exported = "";
+        return false;
+      }
+    }
+
+    public IFunctionTree Import(string tree) {
+      Queue<string> tokens = new Queue<string>(tree.Split(' ', '\n', '\t'));
+      return ParseTree(tokens);
+    }
+
+    private IFunctionTree ParseTree(Queue<string> tokens) {
+      Expect("(", tokens);
+      string funSymb = tokens.Peek();
+      double constValue;
+      if (double.TryParse(funSymb, out constValue)) {
+        throw new UnknownFunctionException(funSymb);
+      }
+      switch (funSymb) {
+        case "variable": return ParseVariable(tokens);
+        case "differential": return ParseDifferential(tokens);
+        default: 
+          IFunctionTree fNode = ParseFunction(tokens);
+          Expect(")", tokens);
+          return fNode;
+      }
+
+    }
+
+    private IFunctionTree ParseFunction(Queue<string> tokens) {
+      throw new UnknownFunctionException(tokens.Dequeue());
+    }
+
+    private IFunctionTree ParseDifferential(Queue<string> tokens) {
+      throw new UnknownFunctionException(tokens.Dequeue());
+    }
+
+    private IFunctionTree ParseVariable(Queue<string> tokens) {
+      throw new UnknownFunctionException(tokens.Dequeue());
+    }
+
+    private void Expect(string p, Queue<string> tokens) {
+      throw new NotImplementedException();
+    }
+
+    public bool TryImport(string tree, out IFunctionTree importedTree) {
+      try {
+        importedTree = Import(tree);
+        return true;
+      }
+      catch (UnknownFunctionException) {
+        importedTree = null;
         return false;
       }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Constant.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Constant.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Constant.cs	(revision 2216)
@@ -31,10 +31,4 @@
     public override string Description {
       get { return "Returns the value of local variable 'Value'."; }
-    }
-
-    public override IEnumerable<string> LocalParameterNames {
-      get {
-        return new string[] { VALUE };
-      }
     }
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/ConstantFunctionTree.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/ConstantFunctionTree.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/ConstantFunctionTree.cs	(revision 2216)
@@ -26,21 +26,12 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public class ConstantFunctionTree : FunctionTreeBase {
-    private static readonly IList<IFunctionTree> subTrees = new List<IFunctionTree>().AsReadOnly();
+  public class ConstantFunctionTree : TerminalTreeNode {
     public double Value { get; set; }
 
-    public ConstantFunctionTree(Constant constant) {
-      Function = constant;
+    public ConstantFunctionTree(Constant constant) : base(constant){
     }
 
-    protected ConstantFunctionTree(ConstantFunctionTree original) {
-      Function = original.Function;
+    protected ConstantFunctionTree(ConstantFunctionTree original) : base(original){
       Value = original.Value;
-    }
-
-    public override IList<IFunctionTree> SubTrees {
-      get {
-        return subTrees;
-      }
     }
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs	(revision 2216)
@@ -26,25 +26,18 @@
 
 namespace HeuristicLab.GP.StructureIdentification {
-  public class VariableFunctionTree : FunctionTreeBase {
-    private static readonly IList<IFunctionTree> subTrees = new List<IFunctionTree>().AsReadOnly();
+  public class VariableFunctionTree : TerminalTreeNode {
     public double Weight { get; set; }
     public string VariableName { get; set; }
     public int SampleOffset { get; set; }
 
-    public VariableFunctionTree(Variable variable) {
-      Function = variable;
+    public VariableFunctionTree(Variable variable)
+      : base(variable) {
     }
 
-    protected VariableFunctionTree(VariableFunctionTree original) {
-      Function = original.Function;
+    protected VariableFunctionTree(VariableFunctionTree original)
+      : base(original) {
       Weight = original.Weight;
       VariableName = original.VariableName;
       SampleOffset = original.SampleOffset;
-    }
-
-    public override IList<IFunctionTree> SubTrees {
-      get {
-        return subTrees;
-      }
     }
 
@@ -66,5 +59,5 @@
     public override IOperation CreateInitOperation(IScope scope) {
       Scope myVariableScope = new Scope();
-      scope.AddSubScope(myVariableScope); 
+      scope.AddSubScope(myVariableScope);
       myVariableScope.AddVariable(CreateWeightVariable());
       myVariableScope.AddVariable(CreateVariableNameVariable());
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionBase.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionBase.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionBase.cs	(revision 2216)
@@ -101,8 +101,4 @@
     }
 
-    public virtual IEnumerable<string> LocalParameterNames {
-      get { return new string[0]; }
-    }
-
     public virtual IFunctionTree GetTreeNode() {
       return new FunctionTreeBase(this);
@@ -158,4 +154,41 @@
       minTreeHeight = height + 1;
     }
+
+    public override object Clone(IDictionary<Guid, object> clonedObjects) {
+      throw new NotSupportedException();
+    }
+
+    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
+      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
+      XmlAttribute minSubTreesAttr = document.CreateAttribute("MinSubTrees");
+      minSubTreesAttr.Value = XmlConvert.ToString(MinSubTrees);
+      XmlAttribute maxSubTreesAttr = document.CreateAttribute("MaxSubTrees");
+      maxSubTreesAttr.Value = XmlConvert.ToString(MaxSubTrees);
+      node.Attributes.Append(minSubTreesAttr);
+      node.Attributes.Append(maxSubTreesAttr);
+      for (int i = 0; i < MaxSubTrees; i++) {
+        XmlNode slotNode = document.CreateElement("AllowedSubFunctions");
+        XmlAttribute slotAttr = document.CreateAttribute("Slot");
+        slotAttr.Value = XmlConvert.ToString(i);
+        slotNode.Attributes.Append(slotAttr);
+        node.AppendChild(slotNode);
+        foreach (IFunction f in GetAllowedSubFunctions(i)) {
+          slotNode.AppendChild(PersistenceManager.Persist(f, document, persistedObjects));
+        }
+      }
+      return node;
+    }
+
+    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
+      base.Populate(node, restoredObjects);
+      MinSubTrees = XmlConvert.ToInt32(node.Attributes["MinSubTrees"].Value);
+      MaxSubTrees = XmlConvert.ToInt32(node.Attributes["MaxSubTrees"].Value);
+      foreach (XmlNode allowedSubFunctionsNode in node.SelectNodes("AllowedSubFunctions")) {
+        int slot = XmlConvert.ToInt32(allowedSubFunctionsNode.Attributes["Slot"].Value);
+        foreach (XmlNode fNode in allowedSubFunctionsNode.ChildNodes) {
+          AddAllowedSubFunction((IFunction)PersistenceManager.Restore(fNode, restoredObjects), slot);
+        }
+      }
+    }
   }
 }
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionLibraryInjectorBase.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionLibraryInjectorBase.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionLibraryInjectorBase.cs	(revision 2216)
@@ -0,0 +1,62 @@
+#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.Text;
+using System.Xml;
+using System.Linq;
+using HeuristicLab.Core;
+using HeuristicLab.GP.Interfaces;
+
+namespace HeuristicLab.GP.SantaFe {
+  public abstract class FunctionLibraryInjectorBase : OperatorBase {
+    private const string FUNCTIONLIBRARY = "FunctionLibrary";
+
+    public override string Description {
+      get { return @"Descrption is missing."; }
+    }
+
+    public FunctionLibraryInjectorBase()
+      : base() {
+      AddVariableInfo(new VariableInfo(FUNCTIONLIBRARY, "Preconfigured default function library", typeof(FunctionLibrary), VariableKind.New));
+    }
+
+    public override IOperation Apply(IScope scope) {
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(FUNCTIONLIBRARY), CreateFunctionLibrary()));
+      return null;
+    }
+
+    protected abstract FunctionLibrary CreateFunctionLibrary();
+
+    protected void SetAllowedSubOperators(IFunction f, IEnumerable<IFunction> gs) {
+      for (int i = 0; i < f.MaxSubTrees; i++) {
+        SetAllowedSubOperators(f, i, gs);
+      }
+    }
+
+    protected void SetAllowedSubOperators(IFunction f, int i, IEnumerable<IFunction> gs) {
+      foreach (var g in gs) {
+        f.AddAllowedSubFunction(g, i);
+      }
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionTreeBase.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionTreeBase.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/FunctionTreeBase.cs	(revision 2216)
@@ -58,7 +58,5 @@
     public IFunction Function {
       get { return function; }
-      protected set {
-        function = value;
-      }
+      protected set { function = value; }
     }
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/TerminalTreeNode.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/TerminalTreeNode.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/BaseClasses/TerminalTreeNode.cs	(revision 2216)
@@ -0,0 +1,45 @@
+#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.Text;
+using HeuristicLab.Core;
+using HeuristicLab.GP.Interfaces;
+
+namespace HeuristicLab.GP {
+  public class TerminalTreeNode : FunctionTreeBase {
+    private static readonly IList<IFunctionTree> subTrees = new List<IFunctionTree>().AsReadOnly();
+    public TerminalTreeNode(IFunction function) {
+      Function = function;
+    }
+
+    protected TerminalTreeNode(TerminalTreeNode original) {
+      Function = original.Function;
+    }
+
+    public override IList<IFunctionTree> SubTrees {
+      get {
+        return subTrees;
+      }
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibrary.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibrary.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionLibrary.cs	(revision 2216)
@@ -58,4 +58,19 @@
     }
 
+    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
+      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
+      foreach (IFunction f in functions) {
+        node.AppendChild(PersistenceManager.Persist("Function", f, document, persistedObjects));
+      }
+      return node;
+    }
+
+    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
+      base.Populate(node, restoredObjects);
+      foreach (XmlNode fNode in node.SelectNodes("Function")) {
+        AddFunction((IFunction)PersistenceManager.Restore(fNode, restoredObjects));
+      }
+    }
+
     public override IView CreateView() {
       return new FunctionLibraryEditor(this);
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/FunctionTreeView.cs	(revision 2216)
@@ -67,6 +67,6 @@
       treeNodeContextMenu.MenuItems.Add(representationsMenu);
       DiscoveryService discoveryService = new DiscoveryService();
-      IFunctionTreeExporter[] exporters = discoveryService.GetInstances<IFunctionTreeExporter>();
-      foreach (IFunctionTreeExporter exporter in exporters) {
+      IFunctionTreeSerializer[] exporters = discoveryService.GetInstances<IFunctionTreeSerializer>();
+      foreach (IFunctionTreeSerializer exporter in exporters) {
         string result;
         // register a menu item for the exporter
@@ -101,5 +101,5 @@
     }
 
-    private EventHandler MakeExporterDelegate(IFunctionTreeExporter exporter) {
+    private EventHandler MakeExporterDelegate(IFunctionTreeSerializer exporter) {
       return delegate(object source, EventArgs args) {
         TreeNode node = funTreeView.SelectedNode;
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GeneralTreeSerializer.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GeneralTreeSerializer.cs	(revision 2216)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GeneralTreeSerializer.cs	(revision 2216)
@@ -0,0 +1,71 @@
+#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 HeuristicLab.Core;
+using System.Linq;
+using System.Collections;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.GP {
+  public static class GeneralTreeSerializer {
+    private static IFunctionTreeSerializer serializer;
+
+    internal static string Export(IFunctionTree functionTree) {
+      if (serializer != null || FindSerializer(functionTree)) {
+        return serializer.Export(functionTree);
+      } else throw new NotSupportedException("Can't serialize function trees. A matching export couldn't be found");
+    }
+
+    internal static IFunctionTree Import(string p) {
+      if (serializer != null || FindSerializer(p)) {
+        return serializer.Import(p);
+      } else throw new NotSupportedException("Can't serialize function trees. A matching export couldn't be found");
+    }
+
+    private static bool FindSerializer(IFunctionTree functionTree) {
+      DiscoveryService discoveryService = new DiscoveryService();
+      string exported;
+
+      foreach (IFunctionTreeSerializer exporter in discoveryService.GetInstances<IFunctionTreeSerializer>()) {
+        if (exporter.TryExport(functionTree, out exported)) {
+          GeneralTreeSerializer.serializer = exporter;
+          return true;
+        }
+      }
+      return false;
+    }
+    private static bool FindSerializer(string functionTree) {
+      DiscoveryService discoveryService = new DiscoveryService();
+      IFunctionTree exported;
+
+      foreach (IFunctionTreeSerializer importer in discoveryService.GetInstances<IFunctionTreeSerializer>()) {
+        if (importer.TryImport(functionTree, out exported)) {
+          GeneralTreeSerializer.serializer = importer;
+          return true;
+        }
+      }
+      return false;
+    }
+  }
+}
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GeneticProgrammingModel.cs
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GeneticProgrammingModel.cs	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/GeneticProgrammingModel.cs	(revision 2216)
@@ -25,4 +25,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.GP.Interfaces;
+using System.Xml;
 
 namespace HeuristicLab.GP {
@@ -56,10 +57,13 @@
     }
 
-    public override System.Xml.XmlNode GetXmlNode(string name, System.Xml.XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
-      throw new NotImplementedException();
+    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
+      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
+      node.Value = GeneralTreeSerializer.Export(FunctionTree);
+      return node;
     }
 
-    public override void Populate(System.Xml.XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
-      throw new NotImplementedException();
+    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
+      base.Populate(node, restoredObjects);
+      FunctionTree = GeneralTreeSerializer.Import(node.Value);
     }
 
Index: branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj
===================================================================
--- branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj	(revision 2215)
+++ branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj	(revision 2216)
@@ -83,8 +83,11 @@
   <ItemGroup>
     <Compile Include="BaseClasses\BinaryFunction.cs" />
+    <Compile Include="BaseClasses\FunctionLibraryInjectorBase.cs" />
+    <Compile Include="BaseClasses\TerminalTreeNode.cs" />
     <Compile Include="BaseClasses\FunctionBase.cs" />
     <Compile Include="BaseClasses\FunctionTreeBase.cs" />
     <Compile Include="BaseClasses\Terminal.cs" />
     <Compile Include="BaseClasses\UnaryFunction.cs" />
+    <Compile Include="FunctionTreeSerializer.cs" />
     <Compile Include="FunctionLibrary.cs" />
     <Compile Include="FunctionLibraryEditor.cs">
