Index: /branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs
===================================================================
--- /branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs	(revision 15929)
+++ /branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs	(revision 15930)
@@ -1,3 +1,4 @@
-﻿using System.Collections.Generic;
+﻿using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
@@ -8,4 +9,13 @@
 
 namespace HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration {
+  public enum GrammarRule {
+    MultipleTerms,
+    MultipleFactors,
+    InverseTerm,
+    Logarithm,
+    Exponentiation,
+    Sine
+  }
+
   public class Grammar {
 
@@ -63,5 +73,7 @@
     #endregion
 
-    public Grammar(string[] variables) {
+    public Grammar(string[] variables) : this(variables, Enum.GetValues(typeof(GrammarRule)).Cast<GrammarRule>()) { }
+
+    public Grammar(string[] variables, IEnumerable<GrammarRule> includedRules) {
       #region Define Symbols
       Var = new NonterminalSymbol("Var");
@@ -99,21 +111,31 @@
       productions[Var] = VarTerminals.Select(v => new Production(v)).ToArray();
 
-      productions[Expr] = new[] {
-        new Production(Const, Term, Multiplication, Expr, Addition),
-        new Production(Const, Term, Multiplication, Const, Addition)
-      };
-
-      productions[Term] = new[] {
-        new Production(Factor, Term, Multiplication),
-        new Production(Factor),
-        new Production(InvExpr, Inv)
-      };
-
-      productions[Factor] = new[] {
-        new Production(Var),
-        new Production(LogFactor),
-        new Production(ExpFactor),
-        new Production(SinFactor),
-      };
+      // Expression Grammar Rules
+      var exprProductions = new List<Production>();
+      if (includedRules.Contains(GrammarRule.MultipleTerms))
+        exprProductions.Add(new Production(Const, Term, Multiplication, Expr, Addition));
+
+      exprProductions.Add(new Production(Const, Term, Multiplication, Const, Addition));
+      productions[Expr] = exprProductions.ToArray();
+
+      // Term Grammar Rules
+      var termProductions = new List<Production>();
+      if (includedRules.Contains(GrammarRule.MultipleFactors))
+        termProductions.Add(new Production(Factor, Term, Multiplication));
+      if (includedRules.Contains(GrammarRule.InverseTerm))
+        termProductions.Add(new Production(InvExpr, Inv));
+      termProductions.Add(new Production(Factor));
+      productions[Term] = termProductions.ToArray();
+
+      // Factor Grammar Rules
+      var factorProductions = new List<Production>();
+      factorProductions.Add(new Production(Var));
+      if (includedRules.Contains(GrammarRule.Logarithm))
+        factorProductions.Add(new Production(LogFactor));
+      if (includedRules.Contains(GrammarRule.Exponentiation))
+        factorProductions.Add(new Production(ExpFactor));
+      if (includedRules.Contains(GrammarRule.Sine))
+        factorProductions.Add(new Production(SinFactor));
+      productions[Factor] = factorProductions.ToArray();
 
       productions[LogFactor] = new[] { new Production(SimpleExpr, Log) };
Index: /branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/GrammarEnumerationAlgorithm.cs
===================================================================
--- /branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/GrammarEnumerationAlgorithm.cs	(revision 15929)
+++ /branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/GrammarEnumerationAlgorithm.cs	(revision 15930)
@@ -35,4 +35,5 @@
     private readonly string MaxComplexityParameterName = "Max. Complexity";
     private readonly string GuiUpdateIntervalParameterName = "GUI Update Interval";
+    private readonly string GrammarSymbolsParameterName = "Grammar Symbols";
 
     public override bool SupportsPause { get { return false; } }
@@ -85,4 +86,12 @@
     public ICheckedItemCollection<IGrammarEnumerationAnalyzer> Analyzers {
       get { return AnalyzersParameter.Value; }
+    }
+
+    public IFixedValueParameter<ReadOnlyCheckedItemCollection<EnumValue<GrammarRule>>> GrammarSymbolsParameter {
+      get { return (IFixedValueParameter<ReadOnlyCheckedItemCollection<EnumValue<GrammarRule>>>)Parameters[GrammarSymbolsParameterName]; }
+    }
+
+    public ReadOnlyCheckedItemCollection<EnumValue<GrammarRule>> GrammarSymbols {
+      get { return GrammarSymbolsParameter.Value; }
     }
 
@@ -136,9 +145,19 @@
       Analyzers.SetItemCheckedState(Analyzers.First(analyzer => analyzer is RSquaredEvaluator), true);
       //Analyzers.SetItemCheckedState(Analyzers.First(analyzer => analyzer is SentenceLogger), true);
+
+      var grammarSymbols = Enum.GetValues(typeof(GrammarRule))
+        .Cast<GrammarRule>()
+        .Select(v => new EnumValue<GrammarRule>(v));
+
+      Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemCollection<EnumValue<GrammarRule>>>(
+        GrammarSymbolsParameterName,
+        new ReadOnlyCheckedItemCollection<EnumValue<GrammarRule>>(new CheckedItemCollection<EnumValue<GrammarRule>>(grammarSymbols))
+      ));
+      foreach (EnumValue<GrammarRule> grammarSymbol in GrammarSymbols) {
+        GrammarSymbols.SetItemCheckedState(grammarSymbol, true);
+      }
     }
 
     public GrammarEnumerationAlgorithm(GrammarEnumerationAlgorithm original, Cloner cloner) : base(original, cloner) {
-
-
     }
     #endregion
@@ -165,5 +184,5 @@
       PhraseExpansionCount = 0;
 
-      Grammar = new Grammar(Problem.ProblemData.AllowedInputVariables.ToArray());
+      Grammar = new Grammar(Problem.ProblemData.AllowedInputVariables.ToArray(), GrammarSymbols.CheckedItems.Select(v => v.Value));
 
       OpenPhrases = new SearchDataStore(SearchDataStructure); // Select search strategy
@@ -261,5 +280,5 @@
       SymbolString s = new SymbolString(Grammar.StartSymbol);
 
-      while (Grammar.GetComplexity(s) <= MaxComplexity) {
+      while (!s.IsSentence() && Grammar.GetComplexity(s) <= MaxComplexity) {
         int expandedSymbolIndex = s.NextNonterminalIndex();
         NonterminalSymbol expandedSymbol = (NonterminalSymbol)s[expandedSymbolIndex];
