Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 6803)
@@ -99,4 +99,5 @@
     <Reference Include="System.Drawing" />
     <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Forms.DataVisualization" />
     <Reference Include="System.Xml.Linq">
       <RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -109,4 +110,22 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="SymbolicExpressionGrammarAllowedChildSymbolsControl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarAllowedChildSymbolsControl.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarEditorView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarEditorView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarEditorView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarSampleExpressionTreeView.cs</DependentUpon>
+    </Compile>
     <Compile Include="SymbolicExpressionGrammarView.cs">
       <SubType>UserControl</SubType>
@@ -142,4 +161,5 @@
     </Compile>
     <Compile Include="VisualSymbolicExpressionTreeNode.cs" />
+    <Compile Include="VisualSymbolicExpressionTreeNodeConnection.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -148,4 +168,8 @@
       <Name>HeuristicLab.Collections-3.3</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
+      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
+      <Name>HeuristicLab.Common.Resources-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
@@ -160,4 +184,12 @@
       <Name>HeuristicLab.Core-3.3</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Data.Views\3.3\HeuristicLab.Data.Views-3.3.csproj">
+      <Project>{72104A0B-90E7-42F3-9ABE-9BBBADD4B943}</Project>
+      <Name>HeuristicLab.Data.Views-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
       <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
@@ -172,7 +204,27 @@
       <Name>HeuristicLab.MainForm-3.3</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
+      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
+      <Name>HeuristicLab.Operators-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj">
+      <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project>
+      <Name>HeuristicLab.Optimization.Views-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
+      <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
+      <Name>HeuristicLab.Random-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj">
+      <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project>
+      <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name>
     </ProjectReference>
   </ItemGroup>
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs.frame
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs.frame	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs.frame	(revision 6803)
@@ -30,4 +30,5 @@
   [PluginDependency("HeuristicLab.Collections", "3.3")]
   [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
   [PluginDependency("HeuristicLab.Core", "3.3")]
   [PluginDependency("HeuristicLab.Core.Views", "3.3")]
@@ -35,4 +36,5 @@
   [PluginDependency("HeuristicLab.MainForm", "3.3")]
   [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Random","3.3")]
   public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin : PluginBase {
   }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 6803)
@@ -47,4 +47,9 @@
       this.initialFrequencyLabel = new System.Windows.Forms.Label();
       this.initialFrequencyTextBox = new System.Windows.Forms.TextBox();
+      this.enabledCheckBox = new System.Windows.Forms.CheckBox();
+      this.minimumArityLabel = new System.Windows.Forms.Label();
+      this.maximumArityLabel = new System.Windows.Forms.Label();
+      this.minimumArityTextBox = new System.Windows.Forms.TextBox();
+      this.maximumArityTextBox = new System.Windows.Forms.TextBox();
       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
       this.SuspendLayout();
@@ -73,6 +78,6 @@
       // initialFrequencyTextBox
       // 
-      this.initialFrequencyTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.initialFrequencyTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
       this.initialFrequencyTextBox.Location = new System.Drawing.Point(93, 26);
@@ -84,14 +89,77 @@
       this.initialFrequencyTextBox.Validated += new System.EventHandler(this.initialFrequencyTextBox_Validated);
       // 
+      // enabledCheckBox
+      // 
+      this.enabledCheckBox.AutoSize = true;
+      this.enabledCheckBox.Location = new System.Drawing.Point(93, 104);
+      this.enabledCheckBox.Name = "enabledCheckBox";
+      this.enabledCheckBox.Size = new System.Drawing.Size(65, 17);
+      this.enabledCheckBox.TabIndex = 5;
+      this.enabledCheckBox.Text = "Enabled";
+      this.enabledCheckBox.UseVisualStyleBackColor = true;
+      this.enabledCheckBox.CheckedChanged += new System.EventHandler(this.checkBoxEnabled_CheckedChanged);
+      // 
+      // minimumArityLabel
+      // 
+      this.minimumArityLabel.AutoSize = true;
+      this.minimumArityLabel.Location = new System.Drawing.Point(3, 55);
+      this.minimumArityLabel.Name = "minimumArityLabel";
+      this.minimumArityLabel.Size = new System.Drawing.Size(74, 13);
+      this.minimumArityLabel.TabIndex = 8;
+      this.minimumArityLabel.Text = "Minimum Arity:";
+      this.toolTip.SetToolTip(this.minimumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // maximumArityLabel
+      // 
+      this.maximumArityLabel.AutoSize = true;
+      this.maximumArityLabel.Location = new System.Drawing.Point(3, 81);
+      this.maximumArityLabel.Name = "maximumArityLabel";
+      this.maximumArityLabel.Size = new System.Drawing.Size(74, 13);
+      this.maximumArityLabel.TabIndex = 6;
+      this.maximumArityLabel.Text = "Maximum Arity";
+      this.toolTip.SetToolTip(this.maximumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // minimumArityTextBox
+      // 
+      this.minimumArityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Location = new System.Drawing.Point(93, 52);
+      this.minimumArityTextBox.Name = "minimumArityTextBox";
+      this.minimumArityTextBox.ReadOnly = true;
+      this.minimumArityTextBox.Size = new System.Drawing.Size(227, 20);
+      this.minimumArityTextBox.TabIndex = 9;
+      // 
+      // maximumArityTextBox
+      // 
+      this.maximumArityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Location = new System.Drawing.Point(93, 78);
+      this.maximumArityTextBox.Name = "maximumArityTextBox";
+      this.maximumArityTextBox.ReadOnly = true;
+      this.maximumArityTextBox.Size = new System.Drawing.Size(227, 20);
+      this.maximumArityTextBox.TabIndex = 7;
+      // 
       // SymbolView
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.minimumArityTextBox);
+      this.Controls.Add(this.minimumArityLabel);
+      this.Controls.Add(this.maximumArityTextBox);
+      this.Controls.Add(this.maximumArityLabel);
       this.Controls.Add(this.initialFrequencyTextBox);
       this.Controls.Add(this.initialFrequencyLabel);
+      this.Controls.Add(this.enabledCheckBox);
       this.Name = "SymbolView";
-      this.Size = new System.Drawing.Size(320, 51);
+      this.Size = new System.Drawing.Size(320, 123);
+      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
       this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
       this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
       this.Controls.SetChildIndex(this.infoLabel, 0);
       this.Controls.SetChildIndex(this.nameLabel, 0);
@@ -107,4 +175,9 @@
     protected System.Windows.Forms.Label initialFrequencyLabel;
     protected System.Windows.Forms.TextBox initialFrequencyTextBox;
+    private System.Windows.Forms.CheckBox enabledCheckBox;
+    protected System.Windows.Forms.Label minimumArityLabel;
+    protected System.Windows.Forms.Label maximumArityLabel;
+    protected System.Windows.Forms.TextBox minimumArityTextBox;
+    protected System.Windows.Forms.TextBox maximumArityTextBox;
 
   }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 6803)
@@ -57,6 +57,7 @@
     protected override void SetEnabledStateOfControls() {
       base.SetEnabledStateOfControls();
-      initialFrequencyTextBox.Enabled = Content != null;
+      initialFrequencyTextBox.Enabled = Content != null || Locked;
       initialFrequencyTextBox.ReadOnly = ReadOnly;
+      enabledCheckBox.Enabled = Content != null || Locked || ReadOnly;
     }
 
@@ -93,4 +94,9 @@
       }
     }
+
+    private void checkBoxEnabled_CheckedChanged(object sender, EventArgs e) {
+      if (Content != null)
+        Content.Enabled = enabledCheckBox.Checked;
+    }
     #endregion
 
@@ -99,10 +105,17 @@
       if (Content == null) {
         initialFrequencyTextBox.Text = string.Empty;
+        minimumArityTextBox.Text = string.Empty;
+        maximumArityTextBox.Text = string.Empty;
+        enabledCheckBox.Checked = false;
       } else {
         initialFrequencyTextBox.Text = Content.InitialFrequency.ToString();
+        minimumArityTextBox.Text = Content.MinimumArity.ToString();
+        maximumArityTextBox.Text = Content.MaximumArity.ToString();
+        enabledCheckBox.Checked = Content.Enabled;
       }
       SetEnabledStateOfControls();
     }
     #endregion
+
   }
 }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs	(revision 6803)
@@ -0,0 +1,102 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionGrammarAllowedChildSymbolsControl {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.allowedChildSymbolsGroupBox = new System.Windows.Forms.GroupBox();
+      this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
+      this.allowedChildSymbolsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // allowedChildSymbolsGroupBox
+      // 
+      this.allowedChildSymbolsGroupBox.Controls.Add(this.symbolicExpressionTreeChart);
+      this.allowedChildSymbolsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.allowedChildSymbolsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.allowedChildSymbolsGroupBox.Name = "allowedChildSymbolsGroupBox";
+      this.allowedChildSymbolsGroupBox.Size = new System.Drawing.Size(651, 405);
+      this.allowedChildSymbolsGroupBox.TabIndex = 2;
+      this.allowedChildSymbolsGroupBox.TabStop = false;
+      this.allowedChildSymbolsGroupBox.Text = "Allowed Child Symbols";
+      // 
+      // allowedChildSymbolsControl
+      // 
+      this.symbolicExpressionTreeChart.AllowDrop = true;
+      this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
+      this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;
+      this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(3, 16);
+      this.symbolicExpressionTreeChart.Name = "allowedChildSymbolsControl";
+      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(645, 386);
+      this.symbolicExpressionTreeChart.Spacing = 5;
+      this.symbolicExpressionTreeChart.SuspendRepaint = false;
+      this.symbolicExpressionTreeChart.TabIndex = 0;
+      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
+      this.symbolicExpressionTreeChart.Tree = null;
+      this.symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += new System.Windows.Forms.MouseEventHandler(this.symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked);
+      this.symbolicExpressionTreeChart.DragDrop += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragDrop);
+      this.symbolicExpressionTreeChart.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragEnter);
+      this.symbolicExpressionTreeChart.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragOver);
+      this.symbolicExpressionTreeChart.Paint += new System.Windows.Forms.PaintEventHandler(this.allowedChildSymbolsControl_Paint);
+      this.symbolicExpressionTreeChart.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolicExpressionTreeChart_KeyDown);
+      this.symbolicExpressionTreeChart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.allowedChildSymbolsControl_MouseDown);
+      // 
+      // SymbolicExpressionGrammarAllowedChildSymbolsControl
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.allowedChildSymbolsGroupBox);
+      this.Name = "SymbolicExpressionGrammarAllowedChildSymbolsControl";
+      this.Size = new System.Drawing.Size(651, 405);
+      this.allowedChildSymbolsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox allowedChildSymbolsGroupBox;
+    private SymbolicExpressionTreeChart symbolicExpressionTreeChart;
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs	(revision 6803)
@@ -0,0 +1,325 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public sealed partial class SymbolicExpressionGrammarAllowedChildSymbolsControl : UserControl {
+    private ObservableList<ISymbolicExpressionTreeNode> selectedSymbolicExpressionTreeNodes;
+
+    public SymbolicExpressionGrammarAllowedChildSymbolsControl() {
+      InitializeComponent();
+      selectedSymbolicExpressionTreeNodes = new ObservableList<ISymbolicExpressionTreeNode>();
+    }
+
+    private ISymbolicExpressionGrammar grammar;
+    public ISymbolicExpressionGrammar Grammar {
+      get { return grammar; }
+      set {
+        if (grammar != value) {
+          if (grammar != null) DeregisterGrammarEvents();
+          grammar = value;
+          if (grammar != null) RegisterGrammarEvents();
+          OnGrammarChanged();
+        }
+      }
+    }
+
+    private ISymbol symbol;
+    public ISymbol Symbol {
+      get { return symbol; }
+      set {
+        if (symbol != value) {
+          if (value != null && grammar == null) throw new InvalidOperationException("grammar is null");
+          if (value != null && !grammar.ContainsSymbol(value)) throw new ArgumentException("grammar does not contain symbol.");
+          symbol = value;
+          OnSymbolChanged();
+        }
+      }
+    }
+
+    private void RegisterGrammarEvents() {
+      grammar.Changed += new EventHandler(Grammar_Changed);
+    }
+    private void DeregisterGrammarEvents() {
+      grammar.Changed -= new EventHandler(Grammar_Changed);
+    }
+
+    private void Grammar_Changed(object sender, EventArgs e) {
+      if (Grammar == null) return;
+      if (Symbol == null) return;
+      if (Symbol != null && !Grammar.ContainsSymbol(Symbol)) Symbol = null;
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void OnGrammarChanged() {
+      if (Grammar == null) {
+        symbolicExpressionTreeChart.Tree = null;
+        Symbol = null;
+      }
+    }
+    private void OnSymbolChanged() {
+      if (Symbol == null) symbolicExpressionTreeChart.Tree = null;
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void BuildAllowedChildSymbolsTree() {
+      var tree = new SymbolicExpressionTree(new SymbolicExpressionTreeNode(Symbol));
+
+      symbolicExpressionTreeChart.SuspendRepaint = true;
+      if (Grammar.GetMaximumSubtreeCount(Symbol) > 0) {
+        for (int i = 0; i < Grammar.GetMaximumSubtreeCount(Symbol); i++) {
+          var node = new DummySymbol("Subtree " + i).CreateTreeNode();
+          foreach (var childSymbol in Grammar.GetAllowedChildSymbols(Symbol, i)) {
+            node.AddSubtree(new SymbolicExpressionTreeNode(childSymbol));
+          }
+          tree.Root.AddSubtree(node);
+        }
+      }
+      symbolicExpressionTreeChart.Tree = tree;
+
+      foreach (var subtreeNode in tree.Root.Subtrees) {
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          var visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
+        }
+      }
+
+      for (int i = Grammar.GetMinimumSubtreeCount(symbol); i < Grammar.GetMaximumSubtreeCount(symbol); i++) {
+        var subtreeNode = tree.Root.GetSubtree(i);
+        var visualTreeNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(subtreeNode);
+        visualTreeNode.TextColor = Color.Gray;
+        visualTreeNode.LineColor = Color.LightGray;
+
+        var visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(tree.Root, subtreeNode);
+        visualLine.LineColor = Color.LightGray;
+
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          visualTreeNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(allowedChildNode);
+          visualTreeNode.TextColor = Color.Gray;
+          visualTreeNode.LineColor = Color.LightGray;
+
+          visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.LineColor = Color.LightGray;
+        }
+      }
+
+      symbolicExpressionTreeChart.SuspendRepaint = false;
+      UpdateSelectedSymbolicExpressionTreeNodes();
+    }
+
+    private void UpdateSelectedSymbolicExpressionTreeNodes() {
+      foreach (var node in symbolicExpressionTreeChart.Tree.IterateNodesPrefix()) {
+        var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
+        if (!selectedSymbolicExpressionTreeNodes.Contains(node)) visualNode.FillColor = Color.White;
+        else visualNode.FillColor = Color.LightSteelBlue;
+      }
+      symbolicExpressionTreeChart.Repaint();
+    }
+
+    private void symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
+      if ((Control.ModifierKeys & Keys.Control) == 0)
+        selectedSymbolicExpressionTreeNodes.Clear();
+
+      VisualSymbolicExpressionTreeNode clickedNode = (VisualSymbolicExpressionTreeNode)sender;
+      var selectedNode = clickedNode.SymbolicExpressionTreeNode;
+      if (selectedNode.SubtreeCount == 0) {
+        if (!selectedSymbolicExpressionTreeNodes.Contains(selectedNode))
+          selectedSymbolicExpressionTreeNodes.Add(selectedNode);
+        else
+          selectedSymbolicExpressionTreeNodes.Remove(selectedNode);
+      }
+
+      UpdateSelectedSymbolicExpressionTreeNodes();
+    }
+
+    private void symbolicExpressionTreeChart_KeyDown(object sender, KeyEventArgs e) {
+      if (e.KeyCode == Keys.Delete) {
+        var root = symbolicExpressionTreeChart.Tree.Root;
+        Grammar.StartGrammarManipulation();
+        foreach (var node in selectedSymbolicExpressionTreeNodes) {
+          int argIndex = root.IndexOfSubtree(node.Parent);
+          Grammar.RemoveAllowedChildSymbol(root.Symbol, node.Symbol, argIndex);
+        }
+
+        selectedSymbolicExpressionTreeNodes.Clear();
+        Grammar.FinishedGrammarManipulation();
+      }
+    }
+
+    #region drag & drop operations
+    private bool validDragOperation;
+    private void symbolicExpressionTreeChart_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      var symbols = data as IEnumerable<ISymbol>;
+      if (symbol != null && !(symbol is IReadOnlySymbol) && Grammar.ContainsSymbol(symbol)) validDragOperation = true;
+      else if (symbols != null && symbols.All(s => !(symbol is IReadOnlySymbol) && Grammar.ContainsSymbol(s))) validDragOperation = true;
+    }
+
+    private void symbolicExpressionTreeChart_DragOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (validDragOperation) {
+        Point coordinates = symbolicExpressionTreeChart.PointToClient(new Point(e.X, e.Y));
+        var visualNode = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y);
+        if (visualNode != null) {
+          var node = visualNode.SymbolicExpressionTreeNode;
+          var root = symbolicExpressionTreeChart.Tree.Root;
+          if (root.Symbol is ProgramRootSymbol) return;
+          if (node == root || node.Parent == root) e.Effect = DragDropEffects.Copy;
+        }
+      }
+    }
+
+    private void symbolicExpressionTreeChart_DragDrop(object sender, DragEventArgs e) {
+      Point coordinates = symbolicExpressionTreeChart.PointToClient(new Point(e.X, e.Y));
+      var node = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y);
+      var root = symbolicExpressionTreeChart.Tree.Root;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      var symbols = data as IEnumerable<ISymbol>;
+
+      if (node.SymbolicExpressionTreeNode == root) {
+        if (symbol != null)
+          Grammar.AddAllowedChildSymbol(root.Symbol, symbol);
+        else if (symbols != null)
+          foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s);
+      } else {
+        int argumentIndex = root.IndexOfSubtree(node.SymbolicExpressionTreeNode);
+        if (symbol != null)
+          Grammar.AddAllowedChildSymbol(root.Symbol, symbol, argumentIndex);
+        else if (symbols != null)
+          foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s, argumentIndex);
+      }
+      BuildAllowedChildSymbolsTree();
+    }
+    #endregion
+
+    #region draw and handle root node with buttons to manipulate the subtree count
+    private RectangleF increaseMinimumSubtreeCountRectangle;
+    private RectangleF decreaseMinimumSubtreeCountRectangle;
+    private RectangleF increaseMaximumSubtreeCountRectangle;
+    private RectangleF decreaseMaximumSubtreeCountRectangle;
+    private void allowedChildSymbolsControl_Paint(object sender, PaintEventArgs e) {
+      increaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+      decreaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+      increaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+      decreaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+
+      if (Grammar == null) return;
+      if (symbolicExpressionTreeChart.Tree == null) return;
+
+      var rootNode = symbolicExpressionTreeChart.Tree.Root;
+      var visualRootNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(rootNode);
+      var graphics = e.Graphics;
+
+      if (rootNode.Symbol is IReadOnlySymbol) return;
+      if (rootNode.Symbol.MinimumArity == rootNode.Symbol.MaximumArity) return;
+
+      using (Pen pen = new Pen(Color.Black)) {
+        using (Font font = new Font("Times New Roman", 8)) {
+          var stringFormat = new StringFormat();
+          stringFormat.Alignment = StringAlignment.Center;
+          stringFormat.LineAlignment = StringAlignment.Center;
+          int spacing = 5;
+          int size = (visualRootNode.Height - spacing * 3) / 2;
+
+          increaseMinimumSubtreeCountRectangle = new RectangleF(visualRootNode.X - spacing - size, visualRootNode.Y + spacing, size, size);
+          decreaseMinimumSubtreeCountRectangle = new RectangleF(visualRootNode.X - spacing - size, visualRootNode.Y + size + 2 * spacing, size, size);
+          increaseMaximumSubtreeCountRectangle = new RectangleF(visualRootNode.X + visualRootNode.Width + spacing, visualRootNode.Y + spacing, size, size);
+          decreaseMaximumSubtreeCountRectangle = new RectangleF(visualRootNode.X + visualRootNode.Width + spacing, visualRootNode.Y + size + 2 * spacing, size, size);
+
+          pen.Color = Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == Grammar.GetMinimumSubtreeCount(rootNode.Symbol) ? Color.LightGray : Color.Black;
+          graphics.DrawString("+", font, pen.Brush, increaseMinimumSubtreeCountRectangle, stringFormat);
+          graphics.DrawRectangle(pen, Rectangle.Round(increaseMinimumSubtreeCountRectangle));
+          if (pen.Color == Color.LightGray) increaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Grammar.GetMinimumSubtreeCount(rootNode.Symbol) == rootNode.Symbol.MinimumArity ? Color.LightGray : Color.Black;
+          graphics.DrawString("-", font, pen.Brush, decreaseMinimumSubtreeCountRectangle, stringFormat);
+          graphics.DrawRectangle(pen, Rectangle.Round(decreaseMinimumSubtreeCountRectangle));
+          if (pen.Color == Color.LightGray) decreaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == rootNode.Symbol.MaximumArity ? Color.LightGray : Color.Black;
+          graphics.DrawRectangle(pen, Rectangle.Round(increaseMaximumSubtreeCountRectangle));
+          graphics.DrawString("+", font, pen.Brush, increaseMaximumSubtreeCountRectangle, stringFormat);
+          if (pen.Color == Color.LightGray) increaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == Grammar.GetMinimumSubtreeCount(rootNode.Symbol) ? Color.LightGray : Color.Black;
+          graphics.DrawRectangle(pen, Rectangle.Round(decreaseMaximumSubtreeCountRectangle));
+          graphics.DrawString("-", font, pen.Brush, decreaseMaximumSubtreeCountRectangle, stringFormat);
+          if (pen.Color == Color.LightGray) decreaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+        }
+      }
+    }
+
+    private void allowedChildSymbolsControl_MouseDown(object sender, MouseEventArgs e) {
+      if (Grammar == null) return;
+      if (symbolicExpressionTreeChart.Tree == null) return;
+
+      var pointF = new PointF(e.X, e.Y);
+      var rootSymbol = symbolicExpressionTreeChart.Tree.Root.Symbol;
+      int minimumSubtreeCount = Grammar.GetMinimumSubtreeCount(rootSymbol);
+      int maximumSubtreecount = Grammar.GetMaximumSubtreeCount(rootSymbol);
+
+      bool changed = true;
+      if (increaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount + 1, maximumSubtreecount);
+      else if (decreaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount - 1, maximumSubtreecount);
+      else if (increaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount + 1);
+      else if (decreaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount - 1);
+      else
+        changed = false;
+
+      if (changed) BuildAllowedChildSymbolsTree();
+    }
+    #endregion
+
+  }
+
+  [NonDiscoverableType]
+  internal class DummySymbol : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    public DummySymbol(DummySymbol original, Cloner cloner) : base(original, cloner) { }
+    public DummySymbol(string name) : base(name, "DummySymbol for views") { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new DummySymbol(this, cloner); }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 6803)
@@ -0,0 +1,286 @@
+﻿namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionGrammarEditorView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SymbolicExpressionGrammarEditorView));
+      this.grpSymbols = new System.Windows.Forms.GroupBox();
+      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+      this.copyButton = new System.Windows.Forms.Button();
+      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
+      this.removeButton = new System.Windows.Forms.Button();
+      this.addButton = new System.Windows.Forms.Button();
+      this.symbolsTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.CheckBoxTreeView();
+      this.imageList = new System.Windows.Forms.ImageList(this.components);
+      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+      this.allowedChildSymbolsControl = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionGrammarAllowedChildSymbolsControl();
+      this.symbolDetailsGroupBox = new System.Windows.Forms.GroupBox();
+      this.symbolDetailsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.showSampleTreeButton = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.grpSymbols.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+      this.splitContainer1.Panel1.SuspendLayout();
+      this.splitContainer1.Panel2.SuspendLayout();
+      this.splitContainer1.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
+      this.splitContainer2.Panel1.SuspendLayout();
+      this.splitContainer2.Panel2.SuspendLayout();
+      this.splitContainer2.SuspendLayout();
+      this.symbolDetailsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(686, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(750, 3);
+      // 
+      // grpSymbols
+      // 
+      this.grpSymbols.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.grpSymbols.Controls.Add(this.splitContainer1);
+      this.grpSymbols.Location = new System.Drawing.Point(0, 26);
+      this.grpSymbols.Name = "grpSymbols";
+      this.grpSymbols.Size = new System.Drawing.Size(769, 378);
+      this.grpSymbols.TabIndex = 3;
+      this.grpSymbols.TabStop = false;
+      this.grpSymbols.Text = "Symbols";
+      // 
+      // splitContainer1
+      // 
+      this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer1.Location = new System.Drawing.Point(3, 16);
+      this.splitContainer1.Name = "splitContainer1";
+      // 
+      // splitContainer1.Panel1
+      // 
+      this.splitContainer1.Panel1.Controls.Add(this.showSampleTreeButton);
+      this.splitContainer1.Panel1.Controls.Add(this.copyButton);
+      this.splitContainer1.Panel1.Controls.Add(this.showDetailsCheckBox);
+      this.splitContainer1.Panel1.Controls.Add(this.removeButton);
+      this.splitContainer1.Panel1.Controls.Add(this.addButton);
+      this.splitContainer1.Panel1.Controls.Add(this.symbolsTreeView);
+      // 
+      // splitContainer1.Panel2
+      // 
+      this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
+      this.splitContainer1.Size = new System.Drawing.Size(763, 359);
+      this.splitContainer1.SplitterDistance = 191;
+      this.splitContainer1.TabIndex = 0;
+      // 
+      // copyButton
+      // 
+      this.copyButton.Enabled = false;
+      this.copyButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Copy;
+      this.copyButton.Location = new System.Drawing.Point(33, 3);
+      this.copyButton.Name = "copyButton";
+      this.copyButton.Size = new System.Drawing.Size(24, 24);
+      this.copyButton.TabIndex = 8;
+      this.toolTip.SetToolTip(this.copyButton, "Copy Symbol");
+      this.copyButton.UseVisualStyleBackColor = true;
+      this.copyButton.Click += new System.EventHandler(this.copyButton_Click);
+      // 
+      // showDetailsCheckBox
+      // 
+      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
+      this.showDetailsCheckBox.Checked = true;
+      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
+      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties;
+      this.showDetailsCheckBox.Location = new System.Drawing.Point(93, 3);
+      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
+      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
+      this.showDetailsCheckBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
+      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
+      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
+      // 
+      // removeButton
+      // 
+      this.removeButton.Enabled = false;
+      this.removeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Remove;
+      this.removeButton.Location = new System.Drawing.Point(63, 3);
+      this.removeButton.Name = "removeButton";
+      this.removeButton.Size = new System.Drawing.Size(24, 24);
+      this.removeButton.TabIndex = 6;
+      this.toolTip.SetToolTip(this.removeButton, "Remove Symbol");
+      this.removeButton.UseVisualStyleBackColor = true;
+      this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
+      // 
+      // addButton
+      // 
+      this.addButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Add;
+      this.addButton.Location = new System.Drawing.Point(3, 3);
+      this.addButton.Name = "addButton";
+      this.addButton.Size = new System.Drawing.Size(24, 24);
+      this.addButton.TabIndex = 5;
+      this.toolTip.SetToolTip(this.addButton, "Add Symbol");
+      this.addButton.UseVisualStyleBackColor = true;
+      this.addButton.Click += new System.EventHandler(this.addButton_Click);
+      // 
+      // symbolsTreeView
+      // 
+      this.symbolsTreeView.AllowDrop = true;
+      this.symbolsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.symbolsTreeView.CheckBoxes = true;
+      this.symbolsTreeView.HideSelection = false;
+      this.symbolsTreeView.ImageIndex = 0;
+      this.symbolsTreeView.ImageList = this.imageList;
+      this.symbolsTreeView.Location = new System.Drawing.Point(3, 28);
+      this.symbolsTreeView.Name = "symbolsTreeView";
+      this.symbolsTreeView.SelectedImageIndex = 0;
+      this.symbolsTreeView.Size = new System.Drawing.Size(185, 299);
+      this.symbolsTreeView.TabIndex = 0;
+      this.symbolsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterCheck);
+      this.symbolsTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.symbolsTreeView_ItemDrag);
+      this.symbolsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterSelect);
+      this.symbolsTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragDrop);
+      this.symbolsTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragEnter);
+      this.symbolsTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragOver);
+      this.symbolsTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolsTreeView_KeyDown);
+      this.symbolsTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.symbolsTreeView_MouseDown);
+      // 
+      // imageList
+      // 
+      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+      // 
+      // splitContainer2
+      // 
+      this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+      this.splitContainer2.Name = "splitContainer2";
+      this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+      // 
+      // splitContainer2.Panel1
+      // 
+      this.splitContainer2.Panel1.Controls.Add(this.allowedChildSymbolsControl);
+      // 
+      // splitContainer2.Panel2
+      // 
+      this.splitContainer2.Panel2.Controls.Add(this.symbolDetailsGroupBox);
+      this.splitContainer2.Size = new System.Drawing.Size(568, 359);
+      this.splitContainer2.SplitterDistance = 165;
+      this.splitContainer2.TabIndex = 0;
+      // 
+      // allowedChildSymbolsControl
+      // 
+      this.allowedChildSymbolsControl.AllowDrop = true;
+      this.allowedChildSymbolsControl.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.allowedChildSymbolsControl.Grammar = null;
+      this.allowedChildSymbolsControl.Location = new System.Drawing.Point(0, 0);
+      this.allowedChildSymbolsControl.Name = "allowedChildSymbolsControl";
+      this.allowedChildSymbolsControl.Size = new System.Drawing.Size(568, 165);
+      this.allowedChildSymbolsControl.Symbol = null;
+      this.allowedChildSymbolsControl.TabIndex = 0;
+      // 
+      // symbolDetailsGroupBox
+      // 
+      this.symbolDetailsGroupBox.Controls.Add(this.symbolDetailsViewHost);
+      this.symbolDetailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolDetailsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.symbolDetailsGroupBox.Name = "symbolDetailsGroupBox";
+      this.symbolDetailsGroupBox.Size = new System.Drawing.Size(568, 190);
+      this.symbolDetailsGroupBox.TabIndex = 1;
+      this.symbolDetailsGroupBox.TabStop = false;
+      this.symbolDetailsGroupBox.Text = "Symbol Details";
+      // 
+      // symbolDetailsViewHost
+      // 
+      this.symbolDetailsViewHost.Caption = "View";
+      this.symbolDetailsViewHost.Content = null;
+      this.symbolDetailsViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolDetailsViewHost.Enabled = false;
+      this.symbolDetailsViewHost.Location = new System.Drawing.Point(3, 16);
+      this.symbolDetailsViewHost.Name = "symbolDetailsViewHost";
+      this.symbolDetailsViewHost.ReadOnly = false;
+      this.symbolDetailsViewHost.Size = new System.Drawing.Size(562, 171);
+      this.symbolDetailsViewHost.TabIndex = 1;
+      this.symbolDetailsViewHost.ViewsLabelVisible = true;
+      this.symbolDetailsViewHost.ViewType = null;
+      // 
+      // showSampleTreeButton
+      // 
+      this.showSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.showSampleTreeButton.Location = new System.Drawing.Point(3, 333);
+      this.showSampleTreeButton.Name = "showSampleTreeButton";
+      this.showSampleTreeButton.Size = new System.Drawing.Size(185, 23);
+      this.showSampleTreeButton.TabIndex = 9;
+      this.showSampleTreeButton.Text = "Show Sample Tree";
+      this.showSampleTreeButton.UseVisualStyleBackColor = true;
+      this.showSampleTreeButton.Click += new System.EventHandler(this.showSampleTreeButton_Click);
+      // 
+      // SymbolicExpressionGrammarEditorView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.grpSymbols);
+      this.Name = "SymbolicExpressionGrammarEditorView";
+      this.Size = new System.Drawing.Size(769, 404);
+      this.Controls.SetChildIndex(this.grpSymbols, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.grpSymbols.ResumeLayout(false);
+      this.splitContainer1.Panel1.ResumeLayout(false);
+      this.splitContainer1.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+      this.splitContainer1.ResumeLayout(false);
+      this.splitContainer2.Panel1.ResumeLayout(false);
+      this.splitContainer2.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
+      this.splitContainer2.ResumeLayout(false);
+      this.symbolDetailsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+    #endregion
+
+    private System.Windows.Forms.GroupBox grpSymbols;
+    private System.Windows.Forms.SplitContainer splitContainer1;
+    private CheckBoxTreeView symbolsTreeView;
+    private System.Windows.Forms.SplitContainer splitContainer2;
+    private System.Windows.Forms.ImageList imageList;
+    protected System.Windows.Forms.CheckBox showDetailsCheckBox;
+    protected System.Windows.Forms.Button removeButton;
+    protected System.Windows.Forms.Button addButton;
+    private System.Windows.Forms.GroupBox symbolDetailsGroupBox;
+    private MainForm.WindowsForms.ViewHost symbolDetailsViewHost;
+    protected System.Windows.Forms.Button copyButton;
+    private SymbolicExpressionGrammarAllowedChildSymbolsControl allowedChildSymbolsControl;
+    private System.Windows.Forms.Button showSampleTreeButton;
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 6803)
@@ -0,0 +1,409 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar Editor")]
+  [Content(typeof(ISymbolicExpressionGrammar), true)]
+  public partial class SymbolicExpressionGrammarEditorView : NamedItemView {
+    public SymbolicExpressionGrammarEditorView() {
+      InitializeComponent();
+    }
+
+    public override bool ReadOnly {
+      get {
+        if ((Content != null) && Content.ReadOnly) return true;
+        return base.ReadOnly;
+      }
+      set {
+        if ((Content != null) && Content.ReadOnly) base.ReadOnly = true;
+        else base.ReadOnly = value;
+      }
+    }
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      addButton.Enabled = Content != null && !Content.ReadOnly;
+      removeButton.Enabled = Content != null && !Content.ReadOnly && symbolsTreeView.SelectedNode != null && !(symbolsTreeView.SelectedNode.Tag is IReadOnlySymbol);
+      copyButton.Enabled = Content != null && !Content.ReadOnly && symbolsTreeView.SelectedNode != null && !(symbolsTreeView.SelectedNode.Tag is IReadOnlySymbol);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        symbolsTreeView.Nodes.Clear();
+        UpdateSymbolsTreeView();
+
+        symbolsTreeView.CollapseAll();
+        foreach (var node in IterateTreeNodes())
+          if (node.Checked) node.Expand();
+
+        allowedChildSymbolsControl.Grammar = Content;
+        allowedChildSymbolsControl.Symbol = null;
+        symbolDetailsViewHost.Content = null;
+      } else {
+        symbolsTreeView.Nodes.Clear();
+        allowedChildSymbolsControl.Grammar = null;
+        symbolDetailsViewHost.Content = null;
+      }
+    }
+
+    #region events
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ReadOnlyChanged += new System.EventHandler(Content_ReadOnlyChanged);
+      Content.Changed += new System.EventHandler(Content_Changed);
+    }
+    protected override void DeregisterContentEvents() {
+      Content.ReadOnlyChanged -= new System.EventHandler(Content_ReadOnlyChanged);
+      Content.Changed -= new System.EventHandler(Content_Changed);
+      base.DeregisterContentEvents();
+    }
+
+    private void Content_ReadOnlyChanged(object sender, EventArgs e) {
+      ReadOnly = Content.ReadOnly;
+    }
+
+    private void Content_Changed(object sender, EventArgs e) {
+      ISymbol symbol = null;
+      if (symbolsTreeView.SelectedNode != null)
+        symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+
+      allowedChildSymbolsControl.Grammar = Content;
+
+      UpdateSymbolsTreeView();
+      if (symbol != null && Content.ContainsSymbol(symbol)) {
+        symbolsTreeView.SelectedNode = IterateTreeNodes().Where(n => n.Tag == symbol).ToList().FirstOrDefault();
+        UpdateSymbolDetailsViews();
+      }
+    }
+    #endregion
+
+    private void UpdateSymbolsTreeView() {
+      var symbols = Content.Symbols.ToList();
+      foreach (var treeNode in IterateTreeNodes().ToList()) {
+        var symbol = treeNode.Tag as ISymbol;
+        if (!symbols.Contains(symbol))
+          treeNode.Remove();
+      }
+
+      var groupSymbols = symbols.OfType<GroupSymbol>().ToList();
+      var topLevelSymbols = Content.Symbols.Where(s => !groupSymbols.Any(g => g.Symbols.Contains(s)));
+      UpdateChildTreeNodes(symbolsTreeView.Nodes, topLevelSymbols);
+
+      RebuildImageList();
+    }
+
+    private void UpdateChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) {
+      foreach (ISymbol symbol in symbols) {
+        TreeNode node = collection.Cast<TreeNode>().Where(n => n.Tag == symbol).FirstOrDefault();
+        if (node == null) {
+          node = new TreeNode();
+          node.Tag = symbol;
+          collection.Add(node);
+        }
+        node.Checked = symbol.Enabled;
+        node.Text = symbol.Name;
+
+        var groupSymbol = symbol as GroupSymbol;
+        if (groupSymbol != null) UpdateChildTreeNodes(node.Nodes, groupSymbol.Symbols);
+      }
+    }
+
+    private void symbolsTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
+      if (e.Action != TreeViewAction.Unknown) UpdateSymbolDetailsViews();
+
+      removeButton.Enabled = symbolsTreeView.SelectedNode != null && !(symbolsTreeView.SelectedNode.Tag is IReadOnlySymbol);
+      copyButton.Enabled = symbolsTreeView.SelectedNode != null && !(symbolsTreeView.SelectedNode.Tag is IReadOnlySymbol);
+    }
+
+    private void symbolsTreeView_AfterCheck(object sender, TreeViewEventArgs e) {
+      if (e.Action != TreeViewAction.Unknown) {
+        Content.StartGrammarManipulation();
+        allowedChildSymbolsControl.Symbol = null;
+        var symbol = (ISymbol)e.Node.Tag;
+        symbol.Enabled = e.Node.Checked;
+        foreach (var node in IterateTreeNodes())
+          node.Checked = ((ISymbol)node.Tag).Enabled;
+
+        Content.FinishedGrammarManipulation();
+      }
+    }
+
+    #region drag & drop operations
+    private GroupSymbol parentOfDraggedSymbol;
+    private void symbolsTreeView_ItemDrag(object sender, ItemDragEventArgs e) {
+      if (!Locked) {
+        var treeNode = e.Item as TreeNode;
+        if (treeNode.Parent != null) parentOfDraggedSymbol = treeNode.Parent.Tag as GroupSymbol;
+        var data = new DataObject();
+        data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, treeNode.Tag);
+        validDragOperation = true;
+        DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Move);
+      }
+    }
+
+
+    private bool validDragOperation;
+    private void symbolsTreeView_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (Content == null) return;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) validDragOperation = true;
+    }
+    private void symbolsTreeView_DragOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (validDragOperation) {
+        GroupSymbol groupSymbol = null;
+        Point mouse = symbolsTreeView.PointToClient(new Point(e.X, e.Y));
+        TreeNode node = symbolsTreeView.GetNodeAt(mouse);
+        if (node == null) return;
+        groupSymbol = node.Tag as GroupSymbol;
+        if (groupSymbol == null) return;
+        var symbol = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+        if (symbol == groupSymbol) return;
+
+        if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
+      }
+    }
+    private void symbolsTreeView_DragDrop(object sender, DragEventArgs e) {
+      var symbol = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ISymbol;
+
+      GroupSymbol groupSymbol = null;
+      Point mouse = symbolsTreeView.PointToClient(new Point(e.X, e.Y));
+      TreeNode node = symbolsTreeView.GetNodeAt(mouse);
+      if (node != null) groupSymbol = node.Tag as GroupSymbol;
+      if (node != null && groupSymbol == null) groupSymbol = node.Parent.Tag as GroupSymbol;
+
+      Content.StartGrammarManipulation();
+      Cloner cloner = new Cloner();
+      var clonedSymbol = cloner.Clone(symbol);
+      ChangeDuplicateSymbolNames(clonedSymbol);
+
+      if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(clonedSymbol);
+      else Content.AddSymbol(clonedSymbol);
+
+      UpdateGrammerConstraintsForClonedSymbol(symbol, cloner);
+      Content.FinishedGrammarManipulation();
+    }
+    #endregion
+
+    private void symbolsTreeView_MouseDown(object sender, MouseEventArgs e) {
+      // enables deselection of treeNodes
+      Point coordinates = new Point(e.X, e.Y);
+      TreeNode node = symbolsTreeView.GetNodeAt(coordinates);
+      if (e.Button == System.Windows.Forms.MouseButtons.Left && node == null) {
+        symbolsTreeView.SelectedNode = null;
+        symbolDetailsViewHost.Content = null;
+        SetEnabledStateOfControls();
+      }
+    }
+
+    private void symbolsTreeView_KeyDown(object sender, KeyEventArgs e) {
+      if (ReadOnly) return;
+      if (symbolsTreeView.SelectedNode == null) return;
+      if (e.KeyCode != Keys.Delete) return;
+
+      var symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+      if (!(symbol is IReadOnlySymbol))
+        Content.RemoveSymbol(symbol);
+
+      SetEnabledStateOfControls();
+      UpdateSymbolDetailsViews();
+      RebuildImageList();
+    }
+
+    #region button events
+    private TypeSelectorDialog typeSelectorDialog;
+    private void addButton_Click(object sender, EventArgs e) {
+      if (typeSelectorDialog == null) {
+        typeSelectorDialog = new TypeSelectorDialog();
+        typeSelectorDialog.Caption = "Select Symbol";
+        typeSelectorDialog.TypeSelector.Caption = "Available Symbols";
+        typeSelectorDialog.TypeSelector.Configure(typeof(ISymbol), false, false, (t) => { return !typeof(IReadOnlySymbol).IsAssignableFrom(t); });
+      }
+      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
+        try {
+          ISymbol symbol = (ISymbol)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
+          ChangeDuplicateSymbolNames(symbol);
+          GroupSymbol groupSymbol = null;
+
+          TreeNode selectedNode = symbolsTreeView.SelectedNode;
+          if (selectedNode != null) {
+            groupSymbol = selectedNode.Tag as GroupSymbol;
+            if (groupSymbol == null && selectedNode.Parent != null) groupSymbol = selectedNode.Parent.Tag as GroupSymbol;
+          }
+          if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(symbol);
+          else Content.AddSymbol(symbol);
+        }
+        catch (Exception ex) {
+          ErrorHandling.ShowErrorDialog(this, ex);
+        }
+      }
+    }
+
+    private void copyButton_Click(object sender, EventArgs e) {
+      var symbol = symbolsTreeView.SelectedNode.Tag as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) {
+
+        Content.StartGrammarManipulation();
+        Cloner cloner = new Cloner();
+        var clonedSymbol = cloner.Clone(symbol);
+        ChangeDuplicateSymbolNames(clonedSymbol);
+
+        GroupSymbol groupSymbol = null;
+        if (symbolsTreeView.SelectedNode.Parent != null) groupSymbol = symbolsTreeView.SelectedNode.Parent.Tag as GroupSymbol;
+
+        if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(clonedSymbol);
+        else Content.AddSymbol(clonedSymbol);
+
+        UpdateGrammerConstraintsForClonedSymbol(symbol, cloner);
+        Content.FinishedGrammarManipulation();
+      }
+    }
+
+    private void removeButton_Click(object sender, EventArgs e) {
+      var symbol = symbolsTreeView.SelectedNode.Tag as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) {
+        Content.RemoveSymbol(symbol);
+      }
+    }
+
+    private void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
+      splitContainer1.Panel2Collapsed = !showDetailsCheckBox.Checked;
+    }
+
+    private void showSampleTreeButton_Click(object sender, EventArgs e) {
+      SymbolicExpressionGrammarSampleExpressionTreeView view = new SymbolicExpressionGrammarSampleExpressionTreeView();
+      view.Content = Content;
+      view.Show();
+    }
+
+    #endregion
+
+    #region helpers
+    private void UpdateGrammerConstraintsForClonedSymbol(ISymbol symbol, Cloner cloner) {
+      foreach (var s in symbol.Flatten().Where(x => !(x is GroupSymbol))) {
+        if (!cloner.ClonedObjectRegistered(s)) throw new InvalidOperationException();
+        var clone = cloner.Clone(s);
+        Content.SetSubtreeCount(clone, Content.GetMinimumSubtreeCount(s), Content.GetMaximumSubtreeCount(s));
+        foreach (var childSymbol in Content.GetAllowedChildSymbols(s)) {
+          var newChildSymbol = childSymbol;
+          if (cloner.ClonedObjectRegistered(childSymbol)) newChildSymbol = cloner.Clone(childSymbol);
+          Content.AddAllowedChildSymbol(clone, newChildSymbol);
+        }
+        for (int i = 0; i < Content.GetMaximumSubtreeCount(s); i++) {
+          foreach (var childSymbol in Content.GetAllowedChildSymbols(s, i)) {
+            var newChildSymbol = childSymbol;
+            if (cloner.ClonedObjectRegistered(childSymbol)) newChildSymbol = cloner.Clone(childSymbol);
+            Content.AddAllowedChildSymbol(clone, newChildSymbol, i);
+          }
+        }
+      }
+    }
+
+    private void ChangeDuplicateSymbolNames(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        var originalSymbolName = s.Name;
+        int i = 1;
+        while (Content.ContainsSymbol(s)) {
+          s.Name = originalSymbolName + i;
+          i++;
+        }
+      }
+    }
+
+    private void UpdateSymbolDetailsViews() {
+      if (symbolsTreeView.SelectedNode != null) {
+        symbolDetailsViewHost.Content = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+        allowedChildSymbolsControl.Symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+      } else {
+        symbolDetailsViewHost.Content = null;
+        allowedChildSymbolsControl.Symbol = null;
+      }
+    }
+
+    private IEnumerable<TreeNode> IterateTreeNodes(TreeNode node = null) {
+      TreeNodeCollection nodes;
+      if (node == null)
+        nodes = symbolsTreeView.Nodes;
+      else {
+        nodes = node.Nodes;
+        yield return node;
+      }
+
+      foreach (var childNode in nodes.OfType<TreeNode>())
+        foreach (var n in IterateTreeNodes(childNode))
+          yield return n;
+    }
+
+    protected virtual void RebuildImageList() {
+      symbolsTreeView.ImageList.Images.Clear();
+      foreach (TreeNode treeNode in IterateTreeNodes()) {
+        var symbol = (ISymbol)treeNode.Tag;
+        symbolsTreeView.ImageList.Images.Add(symbol == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : symbol.ItemImage);
+        treeNode.ImageIndex = symbolsTreeView.ImageList.Images.Count - 1;
+      }
+    }
+
+    //necessary code to handle dock correctly regarding the expanded nodes
+    bool[] expandendedState;
+    protected override void OnHandleCreated(EventArgs e) {
+      base.OnHandleCreated(e);
+      if (expandendedState == null) return;
+      var nodes = IterateTreeNodes().ToList();
+      for (int i = 0; i < nodes.Count; i++)
+        if (expandendedState[i]) nodes[i].Expand();
+    }
+    protected override void OnHandleDestroyed(EventArgs e) {
+      base.OnHandleDestroyed(e);
+      var nodes = IterateTreeNodes().ToList();
+      expandendedState = new bool[nodes.Count];
+      for (int i = 0; i < nodes.Count; i++)
+        expandendedState[i] = nodes[i].IsExpanded;
+    }
+    #endregion
+  }
+
+  //this class is necessary to prevent double clicks which do not fire the checkbox checked event
+  internal class CheckBoxTreeView : TreeView {
+    protected override void WndProc(ref Message m) {
+      // Suppress WM_LBUTTONDBLCLK
+      if (m.Msg == 0x203) { m.Result = IntPtr.Zero; } else base.WndProc(ref m);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs	(revision 6803)
@@ -0,0 +1,186 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionGrammarSampleExpressionTreeView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.sampleTreeGroupBox = new System.Windows.Forms.GroupBox();
+      this.sampleTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.GraphicalSymbolicExpressionTreeView();
+      this.maxTreeLengthLabel = new System.Windows.Forms.Label();
+      this.maxTreeDepthLabel = new System.Windows.Forms.Label();
+      this.maxTreeLengthTextBox = new System.Windows.Forms.TextBox();
+      this.maxTreeDepthTextBox = new System.Windows.Forms.TextBox();
+      this.generateSampleTreeButton = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.sampleTreeGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Location = new System.Drawing.Point(93, 0);
+      this.nameTextBox.Size = new System.Drawing.Size(319, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(418, 3);
+      // 
+      // sampleTreeGroupBox
+      // 
+      this.sampleTreeGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.sampleTreeGroupBox.Controls.Add(this.sampleTreeView);
+      this.sampleTreeGroupBox.Location = new System.Drawing.Point(3, 107);
+      this.sampleTreeGroupBox.Name = "sampleTreeGroupBox";
+      this.sampleTreeGroupBox.Size = new System.Drawing.Size(431, 292);
+      this.sampleTreeGroupBox.TabIndex = 3;
+      this.sampleTreeGroupBox.TabStop = false;
+      this.sampleTreeGroupBox.Text = "Sample SymbolicExpressionTree";
+      // 
+      // sampleTreeView
+      // 
+      this.sampleTreeView.AllowDrop = true;
+      this.sampleTreeView.Caption = "Graphical SymbolicExpressionTree View";
+      this.sampleTreeView.Content = null;
+      this.sampleTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.sampleTreeView.Location = new System.Drawing.Point(3, 16);
+      this.sampleTreeView.Name = "sampleTreeView";
+      this.sampleTreeView.ReadOnly = false;
+      this.sampleTreeView.Size = new System.Drawing.Size(425, 273);
+      this.sampleTreeView.TabIndex = 0;
+      // 
+      // maxTreeLengthLabel
+      // 
+      this.maxTreeLengthLabel.AutoSize = true;
+      this.maxTreeLengthLabel.Location = new System.Drawing.Point(3, 29);
+      this.maxTreeLengthLabel.Name = "maxTreeLengthLabel";
+      this.maxTreeLengthLabel.Size = new System.Drawing.Size(88, 13);
+      this.maxTreeLengthLabel.TabIndex = 4;
+      this.maxTreeLengthLabel.Text = "Max TreeLength:";
+      // 
+      // maxTreeDepthLabel
+      // 
+      this.maxTreeDepthLabel.AutoSize = true;
+      this.maxTreeDepthLabel.Location = new System.Drawing.Point(3, 55);
+      this.maxTreeDepthLabel.Name = "maxTreeDepthLabel";
+      this.maxTreeDepthLabel.Size = new System.Drawing.Size(84, 13);
+      this.maxTreeDepthLabel.TabIndex = 5;
+      this.maxTreeDepthLabel.Text = "Max TreeDepth:";
+      // 
+      // maxTreeLengthTextBox
+      // 
+      this.maxTreeLengthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTreeLengthTextBox.Location = new System.Drawing.Point(93, 26);
+      this.maxTreeLengthTextBox.Name = "maxTreeLengthTextBox";
+      this.maxTreeLengthTextBox.Size = new System.Drawing.Size(341, 20);
+      this.maxTreeLengthTextBox.TabIndex = 6;
+      this.maxTreeLengthTextBox.Text = "50";
+      this.maxTreeLengthTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxTreeLengthTextBox_Validating);
+      this.maxTreeLengthTextBox.Validated += new System.EventHandler(this.maxTreeLengthTextBox_Validated);
+      // 
+      // maxTreeDepthTextBox
+      // 
+      this.maxTreeDepthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTreeDepthTextBox.Location = new System.Drawing.Point(93, 52);
+      this.maxTreeDepthTextBox.Name = "maxTreeDepthTextBox";
+      this.maxTreeDepthTextBox.Size = new System.Drawing.Size(341, 20);
+      this.maxTreeDepthTextBox.TabIndex = 7;
+      this.maxTreeDepthTextBox.Text = "10";
+      this.maxTreeDepthTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxTreeDepthTextBox_Validating);
+      this.maxTreeDepthTextBox.Validated += new System.EventHandler(this.maxTreeDepthTextBox_Validated);
+      // 
+      // generateSampleTreeButton
+      // 
+      this.generateSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.generateSampleTreeButton.Location = new System.Drawing.Point(3, 78);
+      this.generateSampleTreeButton.Name = "generateSampleTreeButton";
+      this.generateSampleTreeButton.Size = new System.Drawing.Size(431, 23);
+      this.generateSampleTreeButton.TabIndex = 8;
+      this.generateSampleTreeButton.Text = "Generate SymbolicExpressionTree";
+      this.generateSampleTreeButton.UseVisualStyleBackColor = true;
+      this.generateSampleTreeButton.Click += new System.EventHandler(this.generateSampleTreeButton_Click);
+      // 
+      // SymbolicExpressionGrammarSampleExpressionTreeView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.sampleTreeGroupBox);
+      this.Controls.Add(this.maxTreeDepthLabel);
+      this.Controls.Add(this.maxTreeLengthTextBox);
+      this.Controls.Add(this.maxTreeLengthLabel);
+      this.Controls.Add(this.maxTreeDepthTextBox);
+      this.Controls.Add(this.generateSampleTreeButton);
+      this.Name = "SymbolicExpressionGrammarSampleExpressionTreeView";
+      this.Size = new System.Drawing.Size(437, 402);
+      this.Controls.SetChildIndex(this.generateSampleTreeButton, 0);
+      this.Controls.SetChildIndex(this.maxTreeDepthTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeLengthLabel, 0);
+      this.Controls.SetChildIndex(this.maxTreeLengthTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeDepthLabel, 0);
+      this.Controls.SetChildIndex(this.sampleTreeGroupBox, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.sampleTreeGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox sampleTreeGroupBox;
+    private System.Windows.Forms.Label maxTreeLengthLabel;
+    private System.Windows.Forms.Label maxTreeDepthLabel;
+    private System.Windows.Forms.TextBox maxTreeLengthTextBox;
+    private System.Windows.Forms.TextBox maxTreeDepthTextBox;
+    private System.Windows.Forms.Button generateSampleTreeButton;
+    private GraphicalSymbolicExpressionTreeView sampleTreeView;
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs	(revision 6803)
@@ -0,0 +1,150 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.ComponentModel;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar Sample Tree")]
+  public partial class SymbolicExpressionGrammarSampleExpressionTreeView : NamedItemView {
+    private IRandom random;
+    public SymbolicExpressionGrammarSampleExpressionTreeView() {
+      InitializeComponent();
+      random = new MersenneTwister();
+      maxSampleTreeLength = int.Parse(maxTreeLengthTextBox.Text);
+      maxSampleTreeDepth = int.Parse(maxTreeDepthTextBox.Text);
+    }
+
+    private int maxSampleTreeLength;
+    public int MaxSampleTreeLength {
+      get { return maxSampleTreeLength; }
+      set {
+        if (maxSampleTreeLength != value) {
+          maxSampleTreeLength = value;
+          UpdateSampleTreeView();
+        }
+      }
+    }
+
+    private int maxSampleTreeDepth;
+    public int MaxSampleTreeDepth {
+      get { return maxSampleTreeDepth; }
+      set {
+        if (maxSampleTreeDepth != value) {
+          maxSampleTreeDepth = value;
+          UpdateSampleTreeView();
+        }
+      }
+    }
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      maxTreeLengthTextBox.Enabled = Content != null;
+      maxTreeDepthTextBox.Enabled = Content != null;
+      generateSampleTreeButton.Enabled = Content != null;
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.Changed -= new EventHandler(Content_Changed);
+      base.DeregisterContentEvents();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) sampleTreeView.Content = null;
+      else UpdateSampleTreeView();
+    }
+
+    private void Content_Changed(object sender, System.EventArgs e) {
+      UpdateSampleTreeView();
+    }
+
+    private void UpdateSampleTreeView() {
+      try {
+        ISymbolicExpressionTree tree = ProbabilisticTreeCreator.Create(random, Content, MaxSampleTreeLength, MaxSampleTreeDepth);
+        foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>())
+          node.SetGrammar(null);
+        sampleTreeView.Content = tree;
+      }
+      catch (Exception ex) {
+        sampleTreeView.Content = null;
+        ErrorHandling.ShowErrorDialog(ex);
+      }
+    }
+
+    #region control events
+    private void generateSampleTreeButton_Click(object sender, EventArgs e) {
+      UpdateSampleTreeView();
+    }
+
+    private void maxTreeLengthTextBox_Validating(object sender, CancelEventArgs e) {
+      int maxTreeLength;
+      if (int.TryParse(maxTreeLengthTextBox.Text, out maxTreeLength) && maxTreeLength > 3) {
+        errorProvider.SetError(maxTreeLengthTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(maxTreeLengthTextBox, "Invalid value: maximum tree length must be larger than 3.");
+        e.Cancel = true;
+      }
+    }
+    private void maxTreeLengthTextBox_Validated(object sender, EventArgs e) {
+      int maxTreeLength;
+      if (int.TryParse(maxTreeLengthTextBox.Text, out maxTreeLength) && maxTreeLength > 3) {
+        MaxSampleTreeLength = maxTreeLength;
+      }
+    }
+
+    private void maxTreeDepthTextBox_Validating(object sender, CancelEventArgs e) {
+      int maxTreeDepth;
+      if (int.TryParse(maxTreeDepthTextBox.Text, out maxTreeDepth) && maxTreeDepth > 3) {
+        errorProvider.SetError(maxTreeDepthTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(maxTreeDepthTextBox, "Invalid value: maximum tree depth must be larger than 3.");
+        e.Cancel = true;
+      }
+    }
+    private void maxTreeDepthTextBox_Validated(object sender, EventArgs e) {
+      int maxTreeDepth;
+      if (int.TryParse(maxTreeDepthTextBox.Text, out maxTreeDepth) && maxTreeDepth > 3) {
+        MaxSampleTreeDepth = maxTreeDepth;
+      }
+    }
+    #endregion
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 6803)
@@ -30,5 +30,5 @@
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
   [View("Symbolic Expression Grammar View")]
-  [Content(typeof(ISymbolicExpressionGrammar), true)]
+  [Content(typeof(ISymbolicExpressionGrammar), false)]
   public partial class SymbolicExpressionGrammarView : NamedItemView {
     private CheckedItemList<ISymbol> symbols;
@@ -90,5 +90,5 @@
           if (!(symbol is IReadOnlySymbol)) {
             symbol.Changed += new EventHandler(symbol_Changed);
-            symbols.Add(symbol, symbol.InitialFrequency > 0.0);
+            symbols.Add(symbol, symbol.Enabled);
           }
         }
@@ -101,16 +101,11 @@
     private void symbol_Changed(object sender, EventArgs e) {
       ISymbol symbol = (ISymbol)sender;
-      symbols.SetItemCheckedState(symbol, symbol.InitialFrequency > 0.0);
+      symbols.SetItemCheckedState(symbol, symbol.Enabled);
     }
 
     private void symbols_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbol>> e) {
       ICheckedItemList<ISymbol> checkedItemList = (ICheckedItemList<ISymbol>)sender;
-      foreach (var indexedItem in e.Items) {
-        if (checkedItemList.ItemChecked(indexedItem.Value)) {
-          indexedItem.Value.InitialFrequency = 1.0;
-        } else {
-          indexedItem.Value.InitialFrequency = 0.0;
-        }
-      }
+      foreach (var indexedItem in e.Items)
+        indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value);
     }
     private void ClearSymbols() {
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 6803)
@@ -31,4 +31,5 @@
     private StringFormat stringFormat;
     private Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode> visualTreeNodes;
+    private Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection> visualLines;
 
     public SymbolicExpressionTreeChart() {
@@ -91,7 +92,10 @@
         tree = value;
         visualTreeNodes = new Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode>();
+        visualLines = new Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection>();
         if (tree != null) {
-          foreach (SymbolicExpressionTreeNode node in tree.IterateNodesPrefix())
+          foreach (ISymbolicExpressionTreeNode node in tree.IterateNodesPrefix()) {
             visualTreeNodes[node] = new VisualSymbolicExpressionTreeNode(node);
+            if (node.Parent != null) visualLines[Tuple.Create(node.Parent, node)] = new VisualSymbolicExpressionTreeNodeConnection();
+          }
         }
         Repaint();
@@ -99,7 +103,13 @@
     }
 
+    private bool suspendRepaint;
+    public bool SuspendRepaint {
+      get { return suspendRepaint; }
+      set { suspendRepaint = value; }
+    }
+
     protected override void OnPaint(PaintEventArgs e) {
+      e.Graphics.DrawImage(image, 0, 0);
       base.OnPaint(e);
-      e.Graphics.DrawImage(image, 0, 0);
     }
     protected override void OnResize(EventArgs e) {
@@ -113,6 +123,8 @@
 
     public void Repaint() {
-      this.GenerateImage();
-      this.Refresh();
+      if (!suspendRepaint) {
+        this.GenerateImage();
+        this.Refresh();
+      }
     }
 
@@ -133,4 +145,12 @@
         return visualTreeNodes[symbolicExpressionTreeNode];
       return null;
+    }
+
+    public VisualSymbolicExpressionTreeNodeConnection GetVisualSymbolicExpressionTreeNodeConnection(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {
+      if (child.Parent != parent) throw new ArgumentException();
+      var key = Tuple.Create(parent, child);
+      VisualSymbolicExpressionTreeNodeConnection connection = null;
+      visualLines.TryGetValue(key, out connection);
+      return connection;
     }
 
@@ -196,5 +216,5 @@
     }
 
-    private VisualSymbolicExpressionTreeNode FindVisualSymbolicExpressionTreeNodeAt(int x, int y) {
+    public VisualSymbolicExpressionTreeNode FindVisualSymbolicExpressionTreeNodeAt(int x, int y) {
       foreach (var visualTreeNode in visualTreeNodes.Values) {
         if (x >= visualTreeNode.X && x <= visualTreeNode.X + visualTreeNode.Width &&
@@ -228,5 +248,4 @@
 
       SolidBrush textBrush = new SolidBrush(visualTreeNode.TextColor);
-      Pen linePen = new Pen(this.lineColor);
       Pen nodeLinePen = new Pen(visualTreeNode.LineColor);
       SolidBrush nodeFillBrush = new SolidBrush(visualTreeNode.FillColor);
@@ -262,5 +281,5 @@
 
       //draw terminal node
-      if (node.SubtreesCount == 0) {
+      if (node.SubtreeCount == 0) {
         graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
         graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
@@ -275,12 +294,17 @@
 
       //draw connection line to parent node
-      if (!connectionPoint.IsEmpty)
-        graphics.DrawLine(linePen, connectionPoint, new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y));
+      if (!connectionPoint.IsEmpty && node.Parent != null) {
+        var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node.Parent, node);
+        using (Pen linePen = new Pen(visualLine.LineColor)) {
+          linePen.DashStyle = visualLine.DashStyle;
+          graphics.DrawLine(linePen, connectionPoint, new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y));
+        }
+      }
 
       //calculate areas for the subtrees according to their tree size and call drawFunctionTree
       Point connectFrom = new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y + visualTreeNode.Height);
-      int[] xBoundaries = new int[node.SubtreesCount + 1];
+      int[] xBoundaries = new int[node.SubtreeCount + 1];
       xBoundaries[0] = x;
-      for (int i = 0; i < node.SubtreesCount; i++) {
+      for (int i = 0; i < node.SubtreeCount; i++) {
         xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)node.GetSubtree(i).GetLength()) / (node.GetLength() - 1));
         DrawFunctionTree(node.GetSubtree(i), graphics, xBoundaries[i], y + height,
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs	(revision 6803)
@@ -23,5 +23,5 @@
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
-  public class VisualSymbolicExpressionTreeNode {
+  public class VisualSymbolicExpressionTreeNode : object {
     private static readonly Color defaultLineColor = Color.Black;
     private static readonly Color defaultTextColor = Color.Black;
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs	(revision 6803)
@@ -0,0 +1,48 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class VisualSymbolicExpressionTreeNodeConnection : object {
+    private static readonly Color defaultLineColor = Color.Black;
+    private static readonly DashStyle defaultDashStyle = DashStyle.Solid;
+
+    private Color lineColor;
+    public Color LineColor {
+      get { return lineColor; }
+      set { lineColor = value; }
+    }
+
+    private DashStyle dashStyle;
+    public DashStyle DashStyle {
+      get { return dashStyle; }
+      set { dashStyle = value; }
+    }
+
+    public VisualSymbolicExpressionTreeNodeConnection()
+      : base() {
+      lineColor = defaultLineColor;
+      dashStyle = defaultDashStyle;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs	(revision 6803)
@@ -127,5 +127,5 @@
           string symbolName;
           if (aggregateDifferentNumberOfSubtrees) symbolName = node.Symbol.Name;
-          else symbolName = node.Symbol.Name + "-" + node.SubtreesCount;
+          else symbolName = node.Symbol.Name + "-" + node.SubtreeCount;
           if (symbolFrequencies.ContainsKey(symbolName)) symbolFrequencies[symbolName] += 1;
           else symbolFrequencies.Add(symbolName, 1);
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 6803)
@@ -62,5 +62,5 @@
       foreach (var node in branch.IterateNodesPrefix()) {
         Instruction instr = new Instruction();
-        int subtreesCount = node.SubtreesCount;
+        int subtreesCount = node.SubtreeCount;
         if (subtreesCount > 255) throw new ArgumentException("Number of subtrees is too big (>255)");
         instr.nArguments = (byte)subtreesCount;
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 6803)
@@ -179,7 +179,6 @@
           ReplaceWithMinimalTree(random, root, parent, argumentIndex);
         } else {
-          var allowedSymbols = (from s in parent.Grammar.Symbols
+          var allowedSymbols = (from s in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, argumentIndex)
                                 where s.InitialFrequency > 0.0
-                                where parent.Grammar.IsAllowedChildSymbol(parent.Symbol, s, argumentIndex)
                                 where parent.Grammar.GetMinimumExpressionDepth(s) < maxDepth - extensionDepth + 1
                                 where parent.Grammar.GetMaximumExpressionLength(s) > targetLength - totalListMinLength - currentLength
@@ -271,5 +270,5 @@
                                               where s.InitialFrequency > 0.0
                                               select node.Grammar.GetMaximumExpressionLength(s)).Max();
-        if (aggregatedLongestExpressionLength < targetLength) minArity = i + 1;
+        if (i > minArity && aggregatedLongestExpressionLength < targetLength) minArity = i + 1;
         else break;
       }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs	(revision 6803)
@@ -96,10 +96,9 @@
       int maxInsertedBranchDepth = maxTreeDepth - GetBranchLevel(parent0.Root, crossoverPoint0.Parent);
 
-
       List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>();
       parent1.Root.ForEachNodePostfix((n) => {
         if (n.GetLength() <= maxInsertedBranchLength &&
-          n.GetDepth() <= maxInsertedBranchDepth &&
-          IsMatchingPointType(crossoverPoint0, n))
+            n.GetDepth() <= maxInsertedBranchDepth &&
+            IsMatchingPointType(crossoverPoint0, n))
           allowedBranches.Add(n);
       });
@@ -133,6 +132,6 @@
       if (newChild == null) {
         // make sure that one subtree can be removed and that only the last subtree is removed 
-        return parent.Grammar.GetMinimumSubtreeCount(parent.Symbol) < parent.SubtreesCount &&
-          cutPoint.ChildIndex == parent.SubtreesCount - 1;
+        return parent.Grammar.GetMinimumSubtreeCount(parent.Symbol) < parent.SubtreeCount &&
+          cutPoint.ChildIndex == parent.SubtreeCount - 1;
       } else {
         // check syntax constraints of direct parent - child relation
@@ -146,6 +145,6 @@
             result &&
             parent.Grammar.ContainsSymbol(n.Symbol) &&
-            n.SubtreesCount >= parent.Grammar.GetMinimumSubtreeCount(n.Symbol) &&
-            n.SubtreesCount <= parent.Grammar.GetMaximumSubtreeCount(n.Symbol);
+            n.SubtreeCount >= parent.Grammar.GetMinimumSubtreeCount(n.Symbol) &&
+            n.SubtreeCount <= parent.Grammar.GetMaximumSubtreeCount(n.Symbol);
         });
         return result;
@@ -169,7 +168,7 @@
           }
           // add one additional extension point if the number of sub trees for the symbol is not full
-          if (n.SubtreesCount < n.Grammar.GetMaximumSubtreeCount(n.Symbol)) {
+          if (n.SubtreeCount < n.Grammar.GetMaximumSubtreeCount(n.Symbol)) {
             // empty extension point
-            internalCrossoverPoints.Add(new CutPoint(n, n.SubtreesCount));
+            internalCrossoverPoints.Add(new CutPoint(n, n.SubtreeCount));
           }
         }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 6803)
@@ -167,4 +167,5 @@
     <Compile Include="Symbols\Argument.cs" />
     <Compile Include="Symbols\ArgumentTreeNode.cs" />
+    <Compile Include="Symbols\GroupSymbol.cs" />
     <Compile Include="Symbols\StartSymbol.cs" />
     <Compile Include="Symbols\InvokeFunction.cs" />
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs	(revision 6803)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using HeuristicLab.Core;
 
@@ -27,4 +28,10 @@
     ISymbolicExpressionTreeNode CreateTreeNode();
     double InitialFrequency { get; set; }
+    bool Enabled { get; set; }
+
+    int MinimumArity { get; }
+    int MaximumArity { get; }
+
+    IEnumerable<ISymbol> Flatten();
 
     event EventHandler Changed;
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs	(revision 6803)
@@ -35,4 +35,17 @@
     bool ReadOnly { get; set; }
     event EventHandler ReadOnlyChanged;
+
+    void AddSymbol(ISymbol symbol);
+    void RemoveSymbol(ISymbol symbol);
+
+    void AddAllowedChildSymbol(ISymbol parent, ISymbol child);
+    void AddAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex);
+    void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child);
+    void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex);
+
+    void SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount);
+
+    void StartGrammarManipulation();
+    void FinishedGrammarManipulation();
   }
 }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammarBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammarBase.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammarBase.cs	(revision 6803)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
 using HeuristicLab.Core;
@@ -41,4 +42,6 @@
     int GetMaximumExpressionLength(ISymbol start);
     int GetMinimumExpressionDepth(ISymbol start);
+
+    event EventHandler Changed;
   }
 }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 6803)
@@ -39,5 +39,5 @@
 
     IEnumerable<ISymbolicExpressionTreeNode> Subtrees { get; }
-    int SubtreesCount { get; }
+    int SubtreeCount { get; }
     ISymbolicExpressionTreeNode GetSubtree(int index);
     int IndexOfSubtree(ISymbolicExpressionTreeNode tree);
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammar.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammar.cs	(revision 6803)
@@ -21,9 +21,10 @@
 
 using System;
+using System.Collections.Generic;
 using System.Linq;
+using HeuristicLab.Collections;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using System.Collections.Generic;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
@@ -120,5 +121,5 @@
     protected SymbolicExpressionGrammar(SymbolicExpressionGrammar original, Cloner cloner)
       : base(original, cloner) {
-      foreach (ISymbol symbol in Symbols)
+      foreach (ISymbol symbol in symbols.Values)
         RegisterSymbolEvents(symbol);
 
@@ -161,11 +162,13 @@
     }
 
-    protected override void AddSymbol(ISymbol symbol) {
+    protected override sealed void AddSymbol(ISymbol symbol) {
       base.AddSymbol(symbol);
       RegisterSymbolEvents(symbol);
-    }
-    protected override void RemoveSymbol(ISymbol symbol) {
+      OnChanged();
+    }
+    protected override sealed void RemoveSymbol(ISymbol symbol) {
       DeregisterSymbolEvents(symbol);
       base.RemoveSymbol(symbol);
+      OnChanged();
     }
 
@@ -177,5 +180,5 @@
     }
 
-    #region IStatefulItem
+    #region IStatefulItem methods
     void IStatefulItem.InitializeState() { }
     void IStatefulItem.ClearState() {
@@ -184,12 +187,98 @@
     #endregion
 
+    #region ISymbolicExpressionGrammar methods
+    void ISymbolicExpressionGrammar.AddSymbol(ISymbol symbol) {
+      if (ReadOnly) throw new InvalidOperationException();
+      AddSymbol(symbol);
+    }
+    void ISymbolicExpressionGrammar.RemoveSymbol(ISymbol symbol) {
+      if (ReadOnly) throw new InvalidOperationException();
+      RemoveSymbol(symbol);
+    }
+
+    void ISymbolicExpressionGrammar.AddAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.AddAllowedChildSymbol(parent, child);
+    }
+    void ISymbolicExpressionGrammar.AddAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.AddAllowedChildSymbol(parent, child, argumentIndex);
+    }
+    void ISymbolicExpressionGrammar.RemoveAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.RemoveAllowedChildSymbol(parent, child);
+    }
+    void ISymbolicExpressionGrammar.RemoveAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.RemoveAllowedChildSymbol(parent, child, argumentIndex);
+    }
+
+    void ISymbolicExpressionGrammar.SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.SetSubtreeCount(symbol, minimumSubtreeCount, maximumSubtreeCount);
+    }
+
+    private bool suppressEvents = false;
+    void ISymbolicExpressionGrammar.StartGrammarManipulation() {
+      suppressEvents = true;
+    }
+    void ISymbolicExpressionGrammar.FinishedGrammarManipulation() {
+      suppressEvents = false;
+      OnChanged();
+    }
+
+    protected override void OnChanged() {
+      if (suppressEvents) return;
+      base.OnChanged();
+    }
+    #endregion
+
     #region symbol events
-    protected virtual void RegisterSymbolEvents(ISymbol symbol) {
-      symbol.NameChanging += new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
-      symbol.NameChanged += new EventHandler(Symbol_NameChanged);
-    }
-    protected virtual void DeregisterSymbolEvents(ISymbol symbol) {
-      symbol.NameChanging -= new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
-      symbol.NameChanged -= new EventHandler(Symbol_NameChanged);
+    private void RegisterSymbolEvents(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        s.NameChanging += new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
+        s.NameChanged += new EventHandler(Symbol_NameChanged);
+
+        var groupSymbol = s as GroupSymbol;
+        if (groupSymbol != null) RegisterGroupSymbolEvents(groupSymbol);
+        else symbol.Changed += new EventHandler(Symbol_Changed);
+      }
+    }
+    private void DeregisterSymbolEvents(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        s.NameChanging -= new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
+        s.NameChanged -= new EventHandler(Symbol_NameChanged);
+
+        var groupSymbol = s as GroupSymbol;
+        if (groupSymbol != null) DeregisterGroupSymbolEvents(groupSymbol);
+        else symbol.Changed -= new EventHandler(Symbol_Changed);
+      }
+    }
+
+    private void RegisterGroupSymbolEvents(GroupSymbol groupSymbol) {
+      groupSymbol.Changed += new EventHandler(GroupSymbol_Changed);
+      groupSymbol.SymbolsCollection.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsAdded);
+      groupSymbol.SymbolsCollection.ItemsRemoved += new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsRemoved);
+      groupSymbol.SymbolsCollection.CollectionReset += new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_CollectionReset);
+    }
+    private void DeregisterGroupSymbolEvents(GroupSymbol groupSymbol) {
+      groupSymbol.Changed -= new EventHandler(GroupSymbol_Changed);
+      groupSymbol.SymbolsCollection.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsAdded);
+      groupSymbol.SymbolsCollection.ItemsRemoved -= new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsRemoved);
+      groupSymbol.SymbolsCollection.CollectionReset -= new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_CollectionReset);
+    }
+
+    private void Symbol_Changed(object sender, EventArgs e) {
+      ClearCaches();
+      OnChanged();
+    }
+
+    private void GroupSymbol_Changed(object sender, EventArgs e) {
+      GroupSymbol groupSymbol = (GroupSymbol)sender;
+      foreach (ISymbol symbol in groupSymbol.Flatten())
+        symbol.Enabled = groupSymbol.Enabled;
+
+      ClearCaches();
+      OnChanged();
     }
 
@@ -234,4 +323,27 @@
 
       ClearCaches();
+      OnChanged();
+    }
+
+    private void GroupSymbol_ItemsAdded(object sender, CollectionItemsChangedEventArgs<ISymbol> e) {
+      foreach (ISymbol symbol in e.Items)
+        if (!ContainsSymbol(symbol))
+          AddSymbol(symbol);
+      OnChanged();
+    }
+    private void GroupSymbol_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<ISymbol> e) {
+      foreach (ISymbol symbol in e.Items)
+        if (ContainsSymbol(symbol))
+          RemoveSymbol(symbol);
+      OnChanged();
+    }
+    private void GroupSymbol_CollectionReset(object sender, CollectionItemsChangedEventArgs<ISymbol> e) {
+      foreach (ISymbol symbol in e.Items)
+        if (!ContainsSymbol(symbol))
+          AddSymbol(symbol);
+      foreach (ISymbol symbol in e.OldItems)
+        if (ContainsSymbol(symbol))
+          RemoveSymbol(symbol);
+      OnChanged();
     }
     #endregion
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammarBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammarBase.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammarBase.cs	(revision 6803)
@@ -36,4 +36,5 @@
   [StorableClass]
   public abstract class SymbolicExpressionGrammarBase : NamedItem, ISymbolicExpressionGrammarBase {
+
     #region properties for separation between implementation and persistence
     [Storable(Name = "Symbols")]
@@ -62,4 +63,5 @@
     #endregion
 
+    private bool suppressEvents;
     protected Dictionary<string, ISymbol> symbols;
     protected Dictionary<string, Tuple<int, int>> symbolSubtreeCount;
@@ -80,4 +82,6 @@
       cachedMaxExpressionLength = new Dictionary<string, int>();
       cachedMinExpressionDepth = new Dictionary<string, int>();
+
+      suppressEvents = false;
     }
 
@@ -98,4 +102,6 @@
       foreach (var element in original.allowedChildSymbolsPerIndex)
         allowedChildSymbolsPerIndex.Add(element.Key, new List<string>(element.Value));
+
+      suppressEvents = false;
     }
 
@@ -110,4 +116,6 @@
       allowedChildSymbols = new Dictionary<string, List<string>>();
       allowedChildSymbolsPerIndex = new Dictionary<Tuple<string, int>, List<string>>();
+
+      suppressEvents = false;
     }
 
@@ -115,25 +123,33 @@
     protected virtual void AddSymbol(ISymbol symbol) {
       if (ContainsSymbol(symbol)) throw new ArgumentException("Symbol " + symbol + " is already defined.");
-      symbols.Add(symbol.Name, symbol);
-      symbolSubtreeCount.Add(symbol.Name, Tuple.Create(0, 0));
+      foreach (var s in symbol.Flatten()) {
+        symbols.Add(s.Name, s);
+        symbolSubtreeCount.Add(s.Name, Tuple.Create(s.MinimumArity, s.MaximumArity));
+      }
       ClearCaches();
     }
 
     protected virtual void RemoveSymbol(ISymbol symbol) {
-      symbols.Remove(symbol.Name);
-      allowedChildSymbols.Remove(symbol.Name);
-      for (int i = 0; i < GetMaximumSubtreeCount(symbol); i++)
-        allowedChildSymbolsPerIndex.Remove(Tuple.Create(symbol.Name, i));
-      symbolSubtreeCount.Remove(symbol.Name);
-
-      foreach (var parent in Symbols) {
-        List<string> allowedChilds;
-        if (allowedChildSymbols.TryGetValue(parent.Name, out allowedChilds))
-          allowedChilds.Remove(symbol.Name);
-
-        for (int i = 0; i < GetMaximumSubtreeCount(parent); i++) {
-          if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, i), out allowedChilds))
-            allowedChilds.Remove(symbol.Name);
+      foreach (var s in symbol.Flatten()) {
+        symbols.Remove(s.Name);
+        allowedChildSymbols.Remove(s.Name);
+        for (int i = 0; i < GetMaximumSubtreeCount(s); i++)
+          allowedChildSymbolsPerIndex.Remove(Tuple.Create(s.Name, i));
+        symbolSubtreeCount.Remove(s.Name);
+
+        foreach (var parent in Symbols) {
+          List<string> allowedChilds;
+          if (allowedChildSymbols.TryGetValue(parent.Name, out allowedChilds))
+            allowedChilds.Remove(s.Name);
+
+          for (int i = 0; i < GetMaximumSubtreeCount(parent); i++) {
+            if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, i), out allowedChilds))
+              allowedChilds.Remove(s.Name);
+          }
         }
+        suppressEvents = true;
+        foreach (var groupSymbol in Symbols.OfType<GroupSymbol>())
+          groupSymbol.SymbolsCollection.Remove(symbol);
+        suppressEvents = false;
       }
       ClearCaches();
@@ -147,4 +163,16 @@
 
     protected void AddAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      bool changed = false;
+
+      foreach (ISymbol p in parent.Flatten().Where(p => !(p is GroupSymbol)))
+        changed |= AddAllowedChildSymbolToDictionaries(p, child);
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
+      }
+    }
+
+    private bool AddAllowedChildSymbolToDictionaries(ISymbol parent, ISymbol child) {
       List<string> childSymbols;
       if (!allowedChildSymbols.TryGetValue(parent.Name, out childSymbols)) {
@@ -152,12 +180,38 @@
         allowedChildSymbols.Add(parent.Name, childSymbols);
       }
-      if (childSymbols.Contains(child.Name)) throw new ArgumentException();
+      if (childSymbols.Contains(child.Name)) return false;
+
+      suppressEvents = true;
+      for (int argumentIndex = 0; argumentIndex < GetMaximumSubtreeCount(parent); argumentIndex++)
+        RemoveAllowedChildSymbol(parent, child, argumentIndex);
+      suppressEvents = false;
+
       childSymbols.Add(child.Name);
-      ClearCaches();
+      return true;
     }
 
     protected void AddAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      bool changed = false;
+
+      foreach (ISymbol p in parent.Flatten().Where(p => !(p is GroupSymbol)))
+        changed |= AddAllowedChildSymbolToDictionaries(p, child, argumentIndex);
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
+      }
+    }
+
+
+    private bool AddAllowedChildSymbolToDictionaries(ISymbol parent, ISymbol child, int argumentIndex) {
+      List<string> childSymbols;
+      if (!allowedChildSymbols.TryGetValue(parent.Name, out childSymbols)) {
+        childSymbols = new List<string>();
+        allowedChildSymbols.Add(parent.Name, childSymbols);
+      }
+      if (childSymbols.Contains(child.Name)) return false;
+
+
       var key = Tuple.Create(parent.Name, argumentIndex);
-      List<string> childSymbols;
       if (!allowedChildSymbolsPerIndex.TryGetValue(key, out childSymbols)) {
         childSymbols = new List<string>();
@@ -165,29 +219,68 @@
       }
 
-      if (IsAllowedChildSymbol(parent, child)) throw new ArgumentException();
-      if (childSymbols.Contains(child.Name)) throw new ArgumentException();
+      if (childSymbols.Contains(child.Name)) return false;
+
       childSymbols.Add(child.Name);
-      ClearCaches();
+      return true;
     }
 
     protected void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      bool changed = false;
       List<string> childSymbols;
       if (allowedChildSymbols.TryGetValue(child.Name, out childSymbols)) {
-        if (allowedChildSymbols[parent.Name].Remove(child.Name))
-          ClearCaches();
+        changed |= childSymbols.Remove(child.Name);
+      }
+
+      for (int argumentIndex = 0; argumentIndex < GetMaximumSubtreeCount(parent); argumentIndex++) {
+        var key = Tuple.Create(parent.Name, argumentIndex);
+        if (allowedChildSymbolsPerIndex.TryGetValue(key, out childSymbols))
+          changed |= childSymbols.Remove(child.Name);
+      }
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
       }
     }
 
     protected void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      bool changed = false;
+
+      suppressEvents = true;
+      List<string> childSymbols;
+      if (allowedChildSymbols.TryGetValue(parent.Name, out childSymbols)) {
+        if (childSymbols.Remove(child.Name)) {
+          for (int i = 0; i < GetMaximumSubtreeCount(parent); i++) {
+            if (i != argumentIndex) AddAllowedChildSymbol(parent, child, i);
+          }
+          changed = true;
+        }
+      }
+      suppressEvents = false;
+
       var key = Tuple.Create(parent.Name, argumentIndex);
-      List<string> childSymbols;
-      if (allowedChildSymbolsPerIndex.TryGetValue(key, out childSymbols)) {
-        if (allowedChildSymbolsPerIndex[key].Remove(child.Name))
-          ClearCaches();
+      if (allowedChildSymbolsPerIndex.TryGetValue(key, out childSymbols))
+        changed |= childSymbols.Remove(child.Name);
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
       }
     }
 
     protected void SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) {
-      for (int i = GetMaximumSubtreeCount(symbol) - 1; i >= maximumSubtreeCount; i--) {
+      var symbols = symbol.Flatten().Where(s => !(s is GroupSymbol));
+      if (symbols.Any(s => s.MinimumArity > minimumSubtreeCount)) throw new ArgumentException("Invalid minimum subtree count " + minimumSubtreeCount + " for " + symbol);
+      if (symbols.Any(s => s.MaximumArity < maximumSubtreeCount)) throw new ArgumentException("Invalid maximum subtree count " + maximumSubtreeCount + " for " + symbol);
+
+      foreach (ISymbol s in symbols)
+        SetSubTreeCountInDictionaries(s, minimumSubtreeCount, maximumSubtreeCount);
+
+      ClearCaches();
+      OnChanged();
+    }
+
+    private void SetSubTreeCountInDictionaries(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) {
+      for (int i = maximumSubtreeCount; i < GetMaximumSubtreeCount(symbol); i++) {
         var key = Tuple.Create(symbol.Name, i);
         allowedChildSymbolsPerIndex.Remove(key);
@@ -195,14 +288,12 @@
 
       symbolSubtreeCount[symbol.Name] = Tuple.Create(minimumSubtreeCount, maximumSubtreeCount);
-      ClearCaches();
     }
     #endregion
 
-    #region ISymbolicExpressionGrammarBase Members
     public virtual IEnumerable<ISymbol> Symbols {
       get { return symbols.Values; }
     }
     public virtual IEnumerable<ISymbol> AllowedSymbols {
-      get { return Symbols.Where(s => !s.InitialFrequency.IsAlmost(0.0)); }
+      get { return Symbols.Where(s => s.Enabled); }
     }
     public virtual bool ContainsSymbol(ISymbol symbol) {
@@ -211,23 +302,33 @@
 
     public virtual bool IsAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      if (!child.Enabled) return false;
+
       List<string> temp;
-      if (allowedChildSymbols.TryGetValue(parent.Name, out temp))
+      if (allowedChildSymbols.TryGetValue(parent.Name, out temp)) {
         if (temp.Contains(child.Name)) return true;
+        if (temp.SelectMany(s => GetSymbol(s).Flatten().Select(n => n.Name)).Contains(child.Name)) return true;
+      }
       return false;
     }
 
     public virtual bool IsAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      if (!child.Enabled) return false;
+      if (IsAllowedChildSymbol(parent, child)) return true;
+
       List<string> temp;
-      if (allowedChildSymbols.TryGetValue(parent.Name, out temp))
+      var key = Tuple.Create(parent.Name, argumentIndex);
+      if (allowedChildSymbolsPerIndex.TryGetValue(key, out temp)) {
         if (temp.Contains(child.Name)) return true;
-
-      var key = Tuple.Create(parent.Name, argumentIndex);
-      if (allowedChildSymbolsPerIndex.TryGetValue(key, out temp))
-        return temp.Contains(child.Name);
+        if (temp.SelectMany(s => GetSymbol(s).Flatten().Select(n => n.Name)).Contains(child.Name)) return true;
+      }
       return false;
     }
 
     public virtual IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent) {
-      return from s in AllowedSymbols where IsAllowedChildSymbol(parent, s) select s;
+      List<string> childs;
+      if (!allowedChildSymbols.TryGetValue(parent.Name, out childs))
+        return Enumerable.Empty<ISymbol>();
+
+      return childs.Select(x => GetSymbol(x)).Where(s => s.Enabled);
     }
 
@@ -242,5 +343,5 @@
         result = result.Union(temp);
 
-      return result.Select(x => GetSymbol(x));
+      return result.Select(x => GetSymbol(x)).Where(s => s.Enabled);
     }
 
@@ -251,5 +352,4 @@
       return symbolSubtreeCount[symbol.Name].Item2;
     }
-
 
     protected void ClearCaches() {
@@ -265,6 +365,5 @@
         cachedMinExpressionLength[symbol.Name] = int.MaxValue; // prevent infinite recursion
         long sumOfMinExpressionLengths = 1 + (from argIndex in Enumerable.Range(0, GetMinimumSubtreeCount(symbol))
-                                              let minForSlot = (long)(from s in AllowedSymbols
-                                                                      where IsAllowedChildSymbol(symbol, s, argIndex)
+                                              let minForSlot = (long)(from s in GetAllowedChildSymbols(symbol, argIndex)
                                                                       select GetMinimumExpressionLength(s)).DefaultIfEmpty(0).Min()
                                               select minForSlot).DefaultIfEmpty(0).Sum();
@@ -282,6 +381,5 @@
         cachedMaxExpressionLength[symbol.Name] = int.MaxValue; // prevent infinite recursion
         long sumOfMaxTrees = 1 + (from argIndex in Enumerable.Range(0, GetMaximumSubtreeCount(symbol))
-                                  let maxForSlot = (long)(from s in AllowedSymbols
-                                                          where IsAllowedChildSymbol(symbol, s, argIndex)
+                                  let maxForSlot = (long)(from s in GetAllowedChildSymbols(symbol, argIndex)
                                                           select GetMaximumExpressionLength(s)).DefaultIfEmpty(0).Max()
                                   select maxForSlot).DefaultIfEmpty(0).Sum();
@@ -298,6 +396,5 @@
         cachedMinExpressionDepth[symbol.Name] = int.MaxValue; // prevent infinite recursion
         long minDepth = 1 + (from argIndex in Enumerable.Range(0, GetMinimumSubtreeCount(symbol))
-                             let minForSlot = (long)(from s in AllowedSymbols
-                                                     where IsAllowedChildSymbol(symbol, s, argIndex)
+                             let minForSlot = (long)(from s in GetAllowedChildSymbols(symbol, argIndex)
                                                      select GetMinimumExpressionDepth(s)).DefaultIfEmpty(0).Min()
                              select minForSlot).DefaultIfEmpty(0).Max();
@@ -307,5 +404,11 @@
       return temp;
     }
-    #endregion
+
+    public event EventHandler Changed;
+    protected virtual void OnChanged() {
+      if (suppressEvents) return;
+      var handler = Changed;
+      if (handler != null) Changed(this, EventArgs.Empty);
+    }
   }
 }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs	(revision 6803)
@@ -81,8 +81,10 @@
     }
     public override IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent) {
-      return grammar.GetAllowedChildSymbols(parent).Union(base.GetAllowedChildSymbols(parent));
+      var symbols = grammar.GetAllowedChildSymbols(parent).Union(base.GetAllowedChildSymbols(parent));
+      return symbols.SelectMany(s => s.Flatten()).Where(s => s.Enabled && !(s is GroupSymbol));
     }
     public override IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent, int argumentIndex) {
-      return grammar.GetAllowedChildSymbols(parent, argumentIndex).Union(base.GetAllowedChildSymbols(parent, argumentIndex));
+      var symbols = grammar.GetAllowedChildSymbols(parent, argumentIndex).Union(base.GetAllowedChildSymbols(parent, argumentIndex));
+      return symbols.SelectMany(s => s.Flatten()).Where(s => s.Enabled && !(s is GroupSymbol));
     }
 
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 6803)
@@ -128,5 +128,5 @@
     public virtual void ShakeLocalParameters(IRandom random, double shakingFactor) { }
 
-    public int SubtreesCount {
+    public int SubtreeCount {
       get {
         if (subtrees == null) return 0;
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 6803)
@@ -32,4 +32,14 @@
     public const string ArgumentName = "Argument";
     public const string ArgumentDescription = "Symbol that represents a function argument.";
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [Storable]
     private int argumentIndex;
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs	(revision 6803)
@@ -32,4 +32,13 @@
     public const string DefunName = "Defun";
     public const string DefunDescription = "Symbol that represents a function defining node.";
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
 
     [StorableConstructor]
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/GroupSymbol.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/GroupSymbol.cs	(revision 6803)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/GroupSymbol.cs	(revision 6803)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 System.Linq;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public sealed class GroupSymbol : Symbol {
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    private ObservableSet<ISymbol> symbols;
+    public IObservableSet<ISymbol> SymbolsCollection {
+      get { return symbols; }
+    }
+    [Storable]
+    public IEnumerable<ISymbol> Symbols {
+      get { return symbols; }
+      private set { symbols = new ObservableSet<ISymbol>(value); }
+    }
+
+    [StorableConstructor]
+    private GroupSymbol(bool deserializing) : base(deserializing) { }
+    private GroupSymbol(GroupSymbol original, Cloner cloner)
+      : base(original, cloner) {
+      symbols = new ObservableSet<ISymbol>(original.Symbols.Select(s => cloner.Clone(s)));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GroupSymbol(this, cloner);
+    }
+
+    public GroupSymbol() : this("Group Symbol", Enumerable.Empty<ISymbol>()) { }
+    public GroupSymbol(string name, IEnumerable<ISymbol> symbols)
+      : base(name, "A symbol which groups other symbols") {
+      this.symbols = new ObservableSet<ISymbol>(symbols);
+      InitialFrequency = 0.0;
+    }
+
+    public override IEnumerable<ISymbol> Flatten() {
+      return base.Flatten().Union(symbols.SelectMany(s => s.Flatten()));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 6803)
@@ -32,4 +32,13 @@
     public const string InvokeFunctionName = "InvokeFunction";
     public const string InvokeFunctionDescription = "Symbol that the invocation of another function.";
+    private const int minimumArity = 0;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
 
     [Storable]
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs	(revision 6803)
@@ -29,4 +29,13 @@
     public const string ProgramRootSymbolName = "ProgramRootSymbol";
     public const string ProgramRootSymbolDescription = "Special symbol that represents the program root node of a symbolic expression tree.";
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
 
     [StorableConstructor]
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs	(revision 6803)
@@ -29,7 +29,18 @@
     public const string StartSymbolName = "StartSymbol";
     public const string StartSymbolDescription = "Special symbol that represents the starting node of the result producing branch of a symbolic expression tree.";
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
 
     [StorableConstructor]
-    private StartSymbol(bool deserializing) : base(deserializing) { }
+    private StartSymbol(bool deserializing)
+      : base(deserializing) {
+    }
     private StartSymbol(StartSymbol original, Cloner cloner) : base(original, cloner) { }
     public StartSymbol() : base(StartSymbol.StartSymbolName, StartSymbol.StartSymbolDescription) { }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 6803)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -42,4 +43,29 @@
       }
     }
+
+    [Storable(DefaultValue = true)]
+    private bool enabled;
+    public virtual bool Enabled {
+      get { return enabled; }
+      set {
+        if (value != enabled) {
+          enabled = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    [Storable(DefaultValue = false)]
+    private bool @fixed;
+    public bool Fixed {
+      get { return @fixed; }
+      set {
+        if (value != @fixed) {
+          @fixed = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
     public override bool CanChangeName {
       get { return !(this is IReadOnlySymbol); }
@@ -48,4 +74,7 @@
       get { return false; }
     }
+
+    public abstract int MinimumArity { get; }
+    public abstract int MaximumArity { get; }
     #endregion
 
@@ -55,4 +84,6 @@
       : base(original, cloner) {
       initialFrequency = original.initialFrequency;
+      enabled = original.enabled;
+      @fixed = original.@fixed;
     }
 
@@ -60,4 +91,15 @@
       : base(name, description) {
       initialFrequency = 1.0;
+      enabled = true;
+      @fixed = false;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (initialFrequency.IsAlmost(0.0) && !(this is GroupSymbol)) enabled = false;
+      #endregion
+
     }
 
@@ -66,12 +108,14 @@
     }
 
-    #region events
+    public virtual IEnumerable<ISymbol> Flatten() {
+      yield return this;
+    }
+
     public event EventHandler Changed;
-    protected void OnChanged(EventArgs e) {
+    protected virtual void OnChanged(EventArgs e) {
       EventHandler handlers = Changed;
       if (handlers != null)
         handlers(this, e);
     }
-    #endregion
   }
 }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Grammars.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Grammars.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Grammars.cs	(revision 6803)
@@ -27,7 +27,16 @@
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._4.Tests {
   public static class Grammars {
-
     [StorableClass]
     private class Addition : Symbol {
+      private const int minimumArity = 1;
+      private const int maximumArity = byte.MaxValue;
+
+      public override int MinimumArity {
+        get { return minimumArity; }
+      }
+      public override int MaximumArity {
+        get { return maximumArity; }
+      }
+
       [StorableConstructor]
       protected Addition(bool deserializing) : base(deserializing) { }
@@ -41,4 +50,14 @@
     [StorableClass]
     private class Subtraction : Symbol {
+      private const int minimumArity = 1;
+      private const int maximumArity = byte.MaxValue;
+
+      public override int MinimumArity {
+        get { return minimumArity; }
+      }
+      public override int MaximumArity {
+        get { return maximumArity; }
+      }
+
       [StorableConstructor]
       protected Subtraction(bool deserializing) : base(deserializing) { }
@@ -52,4 +71,14 @@
     [StorableClass]
     private class Multiplication : Symbol {
+      private const int minimumArity = 1;
+      private const int maximumArity = byte.MaxValue;
+
+      public override int MinimumArity {
+        get { return minimumArity; }
+      }
+      public override int MaximumArity {
+        get { return maximumArity; }
+      }
+
       [StorableConstructor]
       protected Multiplication(bool deserializing) : base(deserializing) { }
@@ -63,4 +92,14 @@
     [StorableClass]
     private class Division : Symbol {
+      private const int minimumArity = 1;
+      private const int maximumArity = byte.MaxValue;
+
+      public override int MinimumArity {
+        get { return minimumArity; }
+      }
+      public override int MaximumArity {
+        get { return maximumArity; }
+      }
+
       [StorableConstructor]
       protected Division(bool deserializing) : base(deserializing) { }
@@ -74,4 +113,14 @@
     [StorableClass]
     private class Terminal : Symbol {
+      private const int minimumArity = 0;
+      private const int maximumArity = 0;
+
+      public override int MinimumArity {
+        get { return minimumArity; }
+      }
+      public override int MaximumArity {
+        get { return maximumArity; }
+      }
+
       [StorableConstructor]
       protected Terminal(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Util.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Util.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Util.cs	(revision 6803)
@@ -122,5 +122,5 @@
 
         foreach (var argTreenode in defunTreeNode.IterateNodesPrefix().OfType<ArgumentTreeNode>()) {
-          Assert.IsTrue(argTreenode.SubtreesCount == 0);
+          Assert.IsTrue(argTreenode.SubtreeCount == 0);
           Assert.IsTrue(((Argument)argTreenode.Symbol).ArgumentIndex < arity);
         }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/IfFoodAhead.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/IfFoodAhead.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/IfFoodAhead.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("IfFoodAhead", "Represents the if-food-ahead symbol in a artificial ant expression.")]
   public sealed class IfFoodAhead : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 3;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private IfFoodAhead(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Left.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Left.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Left.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Left", "Represents the turn-left symbol in a artificial ant expression.")]
   public sealed class Left : Symbol {
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Left(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Move.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Move.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Move.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Move", "Represents the move-forward symbol in a artificial ant expression.")]
   public sealed class Move : Symbol {
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Move(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Prog2.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Prog2.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Prog2.cs	(revision 6803)
@@ -29,4 +29,14 @@
   [Item("Prog2", "Represents the sequence symbol with 2 sub-trees in a artificial ant expression.")]
   public sealed class Prog2 : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Prog2(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Prog3.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Prog3.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Prog3.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Prog3", "Represents the sequence symbol with 3 sub-trees in a artificial ant expression.")]
   public sealed class Prog3 : Symbol {
+    private const int minimumArity = 3;
+    private const int maximumArity = 3;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Prog3(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Right.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Right.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Symbols/Right.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Right", "Represents the turn-right symbol in a artificial ant expression.")]
   public sealed class Right : Symbol {
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Right(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs	(revision 6803)
@@ -112,11 +112,11 @@
     private double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree) {
       // remove old ADFs
-      while (tempTree.Root.SubtreesCount > 1) tempTree.Root.RemoveSubtree(1);
+      while (tempTree.Root.SubtreeCount > 1) tempTree.Root.RemoveSubtree(1);
       // clone ADFs of source tree
-      for (int i = 1; i < sourceTree.Root.SubtreesCount; i++) {
+      for (int i = 1; i < sourceTree.Root.SubtreeCount; i++) {
         tempTree.Root.AddSubtree((ISymbolicExpressionTreeNode)sourceTree.Root.GetSubtree(i).Clone());
       }
       var start = tempTree.Root.GetSubtree(0);
-      while (start.SubtreesCount > 0) start.RemoveSubtree(0);
+      while (start.SubtreeCount > 0) start.RemoveSubtree(0);
       start.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());
       var interpreter = Content.Model.Interpreter;
@@ -127,5 +127,5 @@
 
     private void SwitchNode(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode oldBranch, ISymbolicExpressionTreeNode newBranch) {
-      for (int i = 0; i < root.SubtreesCount; i++) {
+      for (int i = 0; i < root.SubtreeCount; i++) {
         if (root.GetSubtree(i) == oldBranch) {
           root.RemoveSubtree(i);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs	(revision 6803)
@@ -62,6 +62,14 @@
       MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
 
+      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
+
+      ConfigureGrammarSymbols();
       InitializeOperators();
       UpdateEstimationLimits();
+    }
+
+    private void ConfigureGrammarSymbols() {
+      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
+      if (grammar != null) grammar.ConfigureAsDefaultClassificationGrammar();
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs	(revision 6803)
@@ -60,6 +60,14 @@
       MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
 
+      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
+
+      ConfigureGrammarSymbols();
       InitializeOperators();
       UpdateEstimationLimits();
+    }
+
+    private void ConfigureGrammarSymbols() {
+      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
+      if (grammar != null) grammar.ConfigureAsDefaultClassificationGrammar();
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs	(revision 6803)
@@ -140,8 +140,8 @@
       if (startNode.GetSubtree(0).Symbol is Addition) {
         var addNode = startNode.GetSubtree(0);
-        if (addNode.SubtreesCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
+        if (addNode.SubtreeCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
           alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode;
           var mulNode = addNode.GetSubtree(0);
-          if (mulNode.SubtreesCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
+          if (mulNode.SubtreeCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
             betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode;
           }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 6803)
@@ -97,11 +97,11 @@
     private double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree) {
       // remove old ADFs
-      while (tempTree.Root.SubtreesCount > 1) tempTree.Root.RemoveSubtree(1);
+      while (tempTree.Root.SubtreeCount > 1) tempTree.Root.RemoveSubtree(1);
       // clone ADFs of source tree
-      for (int i = 1; i < sourceTree.Root.SubtreesCount; i++) {
+      for (int i = 1; i < sourceTree.Root.SubtreeCount; i++) {
         tempTree.Root.AddSubtree((ISymbolicExpressionTreeNode)sourceTree.Root.GetSubtree(i).Clone());
       }
       var start = tempTree.Root.GetSubtree(0);
-      while (start.SubtreesCount > 0) start.RemoveSubtree(0);
+      while (start.SubtreeCount > 0) start.RemoveSubtree(0);
       start.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());
       var interpreter = Content.Model.Interpreter;
@@ -112,5 +112,5 @@
 
     private void SwitchNode(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode oldBranch, ISymbolicExpressionTreeNode newBranch) {
-      for (int i = 0; i < root.SubtreesCount; i++) {
+      for (int i = 0; i < root.SubtreeCount; i++) {
         if (root.GetSubtree(i) == oldBranch) {
           root.RemoveSubtree(i);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs	(revision 6803)
@@ -66,6 +66,14 @@
       MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
 
+      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
+
+      ConfigureGrammarSymbols();
       InitializeOperators();
       UpdateEstimationLimits();
+    }
+
+    private void ConfigureGrammarSymbols() {
+      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
+      if (grammar != null) grammar.ConfigureAsDefaultRegressionGrammar();
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 6803)
@@ -62,6 +62,14 @@
       MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
 
+      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
+
+      ConfigureGrammarSymbols();
       InitializeOperators();
       UpdateEstimationLimits();
+    }
+
+    private void ConfigureGrammarSymbols() {
+      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
+      if (grammar != null) grammar.ConfigureAsDefaultRegressionGrammar();
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs	(revision 6803)
@@ -86,8 +86,8 @@
       if (startNode.GetSubtree(0).Symbol is Addition) {
         var addNode = startNode.GetSubtree(0);
-        if (addNode.SubtreesCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
+        if (addNode.SubtreeCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
           alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode;
           var mulNode = addNode.GetSubtree(0);
-          if (mulNode.SubtreesCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
+          if (mulNode.SubtreeCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
             betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode;
           }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisModel.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisModel.cs	(revision 6803)
@@ -86,8 +86,8 @@
       if (startNode.GetSubtree(0).Symbol is Addition) {
         var addNode = startNode.GetSubtree(0);
-        if (addNode.SubtreesCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
+        if (addNode.SubtreeCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
           alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode;
           var mulNode = addNode.GetSubtree(0);
-          if (mulNode.SubtreesCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
+          if (mulNode.SubtreeCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
             betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode;
           }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 6803)
@@ -93,5 +93,4 @@
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
     <Reference Include="System" />
     <Reference Include="System.Core">
@@ -187,4 +186,8 @@
       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
       <Name>HeuristicLab.Collections-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
+      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
+      <Name>HeuristicLab.Common.Resources-3.3</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 6803)
@@ -95,5 +95,5 @@
           List<ISymbolicExpressionTreeNode> nodeList = Content.Model.SymbolicExpressionTree.Root.GetSubtree(0).IterateNodesPrefix().ToList();
           foreach (var parent in nodeList) {
-            for (int subTreeIndex = 0; subTreeIndex < parent.SubtreesCount; subTreeIndex++) {
+            for (int subTreeIndex = 0; subTreeIndex < parent.SubtreeCount; subTreeIndex++) {
               var child = parent.GetSubtree(subTreeIndex);
               if (!(child.Symbol is Constant) && nodeImpacts[child].IsAlmost(0.0)) {
@@ -105,5 +105,5 @@
 
         // show only interesting part of solution 
-        if (tree.Root.SubtreesCount > 1)
+        if (tree.Root.SubtreeCount > 1)
           this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB + ADFs
         else
@@ -130,5 +130,5 @@
       var tree = Content.Model.SymbolicExpressionTree;
       foreach (SymbolicExpressionTreeNode treeNode in tree.IterateNodesPostfix()) {
-        for (int i = 0; i < treeNode.SubtreesCount; i++) {
+        for (int i = 0; i < treeNode.SubtreeCount; i++) {
           ISymbolicExpressionTreeNode subTree = treeNode.GetSubtree(i);
           // only allow to replace nodes for which a replacement value is known (replacement value for ADF nodes are not available)
@@ -137,5 +137,5 @@
 
             // show only interesting part of solution 
-            if (tree.Root.SubtreesCount > 1)
+            if (tree.Root.SubtreeCount > 1)
               this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB + ADFs
             else
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs	(revision 6803)
@@ -69,4 +69,22 @@
       this.initialFrequencyTextBox.Size = new System.Drawing.Size(280, 20);
       // 
+      // minimumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.minimumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(280, 20);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(280, 20);
+      // 
       // nameTextBox
       // 
@@ -91,6 +109,6 @@
       // minValueTextBox
       // 
-      this.minValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.minValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.errorProvider.SetIconAlignment(this.minValueTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
       this.minValueTextBox.Location = new System.Drawing.Point(92, 19);
@@ -103,11 +121,11 @@
       // initializationGroupBox
       // 
-      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.initializationGroupBox.Controls.Add(this.weightSigmaLabel);
       this.initializationGroupBox.Controls.Add(this.maxValueTextBox);
       this.initializationGroupBox.Controls.Add(this.weightNuLabel);
       this.initializationGroupBox.Controls.Add(this.minValueTextBox);
-      this.initializationGroupBox.Location = new System.Drawing.Point(0, 52);
+      this.initializationGroupBox.Location = new System.Drawing.Point(0, 127);
       this.initializationGroupBox.Name = "initializationGroupBox";
       this.initializationGroupBox.Size = new System.Drawing.Size(398, 73);
@@ -128,6 +146,6 @@
       // maxValueTextBox
       // 
-      this.maxValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.errorProvider.SetIconAlignment(this.maxValueTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
       this.maxValueTextBox.Location = new System.Drawing.Point(92, 45);
@@ -140,11 +158,11 @@
       // mutationGroupBox
       // 
-      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.mutationGroupBox.Controls.Add(this.multiplicativeChangeLabel);
       this.mutationGroupBox.Controls.Add(this.multiplicativeChangeSigmaTextBox);
       this.mutationGroupBox.Controls.Add(this.additiveChangeLabel);
       this.mutationGroupBox.Controls.Add(this.additiveChangeSigmaTextBox);
-      this.mutationGroupBox.Location = new System.Drawing.Point(0, 131);
+      this.mutationGroupBox.Location = new System.Drawing.Point(0, 206);
       this.mutationGroupBox.Name = "mutationGroupBox";
       this.mutationGroupBox.Size = new System.Drawing.Size(398, 73);
@@ -162,10 +180,10 @@
       this.multiplicativeChangeLabel.Text = "Multiplicative change (sigma):";
       this.toolTip.SetToolTip(this.multiplicativeChangeLabel, "The sigma (std. dev.) parameter for the normal distribution to use to sample the " +
-              "multiplicative change.");
+        "multiplicative change.");
       // 
       // multiplicativeChangeSigmaTextBox
       // 
-      this.multiplicativeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.multiplicativeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.errorProvider.SetIconAlignment(this.multiplicativeChangeSigmaTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
       this.multiplicativeChangeSigmaTextBox.Location = new System.Drawing.Point(168, 45);
@@ -174,5 +192,5 @@
       this.multiplicativeChangeSigmaTextBox.TabIndex = 3;
       this.toolTip.SetToolTip(this.multiplicativeChangeSigmaTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample a mu" +
-              "ltiplicative change.");
+        "ltiplicative change.");
       this.multiplicativeChangeSigmaTextBox.TextChanged += new System.EventHandler(this.multiplicativeChangeSigmaTextBox_TextChanged);
       // 
@@ -186,10 +204,10 @@
       this.additiveChangeLabel.Text = "Additive change (sigma):";
       this.toolTip.SetToolTip(this.additiveChangeLabel, "The sigma (std. dev.) parameter for the normal distribution to sample the additiv" +
-              "e change.");
+        "e change.");
       // 
       // additiveChangeSigmaTextBox
       // 
-      this.additiveChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.additiveChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.errorProvider.SetIconAlignment(this.additiveChangeSigmaTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
       this.additiveChangeSigmaTextBox.Location = new System.Drawing.Point(168, 19);
@@ -198,5 +216,5 @@
       this.additiveChangeSigmaTextBox.TabIndex = 1;
       this.toolTip.SetToolTip(this.additiveChangeSigmaTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample an a" +
-              "dditive change.");
+        "dditive change.");
       this.additiveChangeSigmaTextBox.TextChanged += new System.EventHandler(this.additiveChangeSigmaTextBox_TextChanged);
       // 
@@ -208,5 +226,9 @@
       this.Controls.Add(this.initializationGroupBox);
       this.Name = "ConstantView";
-      this.Size = new System.Drawing.Size(398, 211);
+      this.Size = new System.Drawing.Size(398, 284);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
       this.Controls.SetChildIndex(this.infoLabel, 0);
       this.Controls.SetChildIndex(this.initializationGroupBox, 0);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs	(revision 6803)
@@ -64,5 +64,5 @@
       // 
       this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
-              "al weights.");
+        "al weights.");
       // 
       // initializationGroupBox
@@ -78,5 +78,5 @@
       // 
       this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
-              "weights.");
+        "weights.");
       // 
       // mutationGroupBox
@@ -88,24 +88,24 @@
       // 
       this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
-              " change in weight.");
+        " change in weight.");
       // 
       // multiplicativeWeightChangeSigmaTextBox
       // 
       this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
-              "tive change in weight.");
+        "tive change in weight.");
       // 
       // additiveWeightChangeLabel
       // 
       this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
-              "change in weight.");
+        "change in weight.");
       // 
       // additiveWeightChangeSigmaTextBox
       // 
       this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
-              "change in weight.");
+        "change in weight.");
       // 
       // variableNamesTabPage
       // 
-      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 164);
+      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 149);
       // 
       // parametersTabPage
@@ -115,6 +115,6 @@
       // tabControl
       // 
-      this.tabControl.Location = new System.Drawing.Point(0, 104);
-      this.tabControl.Size = new System.Drawing.Size(408, 190);
+      this.tabControl.Location = new System.Drawing.Point(0, 179);
+      this.tabControl.Size = new System.Drawing.Size(408, 175);
       this.tabControl.TabIndex = 9;
       // 
@@ -126,4 +126,22 @@
       // 
       this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      // 
+      // minimumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.minimumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(315, 20);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(315, 20);
       // 
       // nameTextBox
@@ -135,5 +153,5 @@
       // 
       this.minTimeOffsetLabel.AutoSize = true;
-      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 55);
+      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 130);
       this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
       this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
@@ -144,5 +162,5 @@
       // 
       this.maxTimeOffsetLabel.AutoSize = true;
-      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 81);
+      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 156);
       this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
       this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13);
@@ -152,5 +170,5 @@
       // minTimeOffsetTextBox
       // 
-      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 52);
+      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 127);
       this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
       this.minTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
@@ -160,5 +178,5 @@
       // maxTimeOffsetTextBox
       // 
-      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 78);
+      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 153);
       this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
       this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
@@ -171,13 +189,17 @@
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.Controls.Add(this.minTimeOffsetTextBox);
+      this.Controls.Add(this.maxTimeOffsetLabel);
       this.Controls.Add(this.minTimeOffsetLabel);
-      this.Controls.Add(this.maxTimeOffsetLabel);
       this.Controls.Add(this.maxTimeOffsetTextBox);
       this.Name = "LaggedVariableView";
-      this.Size = new System.Drawing.Size(408, 292);
+      this.Size = new System.Drawing.Size(408, 352);
       this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0);
+      this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0);
       this.Controls.SetChildIndex(this.maxTimeOffsetLabel, 0);
-      this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0);
       this.Controls.SetChildIndex(this.minTimeOffsetTextBox, 0);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
       this.Controls.SetChildIndex(this.infoLabel, 0);
       this.Controls.SetChildIndex(this.tabControl, 0);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs	(revision 6803)
@@ -62,4 +62,20 @@
       this.initialFrequencyTextBox.Size = new System.Drawing.Size(315, 20);
       // 
+      // minimumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.minimumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      // 
       // nameTextBox
       // 
@@ -75,5 +91,5 @@
       // 
       this.minTimeOffsetLabel.AutoSize = true;
-      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 55);
+      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 130);
       this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
       this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
@@ -84,5 +100,5 @@
       // 
       this.maxTimeOffsetLabel.AutoSize = true;
-      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 81);
+      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 156);
       this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
       this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13);
@@ -92,5 +108,5 @@
       // minTimeOffsetTextBox
       // 
-      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 52);
+      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 127);
       this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
       this.minTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
@@ -100,5 +116,5 @@
       // maxTimeOffsetTextBox
       // 
-      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 78);
+      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 153);
       this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
       this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
@@ -115,5 +131,9 @@
       this.Controls.Add(this.minTimeOffsetLabel);
       this.Name = "LaggedSymbolView";
-      this.Size = new System.Drawing.Size(408, 104);
+      this.Size = new System.Drawing.Size(408, 179);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
       this.Controls.SetChildIndex(this.infoLabel, 0);
       this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs	(revision 6803)
@@ -78,4 +78,20 @@
       this.initialFrequencyTextBox.Size = new System.Drawing.Size(233, 20);
       // 
+      // minimumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.minimumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      // 
       // nameTextBox
       // 
@@ -96,6 +112,6 @@
       // thresholdInitializationMuTextBox
       // 
-      this.thresholdInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.thresholdInitializationMuTextBox.Location = new System.Drawing.Point(114, 15);
       this.thresholdInitializationMuTextBox.Name = "thresholdInitializationMuTextBox";
@@ -103,11 +119,11 @@
       this.thresholdInitializationMuTextBox.TabIndex = 1;
       this.toolTip.SetToolTip(this.thresholdInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
-              "al thresholds.");
+        "al thresholds.");
       this.thresholdInitializationMuTextBox.TextChanged += new System.EventHandler(this.thresholdMuTextBox_TextChanged);
       // 
       // initializationGroupBox
       // 
-      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.initializationGroupBox.Controls.Add(this.slopeInitializationSigmaLabel);
       this.initializationGroupBox.Controls.Add(this.slopeInitializationSigmaTextBox);
@@ -118,5 +134,5 @@
       this.initializationGroupBox.Controls.Add(this.thresholdInitializationMuLabel);
       this.initializationGroupBox.Controls.Add(this.thresholdInitializationMuTextBox);
-      this.initializationGroupBox.Location = new System.Drawing.Point(0, 52);
+      this.initializationGroupBox.Location = new System.Drawing.Point(0, 127);
       this.initializationGroupBox.Name = "initializationGroupBox";
       this.initializationGroupBox.Size = new System.Drawing.Size(326, 127);
@@ -137,6 +153,6 @@
       // slopeInitializationSigmaTextBox
       // 
-      this.slopeInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.slopeInitializationSigmaTextBox.Location = new System.Drawing.Point(114, 102);
       this.slopeInitializationSigmaTextBox.Name = "slopeInitializationSigmaTextBox";
@@ -144,5 +160,5 @@
       this.slopeInitializationSigmaTextBox.TabIndex = 7;
       this.toolTip.SetToolTip(this.slopeInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
-              "slopes.");
+        "slopes.");
       this.slopeInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.slopeInitializationSigmaTextBox_TextChanged);
       // 
@@ -159,6 +175,6 @@
       // slopeInitializationMuTextBox
       // 
-      this.slopeInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.slopeInitializationMuTextBox.Location = new System.Drawing.Point(114, 76);
       this.slopeInitializationMuTextBox.Name = "slopeInitializationMuTextBox";
@@ -166,5 +182,5 @@
       this.slopeInitializationMuTextBox.TabIndex = 5;
       this.toolTip.SetToolTip(this.slopeInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
-              "al slopes.");
+        "al slopes.");
       this.slopeInitializationMuTextBox.TextChanged += new System.EventHandler(this.slopeInitializationMuTextBox_TextChanged);
       // 
@@ -181,6 +197,6 @@
       // thresholdInitializationSigmaTextBox
       // 
-      this.thresholdInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.thresholdInitializationSigmaTextBox.Location = new System.Drawing.Point(114, 41);
       this.thresholdInitializationSigmaTextBox.Name = "thresholdInitializationSigmaTextBox";
@@ -188,11 +204,11 @@
       this.thresholdInitializationSigmaTextBox.TabIndex = 3;
       this.toolTip.SetToolTip(this.thresholdInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
-              "thresholds.");
+        "thresholds.");
       this.thresholdInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.thresholdInitializationSigmaTextBox_TextChanged);
       // 
       // mutationGroupBox
       // 
-      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.mutationGroupBox.Controls.Add(this.slopeChangeSigmaLabel);
       this.mutationGroupBox.Controls.Add(this.slopeChangeSigmaTextBox);
@@ -203,5 +219,5 @@
       this.mutationGroupBox.Controls.Add(this.ThresholdChangeMuLabel);
       this.mutationGroupBox.Controls.Add(this.thresholdChangeMuTextBox);
-      this.mutationGroupBox.Location = new System.Drawing.Point(0, 185);
+      this.mutationGroupBox.Location = new System.Drawing.Point(0, 260);
       this.mutationGroupBox.Name = "mutationGroupBox";
       this.mutationGroupBox.Size = new System.Drawing.Size(326, 127);
@@ -219,10 +235,10 @@
       this.slopeChangeSigmaLabel.Text = "Slope change (sigma):";
       this.toolTip.SetToolTip(this.slopeChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in sl" +
-              "ope.");
+        "ope.");
       // 
       // slopeChangeSigmaTextBox
       // 
-      this.slopeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.slopeChangeSigmaTextBox.Location = new System.Drawing.Point(149, 99);
       this.slopeChangeSigmaTextBox.Name = "slopeChangeSigmaTextBox";
@@ -230,5 +246,5 @@
       this.slopeChangeSigmaTextBox.TabIndex = 7;
       this.toolTip.SetToolTip(this.slopeChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in sl" +
-              "ope.");
+        "ope.");
       this.slopeChangeSigmaTextBox.TextChanged += new System.EventHandler(this.slopeChangeSigmaTextBox_TextChanged);
       // 
@@ -242,10 +258,10 @@
       this.slopeChangeMuLabel.Text = "Slope change (mu):";
       this.toolTip.SetToolTip(this.slopeChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in slope" +
-              ".");
+        ".");
       // 
       // slopeChangeMuTextBox
       // 
-      this.slopeChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.slopeChangeMuTextBox.Location = new System.Drawing.Point(149, 73);
       this.slopeChangeMuTextBox.Name = "slopeChangeMuTextBox";
@@ -253,5 +269,5 @@
       this.slopeChangeMuTextBox.TabIndex = 5;
       this.toolTip.SetToolTip(this.slopeChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in slope" +
-              ".");
+        ".");
       this.slopeChangeMuTextBox.TextChanged += new System.EventHandler(this.slopeChangeMuTextBox_TextChanged);
       // 
@@ -265,10 +281,10 @@
       this.thresholdChangeSigmaLabel.Text = "Threshold change (sigma):";
       this.toolTip.SetToolTip(this.thresholdChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in th" +
-              "reshold.");
+        "reshold.");
       // 
       // thresholdChangeSigmaTextBox
       // 
-      this.thresholdChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.thresholdChangeSigmaTextBox.Location = new System.Drawing.Point(149, 41);
       this.thresholdChangeSigmaTextBox.Name = "thresholdChangeSigmaTextBox";
@@ -276,5 +292,5 @@
       this.thresholdChangeSigmaTextBox.TabIndex = 3;
       this.toolTip.SetToolTip(this.thresholdChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in th" +
-              "reshold.");
+        "reshold.");
       this.thresholdChangeSigmaTextBox.TextChanged += new System.EventHandler(this.thresholdChangeSigmaTextBox_TextChanged);
       // 
@@ -288,10 +304,10 @@
       this.ThresholdChangeMuLabel.Text = "Threshold change (mu):";
       this.toolTip.SetToolTip(this.ThresholdChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in thres" +
-              "hold.");
+        "hold.");
       // 
       // thresholdChangeMuTextBox
       // 
-      this.thresholdChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.thresholdChangeMuTextBox.Location = new System.Drawing.Point(149, 15);
       this.thresholdChangeMuTextBox.Name = "thresholdChangeMuTextBox";
@@ -299,5 +315,5 @@
       this.thresholdChangeMuTextBox.TabIndex = 1;
       this.toolTip.SetToolTip(this.thresholdChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in thres" +
-              "hold.");
+        "hold.");
       this.thresholdChangeMuTextBox.TextChanged += new System.EventHandler(this.thresholdChangeMuTextBox_TextChanged);
       // 
@@ -309,5 +325,9 @@
       this.Controls.Add(this.initializationGroupBox);
       this.Name = "VariableConditionView";
-      this.Size = new System.Drawing.Size(326, 315);
+      this.Size = new System.Drawing.Size(326, 376);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
       this.Controls.SetChildIndex(this.infoLabel, 0);
       this.Controls.SetChildIndex(this.initializationGroupBox, 0);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs	(revision 6803)
@@ -72,5 +72,23 @@
       // 
       this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
-      this.initialFrequencyTextBox.Size = new System.Drawing.Size(315, 20);
+      this.initialFrequencyTextBox.Size = new System.Drawing.Size(311, 20);
+      // 
+      // minimumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.minimumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(311, 20);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(311, 20);
       // 
       // nameTextBox
@@ -96,6 +114,6 @@
       // weightInitializationMuTextBox
       // 
-      this.weightInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.weightInitializationMuTextBox.Location = new System.Drawing.Point(92, 19);
       this.weightInitializationMuTextBox.Name = "weightInitializationMuTextBox";
@@ -103,11 +121,11 @@
       this.weightInitializationMuTextBox.TabIndex = 1;
       this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
-              "al weights.");
+        "al weights.");
       this.weightInitializationMuTextBox.TextChanged += new System.EventHandler(this.weightMuTextBox_TextChanged);
       // 
       // initializationGroupBox
       // 
-      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.initializationGroupBox.Controls.Add(this.weightSigmaLabel);
       this.initializationGroupBox.Controls.Add(this.weightInitializationSigmaTextBox);
@@ -133,6 +151,6 @@
       // weightInitializationSigmaTextBox
       // 
-      this.weightInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.weightInitializationSigmaTextBox.Location = new System.Drawing.Point(92, 45);
       this.weightInitializationSigmaTextBox.Name = "weightInitializationSigmaTextBox";
@@ -140,11 +158,11 @@
       this.weightInitializationSigmaTextBox.TabIndex = 3;
       this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
-              "weights.");
+        "weights.");
       this.weightInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.weightSigmaTextBox_TextChanged);
       // 
       // mutationGroupBox
       // 
-      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeLabel);
       this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeSigmaTextBox);
@@ -167,10 +185,10 @@
       this.multiplicativeWeightChangeLabel.Text = "Multiplicative weight change (sigma):";
       this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
-              " change in weight.");
+        " change in weight.");
       // 
       // multiplicativeWeightChangeSigmaTextBox
       // 
-      this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 45);
       this.multiplicativeWeightChangeSigmaTextBox.Name = "multiplicativeWeightChangeSigmaTextBox";
@@ -178,5 +196,5 @@
       this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 3;
       this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
-              "tive change in weight.");
+        "tive change in weight.");
       this.multiplicativeWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.multiplicativeWeightChangeSigmaTextBox_TextChanged);
       // 
@@ -190,10 +208,10 @@
       this.additiveWeightChangeLabel.Text = "Additive weight change (sigma):";
       this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
-              "change in weight.");
+        "change in weight.");
       // 
       // additiveWeightChangeSigmaTextBox
       // 
-      this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 19);
       this.additiveWeightChangeSigmaTextBox.Name = "additiveWeightChangeSigmaTextBox";
@@ -201,18 +219,18 @@
       this.additiveWeightChangeSigmaTextBox.TabIndex = 1;
       this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
-              "change in weight.");
+        "change in weight.");
       this.additiveWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.additiveWeightChangeSigmaTextBox_TextChanged);
       // 
       // tabControl
       // 
-      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.tabControl.Controls.Add(this.variableNamesTabPage);
       this.tabControl.Controls.Add(this.parametersTabPage);
-      this.tabControl.Location = new System.Drawing.Point(0, 52);
+      this.tabControl.Location = new System.Drawing.Point(0, 127);
       this.tabControl.Name = "tabControl";
       this.tabControl.SelectedIndex = 0;
-      this.tabControl.Size = new System.Drawing.Size(408, 242);
+      this.tabControl.Size = new System.Drawing.Size(408, 167);
       this.tabControl.TabIndex = 5;
       // 
@@ -222,5 +240,5 @@
       this.variableNamesTabPage.Name = "variableNamesTabPage";
       this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 216);
+      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 141);
       this.variableNamesTabPage.TabIndex = 0;
       this.variableNamesTabPage.Text = "Variable Names";
@@ -246,4 +264,8 @@
       this.Name = "VariableView";
       this.Size = new System.Drawing.Size(408, 294);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
       this.Controls.SetChildIndex(this.infoLabel, 0);
       this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs	(revision 6803)
@@ -87,5 +87,4 @@
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      variableNamesView.Content.Clear();
       UpdateControl();
     }
@@ -126,7 +125,7 @@
     private void UpdateContent() {
       if (Content != null) {
-        Content.Changed -= new EventHandler(Content_Changed);
+        DeregisterContentEvents();
         Content.VariableNames = variableNamesView.Content.CheckedItems.Select(x => x.Value).ToList();
-        Content.Changed += new EventHandler(Content_Changed);
+        RegisterContentEvents();
       }
     }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs	(revision 6803)
@@ -85,5 +85,5 @@
       StringBuilder builder = new StringBuilder();
       builder.Append("(" + tree.ToString());
-      for (int i = 0; i < tree.SubtreesCount; i++) {
+      for (int i = 0; i < tree.SubtreeCount; i++) {
         builder.Append(" " + GetTextualRepresentationFromSubtreeOfDepth(tree.GetSubtree(i), d - 1));
       }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs	(revision 6803)
@@ -73,5 +73,5 @@
       FormatBegin(node, strBuilder);
 
-      if (node.SubtreesCount > 0) {
+      if (node.SubtreeCount > 0) {
         strBuilder.Append(FormatRecursively(node.GetSubtree(0)));
       }
@@ -91,5 +91,5 @@
         strBuilder.Append(@" \left( ");
       } else if (node.Symbol is Subtraction) {
-        if (node.SubtreesCount == 1) {
+        if (node.SubtreeCount == 1) {
           strBuilder.Append(@"- \left(");
         } else {
@@ -98,5 +98,5 @@
       } else if (node.Symbol is Multiplication) {
       } else if (node.Symbol is Division) {
-        if (node.SubtreesCount == 1) {
+        if (node.SubtreeCount == 1) {
           strBuilder.Append(@" \cfrac{1}{");
         } else {
@@ -105,6 +105,6 @@
       } else if (node.Symbol is Average) {
         // skip output of (1/1) if only one subtree
-        if (node.SubtreesCount > 1) {
-          strBuilder.Append(@" \cfrac{1}{" + node.SubtreesCount + @"}");
+        if (node.SubtreeCount > 1) {
+          strBuilder.Append(@" \cfrac{1}{" + node.SubtreeCount + @"}");
         }
         strBuilder.Append(@" \left(");
@@ -246,7 +246,7 @@
       } else if (node.Symbol is Division) {
         strBuilder.Append("} ");
-        if (node.SubtreesCount > 1)
+        if (node.SubtreeCount > 1)
           strBuilder.Append("{1} ");
-        for (int i = 1; i < node.SubtreesCount; i++) {
+        for (int i = 1; i < node.SubtreeCount; i++) {
           strBuilder.Append(" } ");
         }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs	(revision 6803)
@@ -106,5 +106,5 @@
 
       if (symbol is Addition) {
-        for (int i = 0; i < node.SubtreesCount; i++) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("+");
           stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
@@ -112,5 +112,5 @@
       } else if (symbol is And) {
         stringBuilder.Append("((");
-        for (int i = 0; i < node.SubtreesCount; i++) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("&");
           stringBuilder.Append("((");
@@ -121,7 +121,7 @@
       } else if (symbol is Average) {
         stringBuilder.Append("(1/");
-        stringBuilder.Append(node.SubtreesCount);
+        stringBuilder.Append(node.SubtreeCount);
         stringBuilder.Append(")*(");
-        for (int i = 0; i < node.SubtreesCount; i++) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("+");
           stringBuilder.Append("(");
@@ -138,5 +138,5 @@
         stringBuilder.Append(")");
       } else if (symbol is Division) {
-        if (node.SubtreesCount == 1) {
+        if (node.SubtreeCount == 1) {
           stringBuilder.Append("1/");
           stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
@@ -144,5 +144,5 @@
           stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
           stringBuilder.Append("/(");
-          for (int i = 1; i < node.SubtreesCount; i++) {
+          for (int i = 1; i < node.SubtreeCount; i++) {
             if (i > 1) stringBuilder.Append("*");
             stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
@@ -187,5 +187,5 @@
         stringBuilder.Append(")");
       } else if (symbol is Multiplication) {
-        for (int i = 0; i < node.SubtreesCount; i++) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("*");
           stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
@@ -197,5 +197,5 @@
       } else if (symbol is Or) {
         stringBuilder.Append("((");
-        for (int i = 0; i < node.SubtreesCount; i++) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("|");
           stringBuilder.Append("((");
@@ -209,10 +209,10 @@
         stringBuilder.Append(")");
       } else if (symbol is Subtraction) {
-        if (node.SubtreesCount == 1) {
+        if (node.SubtreeCount == 1) {
           stringBuilder.Append("-1*");
           stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
         } else {
           stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
-          for (int i = 1; i < node.SubtreesCount; i++) {
+          for (int i = 1; i < node.SubtreeCount; i++) {
             stringBuilder.Append("-");
             stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 6803)
@@ -25,6 +25,8 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [NonDiscoverableType]
   [StorableClass]
   [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")]
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 6803)
@@ -30,4 +30,15 @@
   [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 : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+    private const string ArithmeticFunctionsName = "Arithmetic Functions";
+    private const string TrigonometricFunctionsName = "Trigonometric Functions";
+    private const string ExponentialFunctionsName = "Exponential and Logarithmic Functions";
+    private const string RealValuedSymbolsName = "Real Valued Symbols";
+    private const string TerminalsName = "Terminals";
+    private const string PowerFunctionsName = "Power Functions";
+    private const string ConditionsName = "Conditions";
+    private const string ComparisonsName = "Comparisons";
+    private const string BooleanOperatorsName = "Boolean Operators";
+    private const string ConditionalSymbolsName = "ConditionalSymbols";
+    private const string TimeSeriesSymbolsName = "Time Series Symbols";
 
     [StorableConstructor]
@@ -43,4 +54,5 @@
 
     private void Initialize() {
+      #region symbol declaration
       var add = new Addition();
       var sub = new Subtraction();
@@ -53,7 +65,5 @@
       var log = new Logarithm();
       var pow = new Power();
-      pow.InitialFrequency = 0.0;
       var root = new Root();
-      root.InitialFrequency = 0.0;
       var exp = new Exponential();
       var @if = new IfThenElse();
@@ -63,118 +73,122 @@
       var or = new Or();
       var not = new Not();
+      var variableCondition = new VariableCondition();
 
       var timeLag = new TimeLag();
-      timeLag.InitialFrequency = 0.0;
       var integral = new Integral();
-      integral.InitialFrequency = 0.0;
       var derivative = new Derivative();
-      derivative.InitialFrequency = 0.0;
-      var variableCondition = new VariableCondition();
-      variableCondition.InitialFrequency = 0.0;
 
       var constant = new Constant();
       constant.MinValue = -20;
       constant.MaxValue = 20;
-      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
+      var variableSymbol = new Variable();
       var laggedVariable = new LaggedVariable();
+      #endregion
 
-      laggedVariable.InitialFrequency = 0.0;
-      mean.InitialFrequency = 0.0;
+      #region group symbol declaration
+      var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean });
+      var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan });
+      var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log });
+      var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol });
+      var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, terminalSymbols });
 
-      /*
-       * Start = RealValueExpression
-       * 
-       * RealValueExpression = 
-       *   "Variable"  |
-       *   "Constant" | 
-       *   BinaryOperator RealValueExpression RealValueExpression |
-       *   UnaryOperator RealValueExpression | 
-       *   "IF" BooleanExpression RealValueExpression RealValueExpression | 
-       *   "VariableCondition" RealValueExpression RealValueExpression
-       * 
-       * BinaryOperator = 
-       *   "+" | "-" | "*" | "/" | "Power"
-       * 
-       * UnaryOperator = 
-       *   "Sin" | "Cos" | "Tan" | "Log" | "Exp"
-       * 
-       * BooleanExpression = 
-       *   "AND" BooleanExpression BooleanExpression |
-       *   "OR" BooleanExpression BooleanExpression |
-       *   "NOT" BooleanExpression |
-       *   ">" RealValueExpression RealValueExpression |
-       *   "<" RealValueExpression RealValueExpression
-       */
+      var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { pow, root });
 
-      var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable, variableCondition };
+      var conditionSymbols = new GroupSymbol(ConditionsName, new List<ISymbol> { @if, variableCondition });
+      var comparisonSymbols = new GroupSymbol(ComparisonsName, new List<ISymbol> { gt, lt });
+      var booleanOperationSymbols = new GroupSymbol(BooleanOperatorsName, new List<ISymbol> { and, or, not });
+      var conditionalSymbols = new GroupSymbol(ConditionalSymbolsName, new List<ISymbol> { conditionSymbols, comparisonSymbols, booleanOperationSymbols });
 
-      var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, timeLag, integral, derivative };
-      var binaryFunctionSymbols = new List<Symbol>() { add, sub, mul, div, mean, pow, root, variableCondition };
+      var timeSeriesSymbols = new GroupSymbol(TimeSeriesSymbolsName, new List<ISymbol> { timeLag, integral, derivative, laggedVariable });
+      #endregion
 
-      var unaryBooleanFunctionSymbols = new List<Symbol>() { not };
-      var binaryBooleanFunctionSymbols = new List<Symbol>() { or, and };
-      var relationalFunctionSymbols = new List<Symbol>() { gt, lt };
-      var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable };
-      var realValuedSymbols = unaryFunctionSymbols.Concat(binaryFunctionSymbols).Concat(terminalSymbols).Concat(new List<Symbol>() { @if });
-      var booleanSymbols = unaryBooleanFunctionSymbols.Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols);
+      AddSymbol(realValuedSymbols);
+      AddSymbol(powerSymbols);
+      AddSymbol(conditionalSymbols);
+      AddSymbol(timeSeriesSymbols);
 
-      foreach (var symb in allSymbols)
-        AddSymbol(symb);
-
-      foreach (var unaryFun in unaryFunctionSymbols.Concat(unaryBooleanFunctionSymbols)) {
-        SetSubtreeCount(unaryFun, 1, 1);
-      }
-      foreach (var binaryFun in binaryFunctionSymbols.Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols)) {
-        SetSubtreeCount(binaryFun, 2, 2);
-      }
-
-      foreach (var terminalSymbol in terminalSymbols) {
-        SetSubtreeCount(terminalSymbol, 0, 0);
-      }
+      #region subtree count configuration
+      SetSubtreeCount(arithmeticSymbols, 2, 2);
+      SetSubtreeCount(trigonometricSymbols, 1, 1);
+      SetSubtreeCount(powerSymbols, 2, 2);
+      SetSubtreeCount(exponentialAndLogarithmicSymbols, 1, 1);
+      SetSubtreeCount(terminalSymbols, 0, 0);
 
       SetSubtreeCount(@if, 3, 3);
+      SetSubtreeCount(variableCondition, 2, 2);
+      SetSubtreeCount(comparisonSymbols, 2, 2);
+      SetSubtreeCount(and, 2, 2);
+      SetSubtreeCount(or, 2, 2);
+      SetSubtreeCount(not, 1, 1);
+
+      SetSubtreeCount(timeLag, 1, 1);
+      SetSubtreeCount(integral, 1, 1);
+      SetSubtreeCount(derivative, 1, 1);
+      SetSubtreeCount(laggedVariable, 0, 0);
+      #endregion
+
+      #region alloed child symbols configuration
+      AddAllowedChildSymbol(StartSymbol, realValuedSymbols);
+      AddAllowedChildSymbol(DefunSymbol, realValuedSymbols);
+
+      AddAllowedChildSymbol(realValuedSymbols, realValuedSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, powerSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, conditionSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, timeSeriesSymbols);
+
+      AddAllowedChildSymbol(powerSymbols, variableSymbol, 0);
+      AddAllowedChildSymbol(powerSymbols, constant, 1);
+
+      AddAllowedChildSymbol(@if, comparisonSymbols, 0);
+      AddAllowedChildSymbol(@if, booleanOperationSymbols, 0);
+      AddAllowedChildSymbol(@if, conditionSymbols, 1);
+      AddAllowedChildSymbol(@if, realValuedSymbols, 1);
+      AddAllowedChildSymbol(@if, powerSymbols, 1);
+      AddAllowedChildSymbol(@if, timeSeriesSymbols, 1);
+      AddAllowedChildSymbol(@if, conditionSymbols, 2);
+      AddAllowedChildSymbol(@if, realValuedSymbols, 2);
+      AddAllowedChildSymbol(@if, powerSymbols, 2);
+      AddAllowedChildSymbol(@if, timeSeriesSymbols, 2);
+
+      AddAllowedChildSymbol(booleanOperationSymbols, comparisonSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, realValuedSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, powerSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, conditionSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, timeSeriesSymbols);
+
+      AddAllowedChildSymbol(variableCondition, realValuedSymbols);
+      AddAllowedChildSymbol(variableCondition, powerSymbols);
+      AddAllowedChildSymbol(variableCondition, conditionSymbols);
+      AddAllowedChildSymbol(variableCondition, timeSeriesSymbols);
 
 
-      // allow only real-valued expressions as child of the start symbol
-      foreach (var symb in realValuedSymbols) {
-        AddAllowedChildSymbol(StartSymbol, symb);
-        AddAllowedChildSymbol(DefunSymbol, symb);
-      }
+      AddAllowedChildSymbol(timeLag, realValuedSymbols);
+      AddAllowedChildSymbol(timeLag, powerSymbols);
+      AddAllowedChildSymbol(timeLag, conditionSymbols);
 
-      foreach (var symb in unaryFunctionSymbols) {
-        foreach (var childSymb in realValuedSymbols) {
-          AddAllowedChildSymbol(symb, childSymb);
-        }
-      }
+      AddAllowedChildSymbol(integral, realValuedSymbols);
+      AddAllowedChildSymbol(integral, powerSymbols);
+      AddAllowedChildSymbol(integral, conditionSymbols);
 
-      foreach (var symb in binaryFunctionSymbols) {
-        foreach (var childSymb in realValuedSymbols) {
-          AddAllowedChildSymbol(symb, childSymb);
-        }
-      }
+      AddAllowedChildSymbol(derivative, realValuedSymbols);
+      AddAllowedChildSymbol(derivative, powerSymbols);
+      AddAllowedChildSymbol(derivative, conditionSymbols);
+      #endregion
+    }
 
-      foreach (var childSymb in booleanSymbols) {
-        AddAllowedChildSymbol(@if, childSymb, 0);
-      }
-      foreach (var childSymb in realValuedSymbols) {
-        AddAllowedChildSymbol(@if, childSymb, 1);
-        AddAllowedChildSymbol(@if, childSymb, 2);
-      }
+    public void ConfigureAsDefaultRegressionGrammar() {
+      Symbols.Where(s => s is Average).First().Enabled = false;
+      Symbols.Where(s => s.Name == TrigonometricFunctionsName).First().Enabled = false;
+      Symbols.Where(s => s.Name == PowerFunctionsName).First().Enabled = false;
+      Symbols.Where(s => s.Name == ConditionalSymbolsName).First().Enabled = false;
+      Symbols.Where(s => s.Name == TimeSeriesSymbolsName).First().Enabled = false;
+    }
 
-      foreach (var symb in relationalFunctionSymbols) {
-        foreach (var childSymb in realValuedSymbols) {
-          AddAllowedChildSymbol(symb, childSymb);
-        }
-      }
-      foreach (var symb in binaryBooleanFunctionSymbols) {
-        foreach (var childSymb in booleanSymbols) {
-          AddAllowedChildSymbol(symb, childSymb);
-        }
-      }
-      foreach (var symb in unaryBooleanFunctionSymbols) {
-        foreach (var childSymb in booleanSymbols) {
-          AddAllowedChildSymbol(symb, childSymb);
-        }
-      }
+    public void ConfigureAsDefaultClassificationGrammar() {
+      Symbols.Where(s => s is Average).First().Enabled = false;
+      Symbols.Where(s => s.Name == TrigonometricFunctionsName).First().Enabled = false;
+      Symbols.Where(s => s.Name == ExponentialFunctionsName).First().Enabled = false;
+      Symbols.Where(s => s.Name == PowerFunctionsName).First().Enabled = false;
+      Symbols.Where(s => s.Name == TimeSeriesSymbolsName).First().Enabled = false;
     }
   }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs	(revision 6803)
@@ -64,5 +64,5 @@
     private ISymbolicExpressionTreeNode MacroExpand(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode node, IList<ISymbolicExpressionTreeNode> argumentTrees) {
       List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(node.Subtrees);
-      while (node.SubtreesCount > 0) node.RemoveSubtree(0);
+      while (node.SubtreeCount > 0) node.RemoveSubtree(0);
       if (node.Symbol is InvokeFunction) {
         var invokeSym = node.Symbol as InvokeFunction;
@@ -893,5 +893,5 @@
         // x0 * x1 * .. * xn * -1 => x0 * x1 * .. * -xn
         var lastSubTree = x.Subtrees.Last();
-        x.RemoveSubtree(x.SubtreesCount - 1);
+        x.RemoveSubtree(x.SubtreeCount - 1);
         x.AddSubtree(Negate(lastSubTree)); // last is maybe a constant, prefer to negate the constant
       } else {
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 6803)
@@ -190,8 +190,8 @@
       SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;
       foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) {
-        varSymbol.VariableNames = ProblemData.AllowedInputVariables;
+        if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables;
       }
       foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableCondition>()) {
-        varSymbol.VariableNames = ProblemData.AllowedInputVariables;
+        if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables;
       }
     }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Addition.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Addition.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Addition.cs	(revision 6803)
@@ -22,10 +22,20 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableClass]
   [Item("Addition", "Symbol that represents the + operator.")]
   public sealed class Addition : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Addition(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/And.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/And.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/And.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("And", "Symbol that represents the boolean AND operator.")]
   public sealed class And : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private And(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Average.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Average.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Average.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Average", "Symbol that represents the average (arithmetic mean) function.")]
   public sealed class Average : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Average(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs	(revision 6803)
@@ -88,5 +88,15 @@
     }
 
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
     #endregion
+
     [StorableConstructor]
     private Constant(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Cosine.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Cosine.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Cosine.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Cosine", "Symbol that represents the cosine function.")]
   public sealed class Cosine : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Cosine(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Derivative.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Derivative.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Derivative.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Derivative", "Represents the derivative over the specified subtree.")]
   public sealed class Derivative : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Derivative(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Division.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Division.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Division.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Division", "Symbol that represents the / operator.")]
   public sealed class Division : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Division(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Exponential.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Exponential.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Exponential.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Exponential", "Symbol that represents the exponential function.")]
   public sealed class Exponential : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Exponential(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/GreaterThan.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/GreaterThan.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/GreaterThan.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("GreaterThan", "Symbol that represents a greater than relation.")]
   public sealed class GreaterThan : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private GreaterThan(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/IfThenElse.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/IfThenElse.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/IfThenElse.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("IfThenElse", "Symbol that represents a conditional operator.")]
   public sealed class IfThenElse : Symbol {
+    private const int minimumArity = 3;
+    private const int maximumArity = 3;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private IfThenElse(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Integral.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Integral.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Integral.cs	(revision 6803)
@@ -27,4 +27,14 @@
   [Item("Integral", "Represents the integral over the specified subtree.")]
   public sealed class Integral : LaggedSymbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Integral(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LessThan.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LessThan.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LessThan.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("LessThan", "Symbol that represents a less than relation.")]
   public sealed class LessThan : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private LessThan(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Logarithm.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Logarithm.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Logarithm.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Logarithm", "Symbol that represents the logarithm function.")]
   public sealed class Logarithm : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Logarithm(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Multiplication.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Multiplication.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Multiplication.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Multiplication", "Symbol that represents the * operator.")]
   public sealed class Multiplication : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Multiplication(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Not.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Not.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Not.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Not", "Symbol that represents the boolean NOT operator.")]
   public sealed class Not : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Not(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Or.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Or.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Or.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Or", "Symbol that represents the boolean OR operator.")]
   public sealed class Or : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Or(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Power.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Power.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Power.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Power", "Symbol that represents the power function.")]
   public sealed class Power : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Power(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Root.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Root.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Root.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Root", "Symbol that represents the n-th root function.")]
   public sealed class Root : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Root(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sine.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sine.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sine.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Sine", "Symbol that represents the sine function.")]
   public sealed class Sine : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Sine(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Subtraction.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Subtraction.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Subtraction.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Subtraction", "Symbol that represents the - operator.")]
   public sealed class Subtraction : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Subtraction(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Tangent.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Tangent.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Tangent.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("Tangent", "Symbol that represents the tangent trigonometric function.")]
   public sealed class Tangent : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private Tangent(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/TimeLag.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/TimeLag.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/TimeLag.cs	(revision 6803)
@@ -28,4 +28,14 @@
   [Item("TimeLag", "Represents a symblol whose evaluation is shifted.")]
   public sealed class TimeLag : LaggedSymbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
     [StorableConstructor]
     private TimeLag(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs	(revision 6803)
@@ -100,5 +100,16 @@
       }
     }
+
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
     #endregion
+
     [StorableConstructor]
     protected Variable(bool deserializing)
@@ -126,4 +137,15 @@
     }
 
+    protected override void OnChanged(EventArgs e) {
+      if (@Fixed) {
+        weightManipulatorMu = 1;
+        weightManipulatorSigma = 0;
+        weightMu = 1;
+        weightSigma = 0;
+        multiplicativeWeightManipulatorSigma = 0;
+      }
+      base.OnChanged(e);
+    }
+
     public override ISymbolicExpressionTreeNode CreateTreeNode() {
       return new VariableTreeNode(this);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 6802)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 6803)
@@ -138,4 +138,14 @@
       }
     }
+
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
     #endregion
 
