Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 5580)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 5686)
@@ -29,5 +29,5 @@
   [StorableClass]
   [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")]
-  public class ArithmeticExpressionGrammar : DefaultSymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+  public class ArithmeticExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
 
     [StorableConstructor]
@@ -59,23 +59,18 @@
 
       foreach (var funSymb in functionSymbols) {
-        SetMinSubtreeCount(funSymb, 1);
-        SetMaxSubtreeCount(funSymb, 3);
+        SetSubtreeCount(funSymb, 1, 3);
       }
-      SetMinSubtreeCount(constant, 0);
-      SetMaxSubtreeCount(constant, 0);
-      SetMinSubtreeCount(variableSymbol, 0);
-      SetMaxSubtreeCount(variableSymbol, 0);
+      SetSubtreeCount(constant, 0, 0);
+      SetSubtreeCount(variableSymbol, 0, 0);
 
       // allow each symbol as child of the start symbol
       foreach (var symb in allSymbols) {
-        SetAllowedChild(StartSymbol, symb, 0);
+        AddAllowedChildSymbol(StartSymbol, symb);
       }
 
       // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
-      foreach (var parent in allSymbols) {
-        for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
-          foreach (var child in allSymbols) {
-            SetAllowedChild(parent, child, i);
-          }
+      foreach (var parent in functionSymbols) {
+        foreach (var child in allSymbols)
+          AddAllowedChildSymbol(parent, child);
       }
     }
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs	(revision 5580)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs	(revision 5686)
@@ -21,4 +21,5 @@
 
 using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -29,5 +30,5 @@
   [StorableClass]
   [Item("FullFunctionalExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
-  public class FullFunctionalExpressionGrammar : DefaultSymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+  public class FullFunctionalExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
     [StorableConstructor]
     protected FullFunctionalExpressionGrammar(bool deserializing) : base(deserializing) { }
@@ -92,36 +93,28 @@
 
       foreach (var funSymb in functionSymbols) {
-        SetMinSubtreeCount(funSymb, 1);
-        SetMaxSubtreeCount(funSymb, 3);
+        SetSubtreeCount(funSymb, 1, 3);
       }
       foreach (var funSymb in unaryFunctionSymbols) {
-        SetMinSubtreeCount(funSymb, 1);
-        SetMaxSubtreeCount(funSymb, 1);
+        SetSubtreeCount(funSymb, 1, 1);
       }
       foreach (var funSymb in binaryFunctionSymbols) {
-        SetMinSubtreeCount(funSymb, 2);
-        SetMaxSubtreeCount(funSymb, 2);
+        SetSubtreeCount(funSymb, 2, 2);
+      }
+      foreach (var terminalSymbol in terminalSymbols) {
+        SetSubtreeCount(terminalSymbol, 0, 0);
       }
 
-      foreach (var terminalSymbol in terminalSymbols) {
-        SetMinSubtreeCount(terminalSymbol, 0);
-        SetMaxSubtreeCount(terminalSymbol, 0);
-      }
-
-      SetMinSubtreeCount(@if, 3);
-      SetMaxSubtreeCount(@if, 3);
+      SetSubtreeCount(@if, 3, 3);
 
 
       // allow each symbol as child of the start symbol
       foreach (var symb in allSymbols) {
-        SetAllowedChild(StartSymbol, symb, 0);
+        AddAllowedChildSymbol(StartSymbol, symb);
       }
 
       // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
-      foreach (var parent in allSymbols) {
-        for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
-          foreach (var child in allSymbols) {
-            SetAllowedChild(parent, child, i);
-          }
+      foreach (var parent in allSymbols.Except(terminalSymbols)) {
+        foreach (var child in allSymbols)
+          AddAllowedChildSymbol(parent, child);
       }
     }
Index: branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
===================================================================
--- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 5580)
+++ branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 5686)
@@ -29,5 +29,5 @@
   [StorableClass]
   [Item("TypeCoherentExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that boolean and real-valued expressions are not mixed.")]
-  public class TypeCoherentExpressionGrammar : DefaultSymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+  public class TypeCoherentExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
 
     [StorableConstructor]
@@ -123,29 +123,25 @@
 
       foreach (var unaryFun in unaryFunctionSymbols.Concat(unaryBooleanFunctionSymbols)) {
-        SetMinSubtreeCount(unaryFun, 1);
-        SetMaxSubtreeCount(unaryFun, 1);
+        SetSubtreeCount(unaryFun, 1, 1);
       }
       foreach (var binaryFun in binaryFunctionSymbols.Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols)) {
-        SetMinSubtreeCount(binaryFun, 2);
-        SetMaxSubtreeCount(binaryFun, 2);
+        SetSubtreeCount(binaryFun, 2, 2);
       }
 
       foreach (var terminalSymbol in terminalSymbols) {
-        SetMinSubtreeCount(terminalSymbol, 0);
-        SetMaxSubtreeCount(terminalSymbol, 0);
+        SetSubtreeCount(terminalSymbol, 0, 0);
       }
 
-      SetMinSubtreeCount(@if, 3);
-      SetMaxSubtreeCount(@if, 3);
+      SetSubtreeCount(@if, 3, 3);
 
 
       // allow only real-valued expressions as child of the start symbol
       foreach (var symb in realValuedSymbols) {
-        SetAllowedChild(StartSymbol, symb, 0);
+        AddAllowedChildSymbol(StartSymbol, symb);
       }
 
       foreach (var symb in unaryFunctionSymbols) {
         foreach (var childSymb in realValuedSymbols) {
-          SetAllowedChild(symb, childSymb, 0);
+          AddAllowedChildSymbol(symb, childSymb);
         }
       }
@@ -153,32 +149,29 @@
       foreach (var symb in binaryFunctionSymbols) {
         foreach (var childSymb in realValuedSymbols) {
-          SetAllowedChild(symb, childSymb, 0);
-          SetAllowedChild(symb, childSymb, 1);
+          AddAllowedChildSymbol(symb, childSymb);
         }
       }
 
       foreach (var childSymb in booleanSymbols) {
-        SetAllowedChild(@if, childSymb, 0);
+        AddAllowedChildSymbol(@if, childSymb, 0);
       }
       foreach (var childSymb in realValuedSymbols) {
-        SetAllowedChild(@if, childSymb, 1);
-        SetAllowedChild(@if, childSymb, 2);
+        AddAllowedChildSymbol(@if, childSymb, 1);
+        AddAllowedChildSymbol(@if, childSymb, 2);
       }
 
       foreach (var symb in relationalFunctionSymbols) {
         foreach (var childSymb in realValuedSymbols) {
-          SetAllowedChild(symb, childSymb, 0);
-          SetAllowedChild(symb, childSymb, 1);
+          AddAllowedChildSymbol(symb, childSymb);
         }
       }
       foreach (var symb in binaryBooleanFunctionSymbols) {
         foreach (var childSymb in booleanSymbols) {
-          SetAllowedChild(symb, childSymb, 0);
-          SetAllowedChild(symb, childSymb, 1);
+          AddAllowedChildSymbol(symb, childSymb);
         }
       }
       foreach (var symb in unaryBooleanFunctionSymbols) {
         foreach (var childSymb in booleanSymbols) {
-          SetAllowedChild(symb, childSymb, 0);
+          AddAllowedChildSymbol(symb, childSymb);
         }
       }
