Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs	(revision 3539)
@@ -0,0 +1,151 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Creates a new argument within one function-defining branch of a symbolic expression tree.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 106
+  /// </summary>
+  [Item("ArgumentCreater", "Manipulates a symbolic expression by creating a new argument within one function-defining branch.")]
+  [StorableClass]
+  public sealed class ArgumentCreater : SymbolicExpressionTreeArchitectureManipulator {
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = CreateNewArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool CreateNewArgument(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+
+      if (functionDefiningBranches.Count() == 0)
+        // no function defining branch found => abort
+        return false;
+
+      // select a random function defining branch
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      var definedArguments = (from symbol in selectedDefunBranch.Grammar.Symbols.OfType<Argument>()
+                              select symbol.ArgumentIndex).Distinct();
+      if (definedArguments.Count() >= maxFunctionArguments)
+        // max number of arguments reached => abort
+        return false;
+      // select a random cut point in the function defining branch
+      // the branch at the cut point is to be replaced by a new argument node
+      var cutPoints = (from node in selectedDefunBranch.IterateNodesPrefix()
+                       where node.SubTrees.Count > 0
+                       from subtree in node.SubTrees
+                       select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).ToList();
+
+      if (cutPoints.Count() == 0)
+        // no cut point found => abort;
+        return false;
+      var selectedCutPoint = cutPoints[random.Next(cutPoints.Count)];
+      var allowedArgumentIndexes = Enumerable.Range(0, maxFunctionArguments);
+      var newArgumentIndex = allowedArgumentIndexes.Except(definedArguments).First();
+      // replace the branch at the cut point with an argument node
+      var newArgNode = MakeArgumentNode(newArgumentIndex);
+      var replacedBranch = selectedCutPoint.ReplacedChild;
+      selectedCutPoint.Parent.RemoveSubTree(selectedCutPoint.ReplacedChildIndex);
+      selectedCutPoint.Parent.InsertSubTree(selectedCutPoint.ReplacedChildIndex, newArgNode);
+      // find all invocations of the selected ADF and attach a cloned version of the replaced branch (with all argument-nodes expanded)
+      var invocationNodes = from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                            where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                            select node;
+      foreach (var invocationNode in invocationNodes) {
+        // append a new argument branch after expanding all argument nodes
+        var clonedBranch = (SymbolicExpressionTreeNode)replacedBranch.Clone();
+        clonedBranch = ReplaceArgumentsInBranch(clonedBranch, invocationNode.SubTrees);
+        invocationNode.InsertSubTree(newArgumentIndex, clonedBranch);
+      }
+      // increase expected number of arguments of function defining branch
+      // it's possible that the number of actually referenced arguments was reduced (all references were replaced by a single new argument)
+      // but the number of expected arguments is increased anyway
+      selectedDefunBranch.NumberOfArguments++;
+      selectedDefunBranch.Grammar.AddSymbol(newArgNode.Symbol);
+      selectedDefunBranch.Grammar.SetMinSubtreeCount(newArgNode.Symbol, 0);
+      selectedDefunBranch.Grammar.SetMaxSubtreeCount(newArgNode.Symbol, 0);
+      // allow the argument as child of any other symbol
+      foreach (var symb in selectedDefunBranch.Grammar.Symbols)
+        for (int i = 0; i < selectedDefunBranch.Grammar.GetMaxSubtreeCount(symb); i++) {
+          selectedDefunBranch.Grammar.SetAllowedChild(symb, newArgNode.Symbol, i);
+        }
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
+        // when the changed function is known in the branch then update the number of arguments
+        var matchingSymbol = subtree.Grammar.Symbols.OfType<InvokeFunction>().Where(s => s.FunctionName == selectedDefunBranch.FunctionName).SingleOrDefault();
+        if (matchingSymbol != null) {
+          subtree.Grammar.SetMinSubtreeCount(matchingSymbol, selectedDefunBranch.NumberOfArguments);
+          subtree.Grammar.SetMaxSubtreeCount(matchingSymbol, selectedDefunBranch.NumberOfArguments);
+          foreach (var child in subtree.GetAllowedSymbols(0)) {
+            for (int i = 0; i < subtree.Grammar.GetMaxSubtreeCount(matchingSymbol); i++) {
+              subtree.Grammar.SetAllowedChild(matchingSymbol, child, i);
+            }
+          }
+        }
+      }
+      return true;
+    }
+
+    private static SymbolicExpressionTreeNode ReplaceArgumentsInBranch(SymbolicExpressionTreeNode branch, IList<SymbolicExpressionTreeNode> argumentTrees) {
+      if (branch is ArgumentTreeNode) {
+        var argNode = branch as ArgumentTreeNode;
+        // replace argument nodes by a clone of the original subtree that provided the result for the argument node
+        return (SymbolicExpressionTreeNode)argumentTrees[argNode.Symbol.ArgumentIndex].Clone();
+      } else {
+        // call recursively for all subtree
+        List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(branch.SubTrees);
+        while (branch.SubTrees.Count > 0) branch.SubTrees.RemoveAt(0);
+        foreach (var subtree in subtrees) {
+          branch.AddSubTree(ReplaceArgumentsInBranch(subtree, argumentTrees));
+        }
+        return branch;
+      }
+    }
+
+    private static SymbolicExpressionTreeNode MakeArgumentNode(int argIndex) {
+      var node = (ArgumentTreeNode)(new Argument(argIndex)).CreateTreeNode();
+      return node;
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs	(revision 3539)
@@ -0,0 +1,111 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 112
+  /// </summary>
+  [Item("ArgumentDeleter", "Manipulates a symbolic expression by deleting an argument from an existing function defining branch.")]
+  [StorableClass]
+  public sealed class ArgumentDeleter : SymbolicExpressionTreeArchitectureManipulator {
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DeleteArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DeleteArgument(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+      if (functionDefiningBranches.Count() == 0)
+        // no function defining branch => abort
+        return false;
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      if (selectedDefunBranch.NumberOfArguments <= 1)
+        // argument deletion by consolidation is not possible => abort
+        return false;
+      // the argument to be removed is always the one with the largest index 
+      // (otherwise we would have to decrement the index of the larger argument symbols)
+      var removedArgument = (from sym in selectedDefunBranch.Grammar.Symbols.OfType<Argument>()
+                             select sym.ArgumentIndex).Distinct().OrderBy(x => x).Last();
+      // find invocations of the manipulated funcion and remove the specified argument tree
+      var invocationNodes = (from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                             where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                             select node).ToList();
+      foreach (var invokeNode in invocationNodes) {
+        invokeNode.RemoveSubTree(removedArgument);
+      }
+
+      DeleteArgumentByConsolidation(random, selectedDefunBranch, removedArgument);
+
+      // delete the dynamic argument symbol that matches the argument to be removed
+      var matchingSymbol = selectedDefunBranch.Grammar.Symbols.OfType<Argument>().Where(s => s.ArgumentIndex == removedArgument).Single();
+      selectedDefunBranch.Grammar.RemoveSymbol(matchingSymbol);
+      selectedDefunBranch.NumberOfArguments--;
+      // reduce arity in known functions of all root branches
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
+        var matchingInvokeSymbol = subtree.Grammar.Symbols.OfType<InvokeFunction>().Where(s => s.FunctionName == selectedDefunBranch.FunctionName).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          subtree.Grammar.SetMinSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+          subtree.Grammar.SetMaxSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+        }
+      }
+      return true;
+    }
+
+    private static void DeleteArgumentByConsolidation(IRandom random, DefunTreeNode branch, int removedArgumentIndex) {
+      // replace references to the deleted argument with random references to existing arguments
+      var possibleArgumentSymbols = (from sym in branch.Grammar.Symbols.OfType<Argument>()
+                                     where sym.ArgumentIndex != removedArgumentIndex
+                                     select sym).ToList();
+      var argNodes = from node in branch.IterateNodesPrefix().OfType<ArgumentTreeNode>()
+                     where node.Symbol.ArgumentIndex == removedArgumentIndex
+                     select node;
+      foreach (var argNode in argNodes) {
+        var replacementSymbol = possibleArgumentSymbols.SelectRandom(random);
+        argNode.Symbol = replacementSymbol;
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 3539)
@@ -0,0 +1,125 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by duplicating an existing argument node of a function-defining branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 94
+  /// </summary>
+  [Item("ArgumentDuplicater", "Manipulates a symbolic expression by duplicating an existing argument node of a function-defining branch.")]
+  [StorableClass]
+  public sealed class ArgumentDuplicater : SymbolicExpressionTreeArchitectureManipulator {
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DuplicateArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DuplicateArgument(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+
+      var allowedArgumentIndexes = Enumerable.Range(0, maxFunctionArguments);
+      if (functionDefiningBranches.Count() == 0)
+        // no function defining branches => abort
+        return false;
+
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      var argumentSymbols = selectedDefunBranch.Grammar.Symbols.OfType<Argument>();
+      if (argumentSymbols.Count() == 0 || argumentSymbols.Count() >= maxFunctionArguments)
+        // when no argument or number of arguments is already at max allowed value => abort
+        return false;
+      var selectedArgumentSymbol = argumentSymbols.SelectRandom(random);
+      var takenIndexes = argumentSymbols.Select(s => s.ArgumentIndex);
+      var newArgumentIndex = allowedArgumentIndexes.Except(takenIndexes).First();
+
+      var newArgSymbol = new Argument(newArgumentIndex);
+
+      // replace existing references to the original argument with references to the new argument randomly in the selectedBranch
+      var argumentNodes = selectedDefunBranch.IterateNodesPrefix().OfType<ArgumentTreeNode>();
+      foreach (var argNode in argumentNodes) {
+        if (argNode.Symbol == selectedArgumentSymbol) {
+          if (random.NextDouble() < 0.5) {
+            argNode.Symbol = newArgSymbol;
+          }
+        }
+      }
+      // find invocations of the functions and duplicate the matching argument branch
+      var invocationNodes = from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                            where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                            select node;
+      foreach (var invokeNode in invocationNodes) {
+        var argumentBranch = invokeNode.SubTrees[selectedArgumentSymbol.ArgumentIndex];
+        var clonedArgumentBranch = (SymbolicExpressionTreeNode)argumentBranch.Clone();
+        invokeNode.InsertSubTree(newArgumentIndex, clonedArgumentBranch);
+      }
+      // register the new argument symbol and increase the number of arguments of the ADF
+      selectedDefunBranch.Grammar.AddSymbol(newArgSymbol);
+      selectedDefunBranch.Grammar.SetMinSubtreeCount(newArgSymbol, 0);
+      selectedDefunBranch.Grammar.SetMaxSubtreeCount(newArgSymbol, 0);
+      // allow the argument as child of any other symbol
+      foreach (var symb in selectedDefunBranch.Grammar.Symbols)
+        for (int i = 0; i < selectedDefunBranch.Grammar.GetMaxSubtreeCount(symb); i++) {
+          selectedDefunBranch.Grammar.SetAllowedChild(symb, newArgSymbol, i);
+        }
+      selectedDefunBranch.NumberOfArguments++;
+
+      // increase the arity of the changed ADF in all branches that can use this ADF
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
+        var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                    where symb.FunctionName == selectedDefunBranch.FunctionName
+                                    select symb).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          subtree.Grammar.SetMinSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+          subtree.Grammar.SetMaxSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+          foreach (var child in subtree.GetAllowedSymbols(0)) {
+            for (int i = 0; i < subtree.Grammar.GetMaxSubtreeCount(matchingInvokeSymbol); i++) {
+              subtree.Grammar.SetAllowedChild(matchingInvokeSymbol, child, i);
+            }
+          }
+        }
+      }
+      return true;
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/GrammarModifier.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/GrammarModifier.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/GrammarModifier.cs	(revision 3539)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  public static class GrammarModifier {
+    public static void AddDynamicSymbol(ISymbolicExpressionGrammar grammar, Symbol classRepresentative, string symbolName, int nArgs) {
+      var invokeSym = new InvokeFunction(symbolName);
+      grammar.AddSymbol(invokeSym);
+      grammar.SetMinSubtreeCount(invokeSym, nArgs);
+      grammar.SetMaxSubtreeCount(invokeSym, nArgs);
+      SetSyntaxConstraints(grammar, classRepresentative, invokeSym);
+    }
+
+
+    public static void AddDynamicArguments(ISymbolicExpressionGrammar grammar, Symbol classRepresentative, IEnumerable<int> argumentIndexes) {
+      foreach (int argIndex in argumentIndexes) {
+        var argSymbol = new Argument(argIndex);
+        grammar.AddSymbol(argSymbol);
+        grammar.SetMinSubtreeCount(argSymbol, 0);
+        grammar.SetMaxSubtreeCount(argSymbol, 0);
+        SetSyntaxConstraints(grammar, classRepresentative, argSymbol);
+      }
+    }
+
+    private static void SetSyntaxConstraints(ISymbolicExpressionGrammar grammar, Symbol classRepresentative, Symbol newSymbol) {
+      // allow symbol as child of the representative first to make sure that the symbol 
+      // is in the list of parents and children
+      for (int i = 0; i < grammar.GetMaxSubtreeCount(classRepresentative); i++) {
+        grammar.SetAllowedChild(classRepresentative, newSymbol, i);
+      }
+      // for all available symbols add the new symbol as allowed child iff the available symbol is an allowed child of the class representative
+      foreach (var parent in grammar.Symbols) {
+        if (grammar.IsAllowedChild(classRepresentative, parent, 0))
+          for (int arg = 0; arg < grammar.GetMaxSubtreeCount(parent); arg++) {
+            grammar.SetAllowedChild(parent, newSymbol, arg);
+          }
+      }
+      // for all available symbols add the new symbol as allowed parent iff the available symbol is an allowed child of the class representative
+      foreach (var child in grammar.Symbols) {
+        if (grammar.IsAllowedChild(classRepresentative, child, 0))
+          for (int arg = 0; arg < grammar.GetMaxSubtreeCount(newSymbol); arg++) {
+            grammar.SetAllowedChild(newSymbol, child, arg);
+          }
+      }
+    }
+
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 3539)
@@ -0,0 +1,135 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  [Item("MultiSymbolicExpressionTreeArchitectureManipulator", "Randomly selects and applies one of its architecture manipulators every time it is called.")]
+  [StorableClass]
+  public class MultiSymbolicExpressionTreeArchitectureManipulator : StochasticMultiOperator<ISymbolicExpressionTreeArchitectureManipulator>, ISymbolicExpressionTreeArchitectureManipulator, IStochasticOperator {
+    private const string MaxTreeSizeParameterName = "MaxTreeSize";
+    private const string MaxTreeHeightParameterName = "MaxTreeHeight";
+    private const string SymbolicExpressionGrammarParameterName = "SymbolicExpressionGrammar";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments";
+    private const string MaxFunctionDefiningBranchesParameterName = "MaxFunctionDefiningBranches";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    protected override bool CreateChildOperation {
+      get { return true; }
+    }
+    #region ISymbolicExpressionTreeArchitectureManipulator Members
+    public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionDefiningBranchesParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }
+    }
+    #endregion
+
+
+    #region ISymbolicExpressionTreeManipulator Members
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    #endregion
+
+    #region ISymbolicExpressionTreeOperator Members
+    public IValueLookupParameter<IntValue> MaxTreeSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeSizeParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxTreeHeightParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeHeightParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionGrammarParameterName]; }
+    }
+    #endregion
+
+
+    [StorableConstructor]
+    private MultiSymbolicExpressionTreeArchitectureManipulator(bool deserializing) : base(deserializing) { }
+    public MultiSymbolicExpressionTreeArchitectureManipulator()
+      : base() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefiningBranchesParameterName, "The maximal allowed number of function defining branches."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionArgumentsParameterName, "The maximal allowed number of arguments of a newly created function."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeSizeParameterName, "The maximal size (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeHeightParameterName, "The maximal height of the symbolic expression tree (a tree with one node has height = 0)."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionGrammarParameterName, "The grammar that defines the allowed symbols and syntax of the symbolic expression trees."));
+
+      Operators.Add(new ArgumentCreater());
+      Operators.Add(new ArgumentDeleter());
+      Operators.Add(new ArgumentDuplicater());
+      Operators.Add(new SubroutineCreater());
+      Operators.Add(new SubroutineDeleter());
+      Operators.Add(new SubroutineDuplicater());
+    }
+
+    protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) {
+      base.Operators_ItemsReplaced(sender, e);
+      ParameterizeManipulators();
+    }
+
+    protected override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) {
+      base.Operators_ItemsAdded(sender, e);
+      ParameterizeManipulators();
+    }
+
+    private void ParameterizeManipulators() {
+      foreach (ISymbolicExpressionTreeArchitectureManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeArchitectureManipulator>()) {
+        manipulator.MaxTreeSizeParameter.ActualName = MaxTreeSizeParameter.Name;
+        manipulator.MaxTreeHeightParameter.ActualName = MaxTreeHeightParameter.Name;
+        manipulator.SymbolicExpressionGrammarParameter.ActualName = SymbolicExpressionGrammarParameter.Name;
+        manipulator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+        manipulator.MaxFunctionDefinitionsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
+        manipulator.MaxFunctionArgumentsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
+      }
+
+      foreach (IStochasticOperator manipulator in Operators.OfType<IStochasticOperator>()) {
+        manipulator.RandomParameter.ActualName = RandomParameter.Name;
+      }
+    }
+
+    public override IOperation Apply() {
+      if (Operators.Count == 0) throw new InvalidOperationException(Name + ": Please add at least one symbolic expression tree architecture manipulator to choose from.");
+      return base.Apply();
+    }
+
+    #region ISymbolicExpressionTreeArchitectureManipulator Members
+    public void ModifyArchitecture(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments, out bool success) {
+      var op = Operators.SelectRandom(random);
+      op.ModifyArchitecture(random, symbolicExpressionTree, grammar, maxTreeSize, maxTreeHeight, maxFunctionDefiningBranches, maxFunctionArguments, out success);
+    }
+    #endregion
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs	(revision 3539)
@@ -0,0 +1,225 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by adding one new function-defining branch containing
+  /// a proportion of a preexisting branch and by creating a reference to the new branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 97
+  /// </summary>
+  [Item("SubroutineCreater", "Manipulates a symbolic expression by adding one new function-defining branch containing a proportion of a preexisting branch and by creating a reference to the new branch.")]
+  [StorableClass]
+  public sealed class SubroutineCreater : SymbolicExpressionTreeArchitectureManipulator {
+    private const double ARGUMENT_CUTOFF_PROBABILITY = 0.05;
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = CreateSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool CreateSubroutine(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+      if (functionDefiningBranches.Count() >= maxFunctionDefiningBranches)
+        // allowed maximum number of ADF reached => abort
+        return false;
+      if (symbolicExpressionTree.Size + 4 > maxTreeSize)
+        // defining a new function causes an size increase by 4 nodes (max) if the max tree size is reached => abort
+        return false;
+      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefiningBranches * 10 - 1)).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefiningBranches)
+                                 select "ADF" + index.ToString(formatString);
+
+      // select a random body (either the result producing branch or an ADF branch)
+      var bodies = from node in symbolicExpressionTree.Root.SubTrees
+                   select new { Tree = node, Size = node.GetSize() };
+      var totalNumberOfBodyNodes = bodies.Select(x => x.Size).Sum();
+      int r = random.Next(totalNumberOfBodyNodes);
+      int aggregatedNumberOfBodyNodes = 0;
+      SymbolicExpressionTreeNode selectedBody = null;
+      foreach (var body in bodies) {
+        aggregatedNumberOfBodyNodes += body.Size;
+        if (aggregatedNumberOfBodyNodes > r)
+          selectedBody = body.Tree;
+      }
+      // sanity check
+      if (selectedBody == null) throw new InvalidOperationException();
+
+      // select a random cut point in the selected branch
+      var allCutPoints = from parent in selectedBody.IterateNodesPrefix()
+                         from subtree in parent.SubTrees
+                         select new { Parent = parent, ReplacedBranchIndex = parent.SubTrees.IndexOf(subtree), ReplacedBranch = subtree };
+      if (allCutPoints.Count() == 0)
+        // no cut points => abort
+        return false;
+      string newFunctionName = allowedFunctionNames.Except(functionDefiningBranches.Select(x => x.FunctionName)).First();
+      var selectedCutPoint = allCutPoints.SelectRandom(random);
+      // select random branches as argument cut-off points (replaced by argument terminal nodes in the function)
+      List<SymbolicExpressionTreeNode> argumentBranches = SelectRandomArgumentBranches(selectedCutPoint.ReplacedBranch, random, ARGUMENT_CUTOFF_PROBABILITY, maxFunctionArguments);
+      SymbolicExpressionTreeNode functionBody = selectedCutPoint.ReplacedBranch;
+      // disconnect the function body from the tree
+      selectedCutPoint.Parent.RemoveSubTree(selectedCutPoint.ReplacedBranchIndex);
+      // disconnect the argument branches from the function
+      functionBody = DisconnectBranches(functionBody, argumentBranches);
+      // insert a function invocation symbol instead
+      var invokeNode = (InvokeFunctionTreeNode)(new InvokeFunction(newFunctionName)).CreateTreeNode();
+      selectedCutPoint.Parent.InsertSubTree(selectedCutPoint.ReplacedBranchIndex, invokeNode);
+      // add the branches selected as argument as subtrees of the function invocation node
+      foreach (var argumentBranch in argumentBranches)
+        invokeNode.AddSubTree(argumentBranch);
+
+      // insert a new function defining branch
+      var defunNode = (DefunTreeNode)(new Defun()).CreateTreeNode();
+      defunNode.FunctionName = newFunctionName;
+      defunNode.AddSubTree(functionBody);
+      symbolicExpressionTree.Root.AddSubTree(defunNode);
+      // the grammar in the newly defined function is a clone of the grammar of the originating branch
+      defunNode.Grammar = (ISymbolicExpressionGrammar)selectedBody.Grammar.Clone();
+      // remove all argument symbols from grammar
+      var oldArgumentSymbols = defunNode.Grammar.Symbols.OfType<Argument>().ToList();
+      foreach (var oldArgSymb in oldArgumentSymbols)
+        defunNode.Grammar.RemoveSymbol(oldArgSymb);
+      // find unique argument indexes and matching symbols in the function defining branch 
+      var newArgumentIndexes = (from node in defunNode.IterateNodesPrefix().OfType<ArgumentTreeNode>()
+                                select node.Symbol.ArgumentIndex).Distinct();
+      // add argument symbols to grammar of function defining branch
+      GrammarModifier.AddDynamicArguments(defunNode.Grammar, defunNode.Symbol, newArgumentIndexes);
+      defunNode.NumberOfArguments = newArgumentIndexes.Count();
+      if (defunNode.NumberOfArguments != argumentBranches.Count) throw new InvalidOperationException();
+      // add invoke symbol for newly defined function to the original branch 
+      var allowedParents = from symb in selectedBody.Grammar.Symbols
+                           where !(symb is ProgramRootSymbol)
+                           select symb;
+      var allowedChildren = from symb in selectedBody.Grammar.Symbols
+                            where selectedBody.Grammar.IsAllowedChild(selectedBody.Symbol, symb, 0)
+                            select symb;
+      GrammarModifier.AddDynamicSymbol(selectedBody.Grammar, selectedBody.Symbol, defunNode.FunctionName, defunNode.NumberOfArguments);
+
+      // when the new function body was taken from another function definition
+      // add invoke symbol for newly defined function to all branches that are allowed to invoke the original branch
+      if (selectedBody.Symbol is Defun) {
+        var originalFunctionDefinition = selectedBody as DefunTreeNode;
+        foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
+          var originalBranchInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                            where symb.FunctionName == originalFunctionDefinition.FunctionName
+                                            select symb).SingleOrDefault();
+          // when the original branch can be invoked from the subtree then also allow invocation of the function
+          if (originalBranchInvokeSymbol != null) {
+            allowedParents = from symb in subtree.Grammar.Symbols
+                             where !(symb is ProgramRootSymbol)
+                             select symb;
+            allowedChildren = from symb in subtree.Grammar.Symbols
+                              where subtree.Grammar.IsAllowedChild(subtree.Symbol, symb, 0)
+                              select symb;
+            GrammarModifier.AddDynamicSymbol(subtree.Grammar, subtree.Symbol, defunNode.FunctionName, defunNode.NumberOfArguments);
+          }
+        }
+      }
+      return true;
+    }
+
+    private static SymbolicExpressionTreeNode DisconnectBranches(SymbolicExpressionTreeNode node, List<SymbolicExpressionTreeNode> argumentBranches) {
+      if (argumentBranches.Contains(node)) {
+        var argumentIndex = argumentBranches.IndexOf(node);
+        var argSymbol = new Argument(argumentIndex);
+        return argSymbol.CreateTreeNode();
+      }
+      // remove the subtrees so that we can clone only the root node
+      List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(node.SubTrees);
+      while (node.SubTrees.Count > 0) node.SubTrees.RemoveAt(0);
+      // recursively apply function for subtrees or append a argument terminal node
+      foreach (var subtree in subtrees) {
+        node.AddSubTree(DisconnectBranches(subtree, argumentBranches));
+      }
+      return node;
+    }
+
+    private static List<SymbolicExpressionTreeNode> SelectRandomArgumentBranches(SymbolicExpressionTreeNode selectedRoot,
+      IRandom random,
+      double cutProbability,
+      int maxArguments) {
+      // breadth first determination of argument cut-off points
+      // we must make sure that we cut off all original argument nodes and that the number of new argument is smaller than the limit
+      List<SymbolicExpressionTreeNode> argumentBranches = new List<SymbolicExpressionTreeNode>();
+      if (selectedRoot is ArgumentTreeNode) {
+        argumentBranches.Add(selectedRoot);
+        return argumentBranches;
+      } else {
+        // get the number of argument nodes (which must be cut-off) in the sub-trees
+        var numberOfArgumentsInSubtrees = (from subtree in selectedRoot.SubTrees
+                                           let nArgumentsInTree = subtree.IterateNodesPrefix().OfType<ArgumentTreeNode>().Count()
+                                           select nArgumentsInTree).ToList();
+        // determine the minimal number of new argument nodes for each sub-tree
+        var minNewArgumentsForSubtrees = numberOfArgumentsInSubtrees.Select(x => x > 0 ? 1 : 0).ToList();
+        if (minNewArgumentsForSubtrees.Sum() > maxArguments) {
+          argumentBranches.Add(selectedRoot);
+          return argumentBranches;
+        }
+        // cut-off in the sub-trees in random order
+        var randomIndexes = (from index in Enumerable.Range(0, selectedRoot.SubTrees.Count)
+                             select new { Index = index, OrderValue = random.NextDouble() }).OrderBy(x => x.OrderValue).Select(x => x.Index);
+        foreach (var subtreeIndex in randomIndexes) {
+          var subtree = selectedRoot.SubTrees[subtreeIndex];
+          minNewArgumentsForSubtrees[subtreeIndex] = 0;
+          // => cut-off at 0..n points somewhere in the current sub-tree
+          // determine the maximum number of new arguments that should be created in the branch
+          // as the maximum for the whole branch minus already added arguments minus minimal number of arguments still left
+          int maxArgumentsFromBranch = maxArguments - argumentBranches.Count - minNewArgumentsForSubtrees.Sum();
+          // when no argument is allowed from the current branch then we have to include the whole branch into the function
+          // otherwise: choose randomly wether to cut off immediately or wether to extend the function body into the branch
+          if (maxArgumentsFromBranch == 0) {
+            // don't cut at all => the whole sub-tree branch is included in the function body
+            // (we already checked ahead of time that there are no arguments left over in the subtree)
+          } else if (random.NextDouble() >= cutProbability) {
+            argumentBranches.AddRange(SelectRandomArgumentBranches(subtree, random, cutProbability, maxArgumentsFromBranch));
+          } else {
+            // cut-off at current sub-tree
+            argumentBranches.Add(subtree);
+          }
+        }
+        return argumentBranches;
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs	(revision 3539)
@@ -0,0 +1,118 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by deleting a preexisting function-defining branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 108
+  /// </summary>
+  [Item("SubroutineDeleter", "Manipulates a symbolic expression by deleting a preexisting function-defining branch.")]
+  [StorableClass]
+  public sealed class SubroutineDeleter : SymbolicExpressionTreeArchitectureManipulator {
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DeleteSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DeleteSubroutine(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+
+      if (functionDefiningBranches.Count() == 0)
+        // no ADF to delete => abort
+        return false;
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      // remove the selected defun
+      int defunSubtreeIndex = symbolicExpressionTree.Root.SubTrees.IndexOf(selectedDefunBranch);
+      symbolicExpressionTree.Root.RemoveSubTree(defunSubtreeIndex);
+
+      // remove references to deleted function
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees.OfType<SymbolicExpressionTreeTopLevelNode>()) {
+        var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                    where symb.FunctionName == selectedDefunBranch.FunctionName
+                                    select symb).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          subtree.Grammar.RemoveSymbol(matchingInvokeSymbol);
+        }
+      }
+
+      DeletionByRandomRegeneration(random, symbolicExpressionTree, selectedDefunBranch);
+      return true;
+    }
+
+    private static void DeletionByRandomRegeneration(IRandom random, SymbolicExpressionTree symbolicExpressionTree, DefunTreeNode selectedDefunBranch) {
+      // find first invocation and replace it with a randomly generated tree
+      // can't find all invocations in one step because once we replaced a top level invocation
+      // the invocations below it are removed already
+      var invocationCutPoint = (from node in symbolicExpressionTree.IterateNodesPrefix()
+                                from subtree in node.SubTrees.OfType<InvokeFunctionTreeNode>()
+                                where subtree.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                                select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).FirstOrDefault();
+      while (invocationCutPoint != null) {
+        // deletion by random regeneration
+        SymbolicExpressionTreeNode replacementTree = null;
+        // TODO: should weight symbols by tickets
+        var selectedSymbol = invocationCutPoint.Parent.GetAllowedSymbols(invocationCutPoint.ReplacedChildIndex).SelectRandom(random);
+
+        int minPossibleSize = invocationCutPoint.Parent.Grammar.GetMinExpressionLength(selectedSymbol);
+        int maxSize = Math.Max(minPossibleSize, invocationCutPoint.ReplacedChild.GetSize());
+        int minPossibleHeight = invocationCutPoint.Parent.Grammar.GetMinExpressionDepth(selectedSymbol);
+        int maxHeight = Math.Max(minPossibleHeight, invocationCutPoint.ReplacedChild.GetHeight());
+        replacementTree = selectedSymbol.CreateTreeNode();
+        if (replacementTree.HasLocalParameters)
+          replacementTree.ResetLocalParameters(random);
+        invocationCutPoint.Parent.RemoveSubTree(invocationCutPoint.ReplacedChildIndex);
+        invocationCutPoint.Parent.InsertSubTree(invocationCutPoint.ReplacedChildIndex, replacementTree);
+
+        ProbabilisticTreeCreator.PTC2(random, replacementTree, maxSize, maxHeight, 0, 0);
+
+        invocationCutPoint = (from node in symbolicExpressionTree.IterateNodesPrefix()
+                              from subtree in node.SubTrees.OfType<InvokeFunctionTreeNode>()
+                              where subtree.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                              select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).FirstOrDefault();
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 3539)
@@ -0,0 +1,106 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using System.Diagnostics;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by duplicating a preexisting function-defining branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 88
+  /// </summary>
+  [Item("SubroutineDuplicater", "Manipulates a symbolic expression by duplicating a preexisting function-defining branch.")]
+  [StorableClass]
+  public sealed class SubroutineDuplicater : SymbolicExpressionTreeArchitectureManipulator {
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DuplicateSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DuplicateSubroutine(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+
+      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefiningBranches) + 1).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefiningBranches)
+                                 select "ADF" + index.ToString(formatString);
+      if (functionDefiningBranches.Count() == 0 || functionDefiningBranches.Count() == maxFunctionDefiningBranches)
+        // no function defining branches to duplicate or already reached the max number of ADFs
+        return false;
+      var selectedBranch = functionDefiningBranches.SelectRandom(random);
+      var duplicatedDefunBranch = (DefunTreeNode)selectedBranch.Clone();
+      string newFunctionName = allowedFunctionNames.Except(UsedFunctionNames(symbolicExpressionTree)).First();
+      duplicatedDefunBranch.FunctionName = newFunctionName;
+      symbolicExpressionTree.Root.SubTrees.Add(duplicatedDefunBranch);
+      duplicatedDefunBranch.Grammar = (ISymbolicExpressionGrammar)selectedBranch.Grammar.Clone();
+      // add an invoke symbol for each branch that is allowed to invoke the original function
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees.OfType<SymbolicExpressionTreeTopLevelNode>()) {
+        var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                    where symb.FunctionName == selectedBranch.FunctionName
+                                    select symb).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          GrammarModifier.AddDynamicSymbol(subtree.Grammar, subtree.Symbol, duplicatedDefunBranch.FunctionName, duplicatedDefunBranch.NumberOfArguments);
+        }
+        // in the current subtree:
+        // for all invoke nodes of the original function replace the invoke of the original function with an invoke of the new function randomly
+        var originalFunctionInvocations = from node in subtree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                                          where node.Symbol.FunctionName == selectedBranch.FunctionName
+                                          select node;
+        foreach (var originalFunctionInvokeNode in originalFunctionInvocations) {
+          var newInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                 where symb.FunctionName == duplicatedDefunBranch.FunctionName
+                                 select symb).Single();
+          // flip coin wether to replace with newly defined function
+          if (random.NextDouble() < 0.5) {
+            originalFunctionInvokeNode.Symbol = newInvokeSymbol;
+          }
+        }
+      }
+      return true;
+    }
+
+    private static IEnumerable<string> UsedFunctionNames(SymbolicExpressionTree symbolicExpressionTree) {
+      return from node in symbolicExpressionTree.IterateNodesPrefix()
+             where node.Symbol is Defun
+             select ((DefunTreeNode)node).FunctionName;
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 3539)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 3539)
@@ -0,0 +1,82 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Base class for architecture altering operators for symbolic expression trees.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeArchitectureManipulator : SymbolicExpressionTreeManipulator, ISymbolicExpressionTreeArchitectureManipulator {
+    private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments";
+    private const string MaxFunctionDefiningBranchesParameterName = "MaxFunctionDefiningBranches";
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionDefiningBranchesParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }
+    }
+    public IntValue MaxFunctionDefiningBranches {
+      get { return MaxFunctionDefinitionsParameter.ActualValue; }
+    }
+    public IntValue MaxFunctionArguments {
+      get { return MaxFunctionArgumentsParameter.ActualValue; }
+    }
+    public SymbolicExpressionTreeArchitectureManipulator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefiningBranchesParameterName, "The maximal allowed number of function defining branches."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionArgumentsParameterName, "The maximal allowed number of arguments of a newly created function."));
+    }
+
+    protected override sealed void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) {
+      ModifyArchitecture(random, symbolicExpressionTree, grammar, maxTreeSize, maxTreeHeight, MaxFunctionDefiningBranches, MaxFunctionArguments, out success);
+    }
+
+    public abstract void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree tree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize,
+      IntValue maxTreeHeight,
+      IntValue maxFunctionDefinitions,
+      IntValue maxFunctionArguments,
+      out bool success
+      );
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/ProbabilisticTreeCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/ProbabilisticTreeCreator.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/ProbabilisticTreeCreator.cs	(revision 3539)
@@ -29,5 +29,5 @@
 using HeuristicLab.Random;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj	(revision 3539)
@@ -83,15 +83,13 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="ArchitectureAlteringOperators\ArgumentCreater.cs" />
-    <Compile Include="ArchitectureAlteringOperators\ArgumentDeleter.cs" />
-    <Compile Include="ArchitectureAlteringOperators\ArgumentDuplicater.cs" />
-    <Compile Include="ArchitectureAlteringOperators\GrammarModifier.cs" />
-    <Compile Include="ArchitectureAlteringOperators\MultiSymbolicExpressionTreeArchitectureManipulator.cs" />
-    <Compile Include="ArchitectureAlteringOperators\SubroutineCreater.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ArchitectureAlteringOperators\SubroutineDeleter.cs" />
-    <Compile Include="ArchitectureAlteringOperators\SubroutineDuplicater.cs" />
-    <Compile Include="ArchitectureAlteringOperators\SymbolicExpressionTreeArchitectureAlteringOperator.cs" />
+    <Compile Include="ArchitectureManipulators\ArgumentCreater.cs" />
+    <Compile Include="ArchitectureManipulators\ArgumentDeleter.cs" />
+    <Compile Include="ArchitectureManipulators\ArgumentDuplicater.cs" />
+    <Compile Include="ArchitectureManipulators\GrammarModifier.cs" />
+    <Compile Include="ArchitectureManipulators\MultiSymbolicExpressionTreeArchitectureManipulator.cs" />
+    <Compile Include="ArchitectureManipulators\SubroutineCreater.cs" />
+    <Compile Include="ArchitectureManipulators\SubroutineDeleter.cs" />
+    <Compile Include="ArchitectureManipulators\SubroutineDuplicater.cs" />
+    <Compile Include="ArchitectureManipulators\SymbolicExpressionTreeArchitectureManipulator.cs" />
     <Compile Include="Compiler\Instruction.cs" />
     <Compile Include="Compiler\SymbolicExpressionTreeCompiler.cs" />
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs	(revision 3539)
@@ -28,5 +28,5 @@
 using HeuristicLab.Random;
 using System.Diagnostics;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Data;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentCreaterTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentCreaterTest.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentCreaterTest.cs	(revision 3539)
@@ -28,5 +28,5 @@
 using HeuristicLab.Random;
 using System.Diagnostics;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDeleterTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDeleterTest.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDeleterTest.cs	(revision 3539)
@@ -28,5 +28,5 @@
 using HeuristicLab.Random;
 using System.Diagnostics;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDuplicaterTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDuplicaterTest.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDuplicaterTest.cs	(revision 3539)
@@ -28,5 +28,5 @@
 using HeuristicLab.Random;
 using System.Diagnostics;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineCreaterTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineCreaterTest.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineCreaterTest.cs	(revision 3539)
@@ -28,5 +28,5 @@
 using HeuristicLab.Random;
 using System.Diagnostics;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDeleterTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDeleterTest.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDeleterTest.cs	(revision 3539)
@@ -28,5 +28,5 @@
 using HeuristicLab.Random;
 using System.Diagnostics;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDuplicaterTest.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDuplicaterTest.cs	(revision 3535)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDuplicaterTest.cs	(revision 3539)
@@ -28,5 +28,5 @@
 using HeuristicLab.Random;
 using System.Diagnostics;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureAlteringOperators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
 
