Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 8395)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 8409)
@@ -158,10 +158,4 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="InteractiveSymbolicExpressionTreeChart.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="InteractiveSymbolicExpressionTreeChart.Designer.cs">
-      <DependentUpon>InteractiveSymbolicExpressionTreeChart.cs</DependentUpon>
-    </Compile>
     <Compile Include="Plugin.cs" />
     <Compile Include="SymbolicExpressionGrammarAllowedChildSymbolsControl.cs">
@@ -188,16 +182,4 @@
     <Compile Include="SymbolicExpressionGrammarView.Designer.cs">
       <DependentUpon>SymbolicExpressionGrammarView.cs</DependentUpon>
-    </Compile>
-    <Compile Include="SymbolicExpressionTreeNodeChangeValueDialog.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="SymbolicExpressionTreeNodeChangeValueDialog.Designer.cs">
-      <DependentUpon>SymbolicExpressionTreeNodeChangeValueDialog.cs</DependentUpon>
-    </Compile>
-    <Compile Include="SymbolicExpressionTreeNodeInsertDialog.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="SymbolicExpressionTreeNodeInsertDialog.Designer.cs">
-      <DependentUpon>SymbolicExpressionTreeNodeInsertDialog.cs</DependentUpon>
     </Compile>
     <Compile Include="SymbolView.cs">
@@ -250,10 +232,4 @@
       <Install>true</Install>
     </BootstrapperPackage>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
-      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
-      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
-    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs	(revision 8395)
+++ 	(revision )
@@ -1,185 +1,0 @@
-﻿using System.Windows.Forms;
-
-namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
-  partial class InteractiveSymbolicExpressionTreeChart {
-    /// <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.insertNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.changeValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.copyNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.copySubtreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.cutNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.cutSubtreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.deleteNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.deleteSubtreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-      this.treeStatusLabel = new System.Windows.Forms.Label();
-      this.treeStatusValue = new System.Windows.Forms.Label();
-      this.SuspendLayout();
-      // 
-      // insertNodeToolStripMenuItem
-      // 
-      this.insertNodeToolStripMenuItem.Name = "insertNodeToolStripMenuItem";
-      this.insertNodeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-      this.insertNodeToolStripMenuItem.Text = "Insert Node";
-      this.insertNodeToolStripMenuItem.Click += new System.EventHandler(this.insertNodeToolStripMenuItem_Click);
-      // 
-      // changeValueToolStripMenuItem
-      // 
-      this.changeValueToolStripMenuItem.Enabled = false;
-      this.changeValueToolStripMenuItem.Name = "changeValueToolStripMenuItem";
-      this.changeValueToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-      this.changeValueToolStripMenuItem.Text = "Change Value";
-      this.changeValueToolStripMenuItem.Click += new System.EventHandler(this.changeValueToolStripMenuItem_Click);
-      // 
-      // copyToolStripMenuItem
-      // 
-      this.copyToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.copyNodeToolStripMenuItem,
-            this.copySubtreeToolStripMenuItem});
-      this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
-      this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-      this.copyToolStripMenuItem.Text = "Copy";
-      // 
-      // copyNodeToolStripMenuItem
-      // 
-      this.copyNodeToolStripMenuItem.Name = "copyNodeToolStripMenuItem";
-      this.copyNodeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
-      this.copyNodeToolStripMenuItem.Text = "Node";
-      this.copyNodeToolStripMenuItem.Click += new System.EventHandler(this.copyNodeToolStripMenuItem_Click);
-      // 
-      // copySubtreeToolStripMenuItem
-      // 
-      this.copySubtreeToolStripMenuItem.Name = "copySubtreeToolStripMenuItem";
-      this.copySubtreeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
-      this.copySubtreeToolStripMenuItem.Text = "Subtree";
-      this.copySubtreeToolStripMenuItem.Click += new System.EventHandler(this.copySubtreeToolStripMenuItem_Click);
-      // 
-      // cutToolStripMenuItem
-      // 
-      this.cutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.cutNodeToolStripMenuItem,
-            this.cutSubtreeToolStripMenuItem});
-      this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
-      this.cutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-      this.cutToolStripMenuItem.Text = "Cut";
-      // 
-      // cutNodeToolStripMenuItem
-      // 
-      this.cutNodeToolStripMenuItem.Name = "cutNodeToolStripMenuItem";
-      this.cutNodeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
-      this.cutNodeToolStripMenuItem.Text = "Node";
-      this.cutNodeToolStripMenuItem.Click += new System.EventHandler(this.cutNodeToolStripMenuItem_Click);
-      // 
-      // cutSubtreeToolStripMenuItem
-      // 
-      this.cutSubtreeToolStripMenuItem.Name = "cutSubtreeToolStripMenuItem";
-      this.cutSubtreeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
-      this.cutSubtreeToolStripMenuItem.Text = "Subtree";
-      this.cutSubtreeToolStripMenuItem.Click += new System.EventHandler(this.cutSubtreeToolStripMenuItem_Click);
-      // 
-      // deleteToolStripMenuItem
-      // 
-      this.deleteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.deleteNodeToolStripMenuItem,
-            this.deleteSubtreeToolStripMenuItem});
-      this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
-      this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-      this.deleteToolStripMenuItem.Text = "Delete";
-      // 
-      // deleteNodeToolStripMenuItem
-      // 
-      this.deleteNodeToolStripMenuItem.Name = "deleteNodeToolStripMenuItem";
-      this.deleteNodeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
-      this.deleteNodeToolStripMenuItem.Text = "Node";
-      this.deleteNodeToolStripMenuItem.Click += new System.EventHandler(this.deleteNodeToolStripMenuItem_Click);
-      // 
-      // deleteSubtreeToolStripMenuItem
-      // 
-      this.deleteSubtreeToolStripMenuItem.Name = "deleteSubtreeToolStripMenuItem";
-      this.deleteSubtreeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
-      this.deleteSubtreeToolStripMenuItem.Text = "Subtree";
-      this.deleteSubtreeToolStripMenuItem.Click += new System.EventHandler(this.deleteSubtreeToolStripMenuItem_Click);
-      // 
-      // pasteToolStripMenuItem
-      // 
-      this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
-      this.pasteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
-      this.pasteToolStripMenuItem.Text = "Paste";
-      this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Clicked);
-      // 
-      // treeStatusLabel
-      // 
-      this.treeStatusLabel.AutoSize = true;
-      this.treeStatusLabel.BackColor = System.Drawing.Color.Transparent;
-      this.treeStatusLabel.Location = new System.Drawing.Point(3, 0);
-      this.treeStatusLabel.Name = "treeStatusLabel";
-      this.treeStatusLabel.Size = new System.Drawing.Size(68, 13);
-      this.treeStatusLabel.TabIndex = 0;
-      this.treeStatusLabel.Text = "Tree Status: ";
-      // 
-      // treeStatusValue
-      // 
-      this.treeStatusValue.AutoSize = true;
-      this.treeStatusValue.BackColor = System.Drawing.Color.Transparent;
-      this.treeStatusValue.ForeColor = System.Drawing.Color.Green;
-      this.treeStatusValue.Location = new System.Drawing.Point(77, 0);
-      this.treeStatusValue.Name = "treeStatusValue";
-      this.treeStatusValue.Size = new System.Drawing.Size(30, 13);
-      this.treeStatusValue.TabIndex = 1;
-      this.treeStatusValue.Text = "Valid";
-      // 
-      // InteractiveSymbolicExpressionTreeChart
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.treeStatusLabel);
-      this.Controls.Add(this.treeStatusValue);
-      this.Name = "InteractiveSymbolicExpressionTreeChart";
-      this.ResumeLayout(false);
-      this.PerformLayout();
-
-    }
-
-    private ToolStripMenuItem insertNodeToolStripMenuItem;
-    private ToolStripMenuItem changeValueToolStripMenuItem;
-    private ToolStripMenuItem copyToolStripMenuItem;
-    private ToolStripMenuItem copyNodeToolStripMenuItem;
-    private ToolStripMenuItem copySubtreeToolStripMenuItem;
-    private ToolStripMenuItem cutToolStripMenuItem;
-    private ToolStripMenuItem cutNodeToolStripMenuItem;
-    private ToolStripMenuItem cutSubtreeToolStripMenuItem;
-    private ToolStripMenuItem pasteToolStripMenuItem;
-    private ToolStripMenuItem deleteToolStripMenuItem;
-    private ToolStripMenuItem deleteNodeToolStripMenuItem;
-    private ToolStripMenuItem deleteSubtreeToolStripMenuItem;
-
-    #endregion
-    private Label treeStatusLabel;
-    private Label treeStatusValue;
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs	(revision 8395)
+++ 	(revision )
@@ -1,295 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Drawing;
-using System.Linq;
-using System.Windows.Forms;
-using HeuristicLab.Problems.DataAnalysis.Symbolic;
-using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
-
-namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
-  public partial class InteractiveSymbolicExpressionTreeChart : SymbolicExpressionTreeChart {
-    private ISymbolicExpressionTreeNode _tempNode;
-    private VisualSymbolicExpressionTreeNode _lastSelected; // previously selected node
-    private VisualSymbolicExpressionTreeNode _currSelected; // currently selected node
-    private enum EditOp { CopyNode, CopySubtree, CutNode, CutSubtree, DeleteNode, DeleteSubtree }
-    private enum TreeState { Valid, Invalid }
-    private int lastOp = -1;
-    private TreeState treeState = TreeState.Valid; // tree edit operations must leave the tree in a valid state
-
-    public InteractiveSymbolicExpressionTreeChart() {
-      InitializeComponent();
-      // add extra actions in the context menu strips
-      this.contextMenuStrip.Opened += this.contextMenuStrip_Opened;
-      this.contextMenuStrip.Items.AddRange(new ToolStripItem[] {
-                                               insertNodeToolStripMenuItem,
-                                               changeValueToolStripMenuItem, 
-                                               copyToolStripMenuItem, 
-                                               cutToolStripMenuItem, 
-                                               deleteToolStripMenuItem, 
-                                               pasteToolStripMenuItem });
-      _lastSelected = null;
-      _currSelected = null;
-      _tempNode = null;
-    }
-
-    public bool TreeValid {
-      get { return TreeState.Valid == treeState; }
-    }
-
-    // expose an additional event for signaling to the parent view when the tree structure was modified
-    // the emitting of the signal is conditional on the tree being valid, otherwise only a Repaint is issued
-    public event EventHandler SymbolicExpressionTreeChanged;
-    private void OnSymbolicExpressionTreeChanged(object sender, EventArgs e) {
-      if (IsValid(Tree)) {
-        treeStatusValue.Text = "Valid";
-        treeStatusValue.ForeColor = Color.Green;
-        treeState = TreeState.Valid;
-        var changed = SymbolicExpressionTreeChanged;
-        if (changed != null) {
-          changed(sender, e);
-        }
-      } else {
-        treeStatusValue.Text = "Invalid";
-        treeStatusValue.ForeColor = Color.Red;
-        treeState = TreeState.Invalid;
-        Repaint();
-      }
-    }
-
-    private void contextMenuStrip_Opened(object sender, EventArgs e) {
-      var menu = sender as ContextMenuStrip;
-      if (menu == null) return;
-      var point = menu.SourceControl.PointToClient(Cursor.Position);
-      var visualNode = FindVisualSymbolicExpressionTreeNodeAt(point.X, point.Y);
-      if (visualNode != null) {
-        _lastSelected = _currSelected;
-        if (_lastSelected != null) _lastSelected.LineColor = Color.Black;
-        _currSelected = visualNode;
-        _currSelected.LineColor = Color.LightGreen;
-        var node = _currSelected.SymbolicExpressionTreeNode;
-        var item = FindMenuItemByName("changeValueToolStripMenuItem");
-        if (node is ConstantTreeNode || node is VariableTreeNode) {
-          item.Enabled = true;
-          item.Visible = true;
-        } else {
-          // do not show the change value menu item if the node is not a Constant or a Variable
-          item.Enabled = false;
-          item.Visible = false;
-        }
-        item = FindMenuItemByName("pasteToolStripMenuItem");
-        item.Enabled = (_tempNode != null);
-        // then, notify the parent so it can do its own stuff
-        // we pass the actual SymbolicExpressionTreeNode (and not the visual node) to the event handler,
-        // along with a new mouse event arg, to try to be consistend with naming semantics
-        OnSymbolicExpressionTreeNodeClicked(_currSelected, new MouseEventArgs(MouseButtons.Right, 1, point.X, point.Y, 0));
-      }
-    }
-
-    protected override void SymbolicExpressionTreeChart_MouseClick(object sender, MouseEventArgs e) {
-      VisualSymbolicExpressionTreeNode visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
-      if (visualTreeNode != null) {
-        _lastSelected = _currSelected;
-        if (_lastSelected != null) _lastSelected.LineColor = Color.Black;
-        _currSelected = visualTreeNode;
-        _currSelected.LineColor = Color.LightGreen;
-      }
-      Repaint();
-      base.SymbolicExpressionTreeChart_MouseClick(sender, e);
-    }
-
-    private void insertNodeToolStripMenuItem_Click(object sender, EventArgs e) {
-      if (_currSelected == null || _currSelected.SymbolicExpressionTreeNode is SymbolicExpressionTreeTerminalNode) return;
-      var node = _currSelected.SymbolicExpressionTreeNode;
-
-      var dialog = new InsertNodeDialog();
-      dialog.SetAllowedSymbols(node.Grammar.AllowedSymbols.Where(s => s.Enabled && s.InitialFrequency > 0.0 && !(s is ProgramRootSymbol || s is StartSymbol || s is Defun)));
-      dialog.DialogValidated += OnInsertNodeDialogValidated;
-      dialog.ShowDialog(this);
-    }
-
-    private void changeValueToolStripMenuItem_Click(object sender, EventArgs e) {
-      if (_currSelected == null) return;
-      var node = _currSelected.SymbolicExpressionTreeNode;
-      var dialog = new ValueChangeDialog();
-      dialog.SetContent(node);
-      dialog.DialogValidated += OnChangeValueDialogValidated;
-      dialog.ShowDialog(this);
-    }
-
-    public event EventHandler SymbolicExpressionTreeNodeChanged;
-    public event EventHandler SymbolicExpressionTreeNodeInserted;
-
-    private void OnChangeValueDialogValidated(object sender, EventArgs e) {
-      SymbolicExpressionTreeNodeChanged(sender, e);
-    }
-
-    private void OnInsertNodeDialogValidated(object sender, EventArgs e) {
-      var dialog = (InsertNodeDialog)sender;
-      var symbol = dialog.SelectedSymbol();
-      var node = symbol.CreateTreeNode();
-      var parent = _currSelected.SymbolicExpressionTreeNode;
-      if (node is ConstantTreeNode) {
-        var constant = node as ConstantTreeNode;
-        constant.Value = double.Parse(dialog.constantValueTextBox.Text);
-      } else if (node is VariableTreeNode) {
-        var variable = node as VariableTreeNode;
-        variable.Weight = double.Parse(dialog.variableWeightTextBox.Text);
-        variable.VariableName = dialog.variableNamesCombo.Text;
-      } else {
-        if (node.Symbol.MinimumArity <= parent.SubtreeCount && node.Symbol.MaximumArity >= parent.SubtreeCount) {
-          for (int i = parent.SubtreeCount - 1; i >= 0; --i) {
-            var child = parent.GetSubtree(i);
-            parent.RemoveSubtree(i);
-            node.AddSubtree(child);
-          }
-        }
-        // we assume that there is no case in which the parents subtrees get transferred to node, but node doesn't get added as a subtree of parent
-      }
-      if (parent.Symbol.MaximumArity > parent.SubtreeCount) {
-        parent.AddSubtree(node);
-        Tree = Tree;
-      }
-      OnSymbolicExpressionTreeChanged(sender, e);
-    }
-
-    private void cutNodeToolStripMenuItem_Click(object sender, EventArgs e) {
-      lastOp = (int)EditOp.CutNode;
-      _tempNode = _currSelected.SymbolicExpressionTreeNode;
-      var visualNode = visualTreeNodes[_tempNode];
-      visualNode.LineColor = Color.LightGray;
-      visualNode.TextColor = Color.LightGray;
-      Repaint();
-    }
-
-    private void cutSubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
-      lastOp = (int)EditOp.CutSubtree;
-      _tempNode = _currSelected.SymbolicExpressionTreeNode; // should never be null
-      foreach (var node in _tempNode.IterateNodesPostfix()) {
-        var visualNode = visualTreeNodes[node];
-        visualNode.LineColor = Color.LightGray;
-        visualNode.TextColor = Color.LightGray;
-        if (node.SubtreeCount > 0) {
-          foreach (var subtree in node.Subtrees) {
-            var visualLine = visualLines[new Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(node, subtree)];
-            visualLine.LineColor = Color.LightGray;
-          }
-        }
-      }
-      Repaint();
-    }
-
-    private void copyNodeToolStripMenuItem_Click(object sender, EventArgs e) {
-      lastOp = (int)EditOp.CopyNode;
-      _tempNode = _currSelected.SymbolicExpressionTreeNode;
-    }
-
-    private void copySubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
-      lastOp = (int)EditOp.CopySubtree;
-      _tempNode = _currSelected.SymbolicExpressionTreeNode;
-    }
-
-    private void deleteNodeToolStripMenuItem_Click(object sender, EventArgs e) {
-      lastOp = (int)EditOp.DeleteNode;
-      var node = _currSelected.SymbolicExpressionTreeNode;
-      var parent = node.Parent;
-      if (parent.Symbol.MaximumArity >= node.SubtreeCount + parent.SubtreeCount - 1) { // -1 because tempNode will be removed
-        parent.RemoveSubtree(parent.IndexOfSubtree(node));
-        for (int i = node.SubtreeCount - 1; i >= 0; --i) {
-          var child = node.GetSubtree(i);
-          node.RemoveSubtree(i);
-          parent.AddSubtree(child);
-        }
-      } else {
-        // if the node cannot be deleted without breaking the tree, do nothing
-        // TODO: decide what to do
-      }
-      OnSymbolicExpressionTreeChanged(sender, e);
-    }
-
-    private void deleteSubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
-      lastOp = (int)EditOp.DeleteSubtree;
-      var node = _currSelected.SymbolicExpressionTreeNode;
-      var parent = node.Parent;
-      parent.RemoveSubtree(parent.IndexOfSubtree(node));
-      OnSymbolicExpressionTreeChanged(sender, e);
-    }
-
-    private void pasteToolStripMenuItem_Clicked(object sender, EventArgs e) {
-      // check if the copied/cut node (stored in the tempNode) can be inserted as a child of the current selected node
-      var node = _currSelected.SymbolicExpressionTreeNode;
-      if (node is ConstantTreeNode || node is VariableTreeNode) return; // nothing to do
-      // check if the currently selected node can accept the copied node as a child 
-      // no need to check the grammar, an arity check will do just fine here
-      if (node.Symbol.MaximumArity > node.SubtreeCount) {
-        switch (lastOp) {
-          case ((int)EditOp.CutNode): // cut node
-            var parent = _tempNode.Parent;
-            // arity checks to see if parent can accept node's children (we assume the grammar is already ok with that)
-            if (parent.Symbol.MaximumArity >= _tempNode.SubtreeCount + parent.SubtreeCount - 1) { // -1 because tempNode will be removed
-              parent.RemoveSubtree(parent.IndexOfSubtree(_tempNode));
-              for (int i = _tempNode.SubtreeCount - 1; i >= 0; --i) {
-                var child = _tempNode.GetSubtree(i);
-                _tempNode.RemoveSubtree(i);
-                parent.AddSubtree(child);
-              }
-              lastOp = (int)EditOp.CopyNode;
-            }
-            break;
-          case ((int)EditOp.CutSubtree): // cut subtree
-            _tempNode.Parent.RemoveSubtree(_tempNode.Parent.IndexOfSubtree(_tempNode));
-            lastOp = (int)EditOp.CopySubtree; // do this so the next paste will actually perform a copy
-            break;
-          case ((int)EditOp.CopyNode): // copy node
-            _tempNode = _tempNode.Clone() as ISymbolicExpressionTreeNode; // should never be null
-            if (_tempNode != null && _tempNode.SubtreeCount > 0) {
-              for (int i = _tempNode.SubtreeCount - 1; i >= 0; --i)
-                _tempNode.RemoveSubtree(i);
-            }
-            break;
-          case ((int)EditOp.CopySubtree): // copy subtree
-            _tempNode = _tempNode.Clone() as ISymbolicExpressionTreeNode;
-            break;
-        }
-        node.AddSubtree(_tempNode);
-        Tree = Tree; // hack in order to trigger the reinitialization of the dictionaries after new nodes appeared in the graph
-        OnSymbolicExpressionTreeChanged(sender, e);
-      } else {
-        // throw exception or show a warning to the user about invalid arity
-      }
-    }
-
-    private bool IsValid(ISymbolicExpressionTree tree) {
-      if (tree.IterateNodesPostfix().Any(node => node.SubtreeCount < node.Symbol.MinimumArity || node.SubtreeCount > node.Symbol.MaximumArity)) {
-        treeState = TreeState.Invalid;
-        return false;
-      }
-      treeState = TreeState.Valid;
-      return true;
-    }
-
-    private ToolStripItem FindMenuItemByName(string name) {
-      ToolStripItem[] items = ContextMenuStrip.Items.Find(name, false);
-      return items.Any() ? items[0] : null;
-    }
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeChangeValueDialog.Designer.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeChangeValueDialog.Designer.cs	(revision 8395)
+++ 	(revision )
@@ -1,159 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 ValueChangeDialog {
-    /// <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) {
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
-    #region Windows Form 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();
-      this.originalValueLabel = new System.Windows.Forms.Label();
-      this.oldValueTextBox = new System.Windows.Forms.TextBox();
-      this.newValueTextBox = new System.Windows.Forms.TextBox();
-      this.newValueLabel = new System.Windows.Forms.Label();
-      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
-      this.variableNameLabel = new System.Windows.Forms.Label();
-      this.variableNamesCombo = new System.Windows.Forms.ComboBox();
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
-      this.SuspendLayout();
-      // 
-      // originalValueLabel
-      // 
-      this.originalValueLabel.AutoSize = true;
-      this.originalValueLabel.Location = new System.Drawing.Point(14, 15);
-      this.originalValueLabel.Name = "originalValueLabel";
-      this.originalValueLabel.Size = new System.Drawing.Size(72, 13);
-      this.originalValueLabel.TabIndex = 2;
-      this.originalValueLabel.Text = "Original Value";
-      // 
-      // oldValueTextBox
-      // 
-      this.oldValueTextBox.Location = new System.Drawing.Point(123, 12);
-      this.oldValueTextBox.Name = "oldValueTextBox";
-      this.oldValueTextBox.ReadOnly = true;
-      this.oldValueTextBox.Size = new System.Drawing.Size(131, 20);
-      this.oldValueTextBox.TabIndex = 3;
-      // 
-      // newValueTextBox
-      // 
-      this.newValueTextBox.Location = new System.Drawing.Point(123, 38);
-      this.newValueTextBox.Name = "newValueTextBox";
-      this.newValueTextBox.Size = new System.Drawing.Size(131, 20);
-      this.newValueTextBox.TabIndex = 0;
-      this.newValueTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
-      this.newValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.newValueTextBox_Validating);
-      this.newValueTextBox.Validated += new System.EventHandler(this.newValueTextBox_Validated);
-      // 
-      // newValueLabel
-      // 
-      this.newValueLabel.AutoSize = true;
-      this.newValueLabel.Location = new System.Drawing.Point(14, 41);
-      this.newValueLabel.Name = "newValueLabel";
-      this.newValueLabel.Size = new System.Drawing.Size(59, 13);
-      this.newValueLabel.TabIndex = 5;
-      this.newValueLabel.Text = "New Value";
-      // 
-      // errorProvider
-      // 
-      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
-      this.errorProvider.ContainerControl = this;
-      this.errorProvider.RightToLeft = true;
-      // 
-      // variableNameLabel
-      // 
-      this.variableNameLabel.AutoSize = true;
-      this.variableNameLabel.Location = new System.Drawing.Point(14, 74);
-      this.variableNameLabel.Name = "variableNameLabel";
-      this.variableNameLabel.Size = new System.Drawing.Size(76, 13);
-      this.variableNameLabel.TabIndex = 6;
-      this.variableNameLabel.Text = "Variable Name";
-      this.variableNameLabel.Visible = false;
-      // 
-      // variableNamesCombo
-      // 
-      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.variableNamesCombo.FormattingEnabled = true;
-      this.variableNamesCombo.Location = new System.Drawing.Point(123, 71);
-      this.variableNamesCombo.Name = "variableNamesCombo";
-      this.variableNamesCombo.Size = new System.Drawing.Size(131, 21);
-      this.variableNamesCombo.TabIndex = 7;
-      this.variableNamesCombo.Visible = false;
-      this.variableNamesCombo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
-      this.variableNamesCombo.Validating += new System.ComponentModel.CancelEventHandler(this.variableNamesCombo_Validating);
-      this.variableNamesCombo.Validated += new System.EventHandler(this.variableNamesCombo_Validated);
-      // 
-      // ValueChangeDialog
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.AutoSize = true;
-      this.ClientSize = new System.Drawing.Size(269, 103);
-      this.Controls.Add(this.variableNamesCombo);
-      this.Controls.Add(this.variableNameLabel);
-      this.Controls.Add(this.newValueLabel);
-      this.Controls.Add(this.newValueTextBox);
-      this.Controls.Add(this.oldValueTextBox);
-      this.Controls.Add(this.originalValueLabel);
-      this.MaximizeBox = false;
-      this.MinimizeBox = false;
-      this.Name = "ValueChangeDialog";
-      this.ShowIcon = false;
-      this.ShowInTaskbar = false;
-      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
-      this.Text = "Change Value or Weight";
-      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ValueChangeDialog_KeyDown);
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
-      this.ResumeLayout(false);
-      this.PerformLayout();
-
-    }
-
-    #endregion
-
-    private System.Windows.Forms.Label originalValueLabel;
-    private System.Windows.Forms.TextBox oldValueTextBox;
-    private System.Windows.Forms.TextBox newValueTextBox;
-    private System.Windows.Forms.Label newValueLabel;
-    private System.Windows.Forms.ErrorProvider errorProvider;
-    private System.Windows.Forms.ComboBox variableNamesCombo;
-    private System.Windows.Forms.Label variableNameLabel;
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeChangeValueDialog.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeChangeValueDialog.cs	(revision 8395)
+++ 	(revision )
@@ -1,162 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Text;
-using System.Windows.Forms;
-using HeuristicLab.Data;
-using HeuristicLab.Problems.DataAnalysis.Symbolic;
-
-namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
-  public partial class ValueChangeDialog : Form {
-    private ISymbolicExpressionTreeNode _content;
-    public ISymbolicExpressionTreeNode Content {
-      get { return _content; }
-      set {
-        if (InvokeRequired)
-          Invoke(new Action<SymbolicExpressionTreeNode>(x => _content = x), value);
-        else
-          _content = value;
-      }
-    }
-
-    public string Caption {
-      get { return this.Text; }
-      set {
-        if (InvokeRequired)
-          Invoke(new Action<string>(x => this.Caption = x), value);
-        else
-          this.Text = value;
-      }
-    }
-
-    public string OldValue {
-      get { return oldValueTextBox.Text; }
-      set {
-        if (InvokeRequired)
-          Invoke(new Action<string>(x => this.NewValue = x), value);
-        else
-          oldValueTextBox.Text = value;
-      }
-    }
-
-    public string NewValue {
-      get { return newValueTextBox.Text; }
-      set {
-        if (InvokeRequired)
-          Invoke(new Action<string>(x => this.NewValue = x), value);
-        else
-          newValueTextBox.Text = value;
-      }
-    }
-
-    public TextBox NewValueTextBox {
-      get { return newValueTextBox; }
-    }
-
-    public ComboBox VariableNameComboBox {
-      get { return variableNamesCombo; }
-    }
-
-    public ValueChangeDialog() {
-      InitializeComponent();
-      oldValueTextBox.TabStop = false; // cannot receive focus using tab key
-    }
-
-    public void SetContent(ISymbolicExpressionTreeNode content) {
-      Content = content;
-      if (Content is VariableTreeNode) {
-        Caption = "Change variable name or weight";
-        var variable = Content as VariableTreeNode;
-        OldValue = Math.Round(variable.Weight, 4).ToString();
-        NewValue = OldValue;
-        // add a dropbox containing all the available variable names
-        variableNameLabel.Visible = true;
-        variableNamesCombo.Visible = true;
-        foreach (var name in variable.Symbol.VariableNames) variableNamesCombo.Items.Add(name);
-        variableNamesCombo.SelectedIndex = 0;
-      } else if (Content is ConstantTreeNode) {
-        Caption = "Change constant value";
-        var constant = Content as ConstantTreeNode;
-        OldValue = Math.Round(constant.Value, 4).ToString();
-        NewValue = OldValue;
-      }
-    }
-
-    #region text box validation and events
-    private void newValueTextBox_Validating(object sender, CancelEventArgs e) {
-      string errorMessage;
-      if (!ValidateNewValue(newValueTextBox.Text, out errorMessage)) {
-        e.Cancel = true;
-        errorProvider.SetError(newValueTextBox, errorMessage);
-        newValueTextBox.SelectAll();
-      }
-    }
-
-    private void newValueTextBox_Validated(object sender, EventArgs e) {
-      errorProvider.SetError(newValueTextBox, string.Empty);
-    }
-
-    private static bool ValidateNewValue(string value, out string errorMessage) {
-      double val;
-      bool valid = double.TryParse(value, out val);
-      errorMessage = string.Empty;
-      if (!valid) {
-        var sb = new StringBuilder();
-        sb.Append("Invalid Value (Valid Value Format: \"");
-        sb.Append(FormatPatterns.GetDoubleFormatPattern());
-        sb.Append("\")");
-        errorMessage = sb.ToString();
-      }
-      return valid;
-    }
-    #endregion
-
-    #region combo box validation and events
-    private void variableNamesCombo_Validating(object sender, CancelEventArgs e) {
-      if (!(Content is VariableTreeNode)) return;
-      if (variableNamesCombo.Items.Contains(variableNamesCombo.SelectedItem)) return;
-      e.Cancel = true;
-      errorProvider.SetError(variableNamesCombo, "Invalid variable name");
-      variableNamesCombo.SelectAll();
-    }
-
-    private void variableNamesCombo_Validated(object sender, EventArgs e) {
-      errorProvider.SetError(variableNamesCombo, String.Empty);
-    }
-    #endregion
-    // proxy handler passing key strokes to the parent control
-    private void childControl_KeyDown(object sender, KeyEventArgs e) {
-      ValueChangeDialog_KeyDown(sender, e);
-    }
-
-    private void ValueChangeDialog_KeyDown(object sender, KeyEventArgs e) {
-      if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return)) {
-        if (!ValidateChildren()) return;
-        DialogValidated(this, e);
-        Close();
-      }
-    }
-
-    public event EventHandler DialogValidated;
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeInsertDialog.Designer.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeInsertDialog.Designer.cs	(revision 8395)
+++ 	(revision )
@@ -1,159 +1,0 @@
-﻿namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
-  partial class InsertNodeDialog {
-    /// <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 Windows Form 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();
-      this.nodeSymbolLabel = new System.Windows.Forms.Label();
-      this.allowedSymbolsCombo = new System.Windows.Forms.ComboBox();
-      this.variableWeightLabel = new System.Windows.Forms.Label();
-      this.variableNameLabel = new System.Windows.Forms.Label();
-      this.variableNamesCombo = new System.Windows.Forms.ComboBox();
-      this.variableWeightTextBox = new System.Windows.Forms.TextBox();
-      this.constantValueTextBox = new System.Windows.Forms.TextBox();
-      this.constantValueLabel = new System.Windows.Forms.Label();
-      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
-      this.SuspendLayout();
-      // 
-      // nodeSymbolLabel
-      // 
-      this.nodeSymbolLabel.AutoSize = true;
-      this.nodeSymbolLabel.Location = new System.Drawing.Point(13, 13);
-      this.nodeSymbolLabel.Name = "nodeSymbolLabel";
-      this.nodeSymbolLabel.Size = new System.Drawing.Size(41, 13);
-      this.nodeSymbolLabel.TabIndex = 0;
-      this.nodeSymbolLabel.Text = "Symbol";
-      // 
-      // allowedSymbolsCombo
-      // 
-      this.allowedSymbolsCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.allowedSymbolsCombo.FormattingEnabled = true;
-      this.allowedSymbolsCombo.Location = new System.Drawing.Point(120, 10);
-      this.allowedSymbolsCombo.Name = "allowedSymbolsCombo";
-      this.allowedSymbolsCombo.Size = new System.Drawing.Size(108, 21);
-      this.allowedSymbolsCombo.TabIndex = 1;
-      this.allowedSymbolsCombo.SelectedIndexChanged += new System.EventHandler(this.allowedSymbolsCombo_SelectedIndexChanged);
-      this.allowedSymbolsCombo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
-      // 
-      // variableWeightLabel
-      // 
-      this.variableWeightLabel.AutoSize = true;
-      this.variableWeightLabel.Location = new System.Drawing.Point(13, 44);
-      this.variableWeightLabel.Name = "variableWeightLabel";
-      this.variableWeightLabel.Size = new System.Drawing.Size(41, 13);
-      this.variableWeightLabel.TabIndex = 2;
-      this.variableWeightLabel.Text = "Weight";
-      this.variableWeightLabel.Visible = false;
-      // 
-      // variableNameLabel
-      // 
-      this.variableNameLabel.AutoSize = true;
-      this.variableNameLabel.Location = new System.Drawing.Point(13, 77);
-      this.variableNameLabel.Name = "variableNameLabel";
-      this.variableNameLabel.Size = new System.Drawing.Size(35, 13);
-      this.variableNameLabel.TabIndex = 3;
-      this.variableNameLabel.Text = "Name";
-      this.variableNameLabel.Visible = false;
-      // 
-      // variableNamesCombo
-      // 
-      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.variableNamesCombo.FormattingEnabled = true;
-      this.variableNamesCombo.Location = new System.Drawing.Point(120, 74);
-      this.variableNamesCombo.Name = "variableNamesCombo";
-      this.variableNamesCombo.Size = new System.Drawing.Size(108, 21);
-      this.variableNamesCombo.TabIndex = 5;
-      this.variableNamesCombo.Visible = false;
-      // 
-      // variableWeightTextBox
-      // 
-      this.variableWeightTextBox.Location = new System.Drawing.Point(120, 41);
-      this.variableWeightTextBox.Name = "variableWeightTextBox";
-      this.variableWeightTextBox.Size = new System.Drawing.Size(108, 20);
-      this.variableWeightTextBox.TabIndex = 6;
-      this.variableWeightTextBox.Text = "0.0";
-      this.variableWeightTextBox.Visible = false;
-      this.variableWeightTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.variableWeightTextBox_Validating);
-      // 
-      // constantValueTextBox
-      // 
-      this.constantValueTextBox.Location = new System.Drawing.Point(120, 41);
-      this.constantValueTextBox.Name = "constantValueTextBox";
-      this.constantValueTextBox.Size = new System.Drawing.Size(108, 20);
-      this.constantValueTextBox.TabIndex = 7;
-      this.constantValueTextBox.Text = "0.0";
-      this.constantValueTextBox.Visible = false;
-      this.constantValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.constantValueTextBox_Validating);
-      // 
-      // constantValueLabel
-      // 
-      this.constantValueLabel.AutoSize = true;
-      this.constantValueLabel.Location = new System.Drawing.Point(13, 44);
-      this.constantValueLabel.Name = "constantValueLabel";
-      this.constantValueLabel.Size = new System.Drawing.Size(34, 13);
-      this.constantValueLabel.TabIndex = 8;
-      this.constantValueLabel.Text = "Value";
-      this.constantValueLabel.Visible = false;
-      // 
-      // errorProvider
-      // 
-      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
-      this.errorProvider.ContainerControl = this;
-      this.errorProvider.RightToLeft = true;
-      // 
-      // InsertNodeDialog
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.ClientSize = new System.Drawing.Size(240, 107);
-      this.Controls.Add(this.constantValueLabel);
-      this.Controls.Add(this.constantValueTextBox);
-      this.Controls.Add(this.variableWeightTextBox);
-      this.Controls.Add(this.variableNamesCombo);
-      this.Controls.Add(this.variableNameLabel);
-      this.Controls.Add(this.variableWeightLabel);
-      this.Controls.Add(this.allowedSymbolsCombo);
-      this.Controls.Add(this.nodeSymbolLabel);
-      this.Name = "InsertNodeDialog";
-      this.Text = "SymbolicExpressionTreeNodeInsertDialog";
-      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.insertNodeDialog_KeyDown);
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
-      this.ResumeLayout(false);
-      this.PerformLayout();
-
-    }
-
-    #endregion
-
-    private System.Windows.Forms.Label nodeSymbolLabel;
-    private System.Windows.Forms.ComboBox allowedSymbolsCombo;
-    private System.Windows.Forms.Label variableWeightLabel;
-    private System.Windows.Forms.Label variableNameLabel;
-    private System.Windows.Forms.Label constantValueLabel;
-    private System.Windows.Forms.ErrorProvider errorProvider;
-    internal System.Windows.Forms.TextBox constantValueTextBox;
-    internal System.Windows.Forms.TextBox variableWeightTextBox;
-    internal System.Windows.Forms.ComboBox variableNamesCombo;
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeInsertDialog.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeNodeInsertDialog.cs	(revision 8395)
+++ 	(revision )
@@ -1,108 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Text;
-using System.Windows.Forms;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
-  public partial class InsertNodeDialog : Form {
-    public string Caption {
-      get { return this.Text; }
-      set {
-        if (InvokeRequired)
-          Invoke(new Action<string>(x => this.Caption = x), value);
-        else
-          this.Text = value;
-      }
-    }
-
-    public InsertNodeDialog() {
-      InitializeComponent();
-    }
-
-    public void SetAllowedSymbols(IEnumerable<ISymbol> symbols) {
-      allowedSymbolsCombo.Items.Clear();
-      foreach (var s in symbols) allowedSymbolsCombo.Items.Add(s);
-      allowedSymbolsCombo.SelectedIndex = 0;
-    }
-
-    public ISymbol SelectedSymbol() {
-      return (ISymbol)allowedSymbolsCombo.SelectedItem;
-    }
-
-    private void allowedSymbolsCombo_SelectedIndexChanged(object sender, EventArgs e) {
-      var combo = (ComboBox)sender;
-      var symbol = combo.Items[combo.SelectedIndex];
-      if (symbol is Constant) {
-        // add controls to the dialog for changing the constant value
-        variableNameLabel.Visible = false;
-        variableNamesCombo.Visible = false;
-        variableWeightLabel.Visible = false;
-        variableWeightTextBox.Visible = false;
-        constantValueLabel.Visible = true;
-        constantValueTextBox.Visible = true;
-      } else if (symbol is Variable) {
-        var variable = (Variable)symbol;
-        foreach (var name in variable.VariableNames) variableNamesCombo.Items.Add(name);
-        variableNamesCombo.SelectedIndex = 0;
-        variableNameLabel.Visible = true;
-        variableNamesCombo.Visible = true;
-        variableWeightLabel.Visible = true;
-        variableWeightTextBox.Visible = true;
-        constantValueLabel.Visible = false;
-        constantValueTextBox.Visible = false;
-        // add controls to the dialog for changing the variable name or weight
-      }
-    }
-
-    // validation
-    private void variableWeightTextBox_Validating(object sender, CancelEventArgs e) {
-      string errorMessage;
-      if (ValidateDoubleValue(variableWeightTextBox.Text, out errorMessage)) return;
-      e.Cancel = true;
-      errorProvider.SetError(variableWeightTextBox, errorMessage);
-      variableWeightTextBox.SelectAll();
-    }
-
-    private void constantValueTextBox_Validating(object sender, CancelEventArgs e) {
-      string errorMessage;
-      if (ValidateDoubleValue(constantValueTextBox.Text, out errorMessage)) return;
-      e.Cancel = true;
-      errorProvider.SetError(constantValueTextBox, errorMessage);
-      constantValueTextBox.SelectAll();
-    }
-
-    private static bool ValidateDoubleValue(string value, out string errorMessage) {
-      double val;
-      bool valid = double.TryParse(value, out val);
-      errorMessage = string.Empty;
-      if (!valid) {
-        var sb = new StringBuilder();
-        sb.Append("Invalid Value (Valid Value Format: \"");
-        sb.Append(FormatPatterns.GetDoubleFormatPattern());
-        sb.Append("\")");
-        errorMessage = sb.ToString();
-      }
-      return valid;
-    }
-
-    public event EventHandler DialogValidated;
-
-    private void childControl_KeyDown(object sender, KeyEventArgs e) {
-      insertNodeDialog_KeyDown(sender, e);
-    }
-
-    private void insertNodeDialog_KeyDown(object sender, KeyEventArgs e) {
-      if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) {
-        if (ValidateChildren()) {
-          DialogValidated(this, e);
-          Close();
-        }
-      }
-    }
-
-
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolutionImpactValuesCalculator.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolutionImpactValuesCalculator.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolutionImpactValuesCalculator.cs	(revision 8409)
@@ -0,0 +1,58 @@
+﻿using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
+  public class SymbolicDiscriminantFunctionClassificationSolutionImpactValuesCalculator : SymbolicDataAnalysisSolutionImpactValuesCalculator {
+    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree,
+                                                                                      ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                                                                      IDataAnalysisProblemData problemData) {
+      var replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      foreach (ISymbolicExpressionTreeNode node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
+        replacementValues[node] = CalculateReplacementValue(node, tree, interpreter, problemData);
+      }
+      return replacementValues;
+    }
+    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree,
+                                                                                 ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                                                                 IDataAnalysisProblemData classificationProblemData,
+                                                                                 double lowerEstimationLimit, double upperEstimationLimit) {
+      var problemData = (IClassificationProblemData)classificationProblemData;
+      var dataset = problemData.Dataset;
+      var rows = problemData.TrainingIndices;
+      string targetVariable = problemData.TargetVariable;
+      Dictionary<ISymbolicExpressionTreeNode, double> impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPostfix().ToList();
+
+      var targetClassValues = dataset.GetDoubleValues(targetVariable, rows);
+      var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows)
+        .LimitToRange(lowerEstimationLimit, upperEstimationLimit)
+        .ToArray();
+      OnlineCalculatorError errorState;
+      double originalGini = NormalizedGiniCalculator.Calculate(targetClassValues, originalOutput, out errorState);
+      if (errorState != OnlineCalculatorError.None) originalGini = 0.0;
+
+      foreach (ISymbolicExpressionTreeNode node in nodes) {
+        var parent = node.Parent;
+        var constantNode = ((ConstantTreeNode)new Constant().CreateTreeNode());
+        constantNode.Value = CalculateReplacementValue(node, tree, interpreter, classificationProblemData);
+        ISymbolicExpressionTreeNode replacementNode = constantNode;
+        SwitchNode(parent, node, replacementNode);
+        var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows)
+          .LimitToRange(lowerEstimationLimit, upperEstimationLimit)
+          .ToArray();
+        double newGini = NormalizedGiniCalculator.Calculate(targetClassValues, newOutput, out errorState);
+        if (errorState != OnlineCalculatorError.None) newGini = 0.0;
+
+        // impact = 0 if no change
+        // impact < 0 if new solution is better
+        // impact > 0 if new solution is worse
+        impactValues[node] = originalGini - newGini;
+        SwitchNode(parent, replacementNode, node);
+      }
+      return impactValues;
+
+    }
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolutionValuesCalculator.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolutionValuesCalculator.cs	(revision 8395)
+++ 	(revision )
@@ -1,57 +1,0 @@
-﻿using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
-  public class SymbolicDiscriminantFunctionClassificationSolutionValuesCalculator : SymbolicDataAnalysisSolutionValuesCalculator {
-    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree,
-                                                                                      ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
-                                                                                      IDataAnalysisProblemData problemData) {
-      var replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
-      foreach (ISymbolicExpressionTreeNode node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
-        replacementValues[node] = CalculateReplacementValue(node, tree, interpreter, problemData);
-      }
-      return replacementValues;
-    }
-    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree,
-                                                                                 ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
-                                                                                 IDataAnalysisProblemData classificationProblemData,
-                                                                                 double lowerEstimationLimit, double upperEstimationLimit) {
-      var problemData = (IClassificationProblemData)classificationProblemData;
-      var dataset = problemData.Dataset;
-      var rows = problemData.TrainingIndices;
-      string targetVariable = problemData.TargetVariable;
-      Dictionary<ISymbolicExpressionTreeNode, double> impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
-      List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPostfix().ToList();
-
-      var targetClassValues = dataset.GetDoubleValues(targetVariable, rows);
-      var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows)
-        .LimitToRange(lowerEstimationLimit, upperEstimationLimit)
-        .ToArray();
-      OnlineCalculatorError errorState;
-      double originalGini = NormalizedGiniCalculator.Calculate(targetClassValues, originalOutput, out errorState);
-      if (errorState != OnlineCalculatorError.None) originalGini = 0.0;
-
-      foreach (ISymbolicExpressionTreeNode node in nodes) {
-        var parent = node.Parent;
-        constantNode.Value = CalculateReplacementValue(node, tree, interpreter, classificationProblemData);
-        ISymbolicExpressionTreeNode replacementNode = constantNode;
-        SwitchNode(parent, node, replacementNode);
-        var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows)
-          .LimitToRange(lowerEstimationLimit, upperEstimationLimit)
-          .ToArray();
-        double newGini = NormalizedGiniCalculator.Calculate(targetClassValues, newOutput, out errorState);
-        if (errorState != OnlineCalculatorError.None) newGini = 0.0;
-
-        // impact = 0 if no change
-        // impact < 0 if new solution is better
-        // impact > 0 if new solution is worse
-        impactValues[node] = originalGini - newGini;
-        SwitchNode(parent, replacementNode, node);
-      }
-      return impactValues;
-
-    }
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionImpactValuesCalculator.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionImpactValuesCalculator.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionImpactValuesCalculator.cs	(revision 8409)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
+  public class SymbolicRegressionSolutionImpactValuesCalculator : SymbolicDataAnalysisSolutionImpactValuesCalculator {
+    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree,
+                                                                                               ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                                                                               IDataAnalysisProblemData problemData) {
+      var replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      foreach (ISymbolicExpressionTreeNode node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
+        replacementValues[node] = CalculateReplacementValue(node, tree, interpreter, problemData);
+      }
+      return replacementValues;
+    }
+
+    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData regressionProblemData, double lowerEstimationLimit, double upperEstimationLimit) {
+      var problemData = (IRegressionProblemData)regressionProblemData;
+      var dataset = problemData.Dataset;
+      var rows = problemData.TrainingIndices.ToList();
+      string targetVariable = problemData.TargetVariable;
+      var impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPostfix().ToList();
+      var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows).ToArray();
+      var targetValues = dataset.GetDoubleValues(targetVariable, rows).ToList();
+      OnlineCalculatorError errorState;
+      double originalR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, originalOutput, out errorState);
+      if (errorState != OnlineCalculatorError.None) originalR2 = 0.0;
+
+      foreach (ISymbolicExpressionTreeNode node in nodes) {
+        var parent = node.Parent;
+        var constantNode = ((ConstantTreeNode)new Constant().CreateTreeNode());
+        constantNode.Value = CalculateReplacementValue(node, tree, interpreter, problemData);
+        ISymbolicExpressionTreeNode replacementNode = constantNode;
+        SwitchNode(parent, node, replacementNode);
+        var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows);
+        double newR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, newOutput, out errorState);
+        if (errorState != OnlineCalculatorError.None) newR2 = 0.0;
+
+        // impact = 0 if no change
+        // impact < 0 if new solution is better
+        // impact > 0 if new solution is worse
+        impactValues[node] = originalR2 - newR2;
+        SwitchNode(parent, replacementNode, node);
+      }
+      return impactValues;
+    }
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionValuesCalculator.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionValuesCalculator.cs	(revision 8395)
+++ 	(revision )
@@ -1,69 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Encodings.SymbolicExpressionTreeEncoding;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
-  public class SymbolicRegressionSolutionValuesCalculator : SymbolicDataAnalysisSolutionValuesCalculator {
-    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree,
-                                                                                               ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
-                                                                                               IDataAnalysisProblemData problemData) {
-      var replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
-      foreach (ISymbolicExpressionTreeNode node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
-        replacementValues[node] = CalculateReplacementValue(node, tree, interpreter, problemData);
-      }
-      return replacementValues;
-    }
-
-    public override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData regressionProblemData, double lowerEstimationLimit, double upperEstimationLimit) {
-      var problemData = (IRegressionProblemData)regressionProblemData;
-      var dataset = problemData.Dataset;
-      var rows = problemData.TrainingIndices.ToList();
-      string targetVariable = problemData.TargetVariable;
-      var impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
-      List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPostfix().ToList();
-      var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows).ToArray();
-      var targetValues = dataset.GetDoubleValues(targetVariable, rows).ToList();
-      OnlineCalculatorError errorState;
-      double originalR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, originalOutput, out errorState);
-      if (errorState != OnlineCalculatorError.None) originalR2 = 0.0;
-
-      foreach (ISymbolicExpressionTreeNode node in nodes) {
-        var parent = node.Parent;
-        constantNode.Value = CalculateReplacementValue(node, tree, interpreter, problemData);
-        ISymbolicExpressionTreeNode replacementNode = constantNode;
-        SwitchNode(parent, node, replacementNode);
-        var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows);
-        double newR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, newOutput, out errorState);
-        if (errorState != OnlineCalculatorError.None) newR2 = 0.0;
-
-        // impact = 0 if no change
-        // impact < 0 if new solution is better
-        // impact > 0 if new solution is worse
-        impactValues[node] = originalR2 - newR2;
-        SwitchNode(parent, replacementNode, node);
-      }
-      return impactValues;
-    }
-  }
-}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 8395)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 8409)
@@ -167,4 +167,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="InteractiveSymbolicExpressionTreeChart.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicExpressionTreeChart.Designer.cs">
+      <DependentUpon>InteractiveSymbolicExpressionTreeChart.cs</DependentUpon>
+    </Compile>
     <Compile Include="MathSymbolicDataAnalysisModelView.cs">
       <SubType>UserControl</SubType>
@@ -221,4 +227,16 @@
     <Compile Include="Symbols\VariableView.Designer.cs">
       <DependentUpon>VariableView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeChangeValueDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeChangeValueDialog.Designer.cs">
+      <DependentUpon>SymbolicExpressionTreeNodeChangeValueDialog.cs</DependentUpon>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeInsertDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeInsertDialog.Designer.cs">
+      <DependentUpon>SymbolicExpressionTreeNodeInsertDialog.cs</DependentUpon>
     </Compile>
     <None Include="HeuristicLab.snk" />
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 8395)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 8409)
@@ -52,5 +52,5 @@
       this.btnPrune = new System.Windows.Forms.Button();
       this.btnOptimizeConstants = new System.Windows.Forms.Button();
-      this.treeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.InteractiveSymbolicExpressionTreeChart();
+      this.treeChart = new InteractiveSymbolicExpressionTreeChart();
       this.grpViewHost = new System.Windows.Forms.GroupBox();
       this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
@@ -66,6 +66,6 @@
       // viewHost
       // 
-      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
+      this.viewHost.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.viewHost.Caption = "View";
@@ -112,5 +112,5 @@
       // flowLayoutPanel
       // 
-      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
+      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
       this.flowLayoutPanel.Controls.Add(this.btnSimplify);
@@ -157,6 +157,6 @@
       // treeChart
       // 
-      this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
+      this.treeChart.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.treeChart.BackgroundColor = System.Drawing.Color.White;
@@ -214,5 +214,5 @@
     #endregion
 
-    private HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.InteractiveSymbolicExpressionTreeChart treeChart;
+    private InteractiveSymbolicExpressionTreeChart treeChart;
     private System.Windows.Forms.SplitContainer splitContainer;
     private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 8395)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 8409)
@@ -209,6 +209,8 @@
 
     private void treeChart_SymbolicExpressionTreeChanged(object sender, EventArgs e) {
-      CalculateReplacementNodesAndNodeImpacts(treeChart.Tree);
-      PaintModel();
+      updateInProgress = true;
+      UpdateModel(model);
+      updateInProgress = false;
+      CalculateReplacementNodesAndNodeImpacts();
     }
 
@@ -354,5 +356,7 @@
       } else {
         // The operation completed normally. We can update the model
+        updateInProgress = true;
         UpdateModel(model);
+        updateInProgress = false;
       }
       btnPrune.Enabled = true;
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs	(revision 8409)
@@ -0,0 +1,184 @@
+﻿using System.Windows.Forms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  partial class InteractiveSymbolicExpressionTreeChart {
+    /// <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.insertNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.changeValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.copyNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.copySubtreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.cutNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.cutSubtreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.deleteNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.deleteSubtreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.treeStatusLabel = new System.Windows.Forms.Label();
+      this.treeStatusValue = new System.Windows.Forms.Label();
+      this.SuspendLayout();
+      // 
+      // insertNodeToolStripMenuItem
+      // 
+      this.insertNodeToolStripMenuItem.Name = "insertNodeToolStripMenuItem";
+      this.insertNodeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.insertNodeToolStripMenuItem.Text = "Insert Node";
+      this.insertNodeToolStripMenuItem.Click += new System.EventHandler(this.insertNodeToolStripMenuItem_Click);
+      // 
+      // changeValueToolStripMenuItem
+      // 
+      this.changeValueToolStripMenuItem.Name = "changeValueToolStripMenuItem";
+      this.changeValueToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.changeValueToolStripMenuItem.Text = "Change Value";
+      this.changeValueToolStripMenuItem.Click += new System.EventHandler(this.changeValueToolStripMenuItem_Click);
+      // 
+      // copyToolStripMenuItem
+      // 
+      this.copyToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.copyNodeToolStripMenuItem,
+            this.copySubtreeToolStripMenuItem});
+      this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
+      this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.copyToolStripMenuItem.Text = "Copy";
+      // 
+      // copyNodeToolStripMenuItem
+      // 
+      this.copyNodeToolStripMenuItem.Name = "copyNodeToolStripMenuItem";
+      this.copyNodeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.copyNodeToolStripMenuItem.Text = "Node";
+      this.copyNodeToolStripMenuItem.Click += new System.EventHandler(this.copyNodeToolStripMenuItem_Click);
+      // 
+      // copySubtreeToolStripMenuItem
+      // 
+      this.copySubtreeToolStripMenuItem.Name = "copySubtreeToolStripMenuItem";
+      this.copySubtreeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.copySubtreeToolStripMenuItem.Text = "Subtree";
+      this.copySubtreeToolStripMenuItem.Click += new System.EventHandler(this.copySubtreeToolStripMenuItem_Click);
+      // 
+      // cutToolStripMenuItem
+      // 
+      this.cutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.cutNodeToolStripMenuItem,
+            this.cutSubtreeToolStripMenuItem});
+      this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
+      this.cutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.cutToolStripMenuItem.Text = "Cut";
+      // 
+      // cutNodeToolStripMenuItem
+      // 
+      this.cutNodeToolStripMenuItem.Name = "cutNodeToolStripMenuItem";
+      this.cutNodeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.cutNodeToolStripMenuItem.Text = "Node";
+      this.cutNodeToolStripMenuItem.Click += new System.EventHandler(this.cutNodeToolStripMenuItem_Click);
+      // 
+      // cutSubtreeToolStripMenuItem
+      // 
+      this.cutSubtreeToolStripMenuItem.Name = "cutSubtreeToolStripMenuItem";
+      this.cutSubtreeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.cutSubtreeToolStripMenuItem.Text = "Subtree";
+      this.cutSubtreeToolStripMenuItem.Click += new System.EventHandler(this.cutSubtreeToolStripMenuItem_Click);
+      // 
+      // deleteToolStripMenuItem
+      // 
+      this.deleteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.deleteNodeToolStripMenuItem,
+            this.deleteSubtreeToolStripMenuItem});
+      this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
+      this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.deleteToolStripMenuItem.Text = "Delete";
+      // 
+      // deleteNodeToolStripMenuItem
+      // 
+      this.deleteNodeToolStripMenuItem.Name = "deleteNodeToolStripMenuItem";
+      this.deleteNodeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.deleteNodeToolStripMenuItem.Text = "Node";
+      this.deleteNodeToolStripMenuItem.Click += new System.EventHandler(this.deleteNodeToolStripMenuItem_Click);
+      // 
+      // deleteSubtreeToolStripMenuItem
+      // 
+      this.deleteSubtreeToolStripMenuItem.Name = "deleteSubtreeToolStripMenuItem";
+      this.deleteSubtreeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.deleteSubtreeToolStripMenuItem.Text = "Subtree";
+      this.deleteSubtreeToolStripMenuItem.Click += new System.EventHandler(this.deleteSubtreeToolStripMenuItem_Click);
+      // 
+      // pasteToolStripMenuItem
+      // 
+      this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
+      this.pasteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.pasteToolStripMenuItem.Text = "Paste";
+      this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Clicked);
+      // 
+      // treeStatusLabel
+      // 
+      this.treeStatusLabel.AutoSize = true;
+      this.treeStatusLabel.BackColor = System.Drawing.Color.Transparent;
+      this.treeStatusLabel.Location = new System.Drawing.Point(3, 0);
+      this.treeStatusLabel.Name = "treeStatusLabel";
+      this.treeStatusLabel.Size = new System.Drawing.Size(68, 13);
+      this.treeStatusLabel.TabIndex = 0;
+      this.treeStatusLabel.Text = "Tree Status: ";
+      // 
+      // treeStatusValue
+      // 
+      this.treeStatusValue.AutoSize = true;
+      this.treeStatusValue.BackColor = System.Drawing.Color.Transparent;
+      this.treeStatusValue.ForeColor = System.Drawing.Color.Green;
+      this.treeStatusValue.Location = new System.Drawing.Point(77, 0);
+      this.treeStatusValue.Name = "treeStatusValue";
+      this.treeStatusValue.Size = new System.Drawing.Size(30, 13);
+      this.treeStatusValue.TabIndex = 1;
+      this.treeStatusValue.Text = "Valid";
+      // 
+      // InteractiveSymbolicExpressionTreeChart
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.treeStatusLabel);
+      this.Controls.Add(this.treeStatusValue);
+      this.Name = "InteractiveSymbolicExpressionTreeChart";
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    private ToolStripMenuItem insertNodeToolStripMenuItem;
+    private ToolStripMenuItem changeValueToolStripMenuItem;
+    private ToolStripMenuItem copyToolStripMenuItem;
+    private ToolStripMenuItem copyNodeToolStripMenuItem;
+    private ToolStripMenuItem copySubtreeToolStripMenuItem;
+    private ToolStripMenuItem cutToolStripMenuItem;
+    private ToolStripMenuItem cutNodeToolStripMenuItem;
+    private ToolStripMenuItem cutSubtreeToolStripMenuItem;
+    private ToolStripMenuItem pasteToolStripMenuItem;
+    private ToolStripMenuItem deleteToolStripMenuItem;
+    private ToolStripMenuItem deleteNodeToolStripMenuItem;
+    private ToolStripMenuItem deleteSubtreeToolStripMenuItem;
+
+    #endregion
+    private Label treeStatusLabel;
+    private Label treeStatusValue;
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs	(revision 8409)
@@ -0,0 +1,330 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public partial class InteractiveSymbolicExpressionTreeChart : SymbolicExpressionTreeChart {
+    private ISymbolicExpressionTreeNode tempNode;
+    private VisualSymbolicExpressionTreeNode lastSelected; // previously selected node
+    private VisualSymbolicExpressionTreeNode currSelected; // currently selected node
+    private enum EditOp { NoOp, CopyNode, CopySubtree, CutNode, CutSubtree, DeleteNode, DeleteSubtree }
+    private enum TreeState { Valid, Invalid }
+    private EditOp lastOp = EditOp.NoOp;
+    private TreeState treeState = TreeState.Valid; // tree edit operations must leave the tree in a valid state
+
+    public InteractiveSymbolicExpressionTreeChart() {
+      InitializeComponent();
+      // add extra actions in the context menu strips
+      this.contextMenuStrip.Opened += this.contextMenuStrip_Opened;
+      this.contextMenuStrip.Items.AddRange(new ToolStripItem[] {
+                                               insertNodeToolStripMenuItem,
+                                               changeValueToolStripMenuItem, 
+                                               copyToolStripMenuItem, 
+                                               cutToolStripMenuItem, 
+                                               deleteToolStripMenuItem, 
+                                               pasteToolStripMenuItem });
+      lastSelected = null;
+      currSelected = null;
+      tempNode = null;
+    }
+
+    public bool TreeValid {
+      get { return TreeState.Valid == treeState; }
+    }
+
+    // expose an additional event for signaling to the parent view when the tree structure was modified
+    // the emitting of the signal is conditional on the tree being valid, otherwise only a Repaint is issued
+    public event EventHandler SymbolicExpressionTreeChanged;
+    private void OnSymbolicExpressionTreeChanged(object sender, EventArgs e) {
+      if (IsValid(Tree)) {
+        treeStatusValue.Text = "Valid";
+        treeStatusValue.ForeColor = Color.Green;
+        treeState = TreeState.Valid;
+        var changed = SymbolicExpressionTreeChanged;
+        if (changed != null) {
+          changed(sender, e);
+        }
+      } else {
+        treeStatusValue.Text = "Invalid";
+        treeStatusValue.ForeColor = Color.Red;
+        treeState = TreeState.Invalid;
+        Repaint();
+      }
+    }
+
+    private void contextMenuStrip_Opened(object sender, EventArgs e) {
+      var menu = sender as ContextMenuStrip;
+      if (menu == null) return;
+      var point = menu.SourceControl.PointToClient(Cursor.Position);
+      var visualNode = FindVisualSymbolicExpressionTreeNodeAt(point.X, point.Y);
+      if (visualNode != null) {
+        lastSelected = currSelected;
+        if (lastSelected != null) lastSelected.LineColor = Color.Black;
+        currSelected = visualNode;
+        currSelected.LineColor = Color.LightGreen;
+        EnableTreeEditingMenuItems();
+        OnSymbolicExpressionTreeNodeClicked(currSelected, new MouseEventArgs(MouseButtons.Right, 1, point.X, point.Y, 0));
+      } else {
+        DisableTreeEditingMenuItems();
+      }
+    }
+
+    private void DisableTreeEditingMenuItems() {
+      insertNodeToolStripMenuItem.Visible = false;
+      changeValueToolStripMenuItem.Visible = false;
+      copyToolStripMenuItem.Visible = false;
+      cutToolStripMenuItem.Visible = false;
+      deleteToolStripMenuItem.Visible = false;
+      pasteToolStripMenuItem.Visible = false;
+    }
+
+    private void EnableTreeEditingMenuItems() {
+
+      var node = currSelected.SymbolicExpressionTreeNode;
+      changeValueToolStripMenuItem.Visible = (node is SymbolicExpressionTreeTerminalNode);
+      insertNodeToolStripMenuItem.Visible = !changeValueToolStripMenuItem.Visible;
+      copyToolStripMenuItem.Visible = true;
+      cutToolStripMenuItem.Visible = true;
+      deleteToolStripMenuItem.Visible = true;
+      pasteToolStripMenuItem.Visible = (lastOp == EditOp.CopyNode || lastOp == EditOp.CopySubtree || lastOp == EditOp.CutNode || lastOp == EditOp.CutSubtree) && insertNodeToolStripMenuItem.Visible;
+    }
+
+
+    protected override void SymbolicExpressionTreeChart_MouseClick(object sender, MouseEventArgs e) {
+      VisualSymbolicExpressionTreeNode visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+      if (visualTreeNode != null) {
+        lastSelected = currSelected;
+        if (lastSelected != null) lastSelected.LineColor = Color.Black;
+        currSelected = visualTreeNode;
+        currSelected.LineColor = Color.LightGreen;
+      }
+      Repaint();
+      base.SymbolicExpressionTreeChart_MouseClick(sender, e);
+    }
+
+    private void insertNodeToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (currSelected == null || currSelected.SymbolicExpressionTreeNode is SymbolicExpressionTreeTerminalNode) return;
+      var node = currSelected.SymbolicExpressionTreeNode;
+
+      var dialog = new InsertNodeDialog();
+      dialog.SetAllowedSymbols(node.Grammar.AllowedSymbols.Where(s => s.Enabled && s.InitialFrequency > 0.0 && !(s is ProgramRootSymbol || s is StartSymbol || s is Defun)));
+      dialog.DialogValidated += OnInsertNodeDialogValidated;
+      dialog.ShowDialog(this);
+    }
+
+    private void changeValueToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (currSelected == null) return;
+      var node = currSelected.SymbolicExpressionTreeNode;
+      var dialog = new ValueChangeDialog();
+      dialog.SetContent(node);
+      dialog.DialogValidated += OnChangeValueDialogValidated;
+      dialog.ShowDialog(this);
+    }
+
+    public event EventHandler SymbolicExpressionTreeNodeChanged;
+    public event EventHandler SymbolicExpressionTreeNodeInserted;
+
+    private void OnChangeValueDialogValidated(object sender, EventArgs e) {
+      SymbolicExpressionTreeNodeChanged(sender, e);
+    }
+
+    private void OnInsertNodeDialogValidated(object sender, EventArgs e) {
+      var dialog = (InsertNodeDialog)sender;
+      var symbol = dialog.SelectedSymbol();
+      var node = symbol.CreateTreeNode();
+      var parent = currSelected.SymbolicExpressionTreeNode;
+      if (node is ConstantTreeNode) {
+        var constant = node as ConstantTreeNode;
+        constant.Value = double.Parse(dialog.constantValueTextBox.Text);
+      } else if (node is VariableTreeNode) {
+        var variable = node as VariableTreeNode;
+        variable.Weight = double.Parse(dialog.variableWeightTextBox.Text);
+        variable.VariableName = dialog.variableNamesCombo.Text;
+      } else {
+        if (node.Symbol.MinimumArity <= parent.SubtreeCount && node.Symbol.MaximumArity >= parent.SubtreeCount) {
+          for (int i = parent.SubtreeCount - 1; i >= 0; --i) {
+            var child = parent.GetSubtree(i);
+            parent.RemoveSubtree(i);
+            node.AddSubtree(child);
+          }
+        }
+        // we assume that there is no case in which the parents subtrees get transferred to node, but node doesn't get added as a subtree of parent
+      }
+      if (parent.Symbol.MaximumArity > parent.SubtreeCount) {
+        parent.AddSubtree(node);
+        Tree = Tree;
+      }
+      OnSymbolicExpressionTreeChanged(sender, e);
+    }
+
+    private void cutNodeToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.CutNode;
+      tempNode = currSelected.SymbolicExpressionTreeNode;
+      var visualNode = visualTreeNodes[tempNode];
+      visualNode.LineColor = Color.LightGray;
+      visualNode.TextColor = Color.LightGray;
+      Repaint();
+    }
+
+    private void cutSubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.CutSubtree;
+      tempNode = currSelected.SymbolicExpressionTreeNode; // should never be null
+      foreach (var node in tempNode.IterateNodesPostfix()) {
+        var visualNode = visualTreeNodes[node];
+        visualNode.LineColor = Color.LightGray;
+        visualNode.TextColor = Color.LightGray;
+        if (node.SubtreeCount > 0) {
+          foreach (var subtree in node.Subtrees) {
+            var visualLine = visualLines[new Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(node, subtree)];
+            visualLine.LineColor = Color.LightGray;
+          }
+        }
+      }
+      Repaint();
+    }
+
+    private void copyNodeToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.CopyNode;
+      tempNode = currSelected.SymbolicExpressionTreeNode;
+      var visualNode = visualTreeNodes[tempNode];
+      visualNode.LineColor = Color.LightGray;
+      visualNode.TextColor = Color.LightGray;
+      Repaint();
+    }
+
+    private void copySubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.CopySubtree;
+      tempNode = currSelected.SymbolicExpressionTreeNode;
+      foreach (var node in tempNode.IterateNodesPostfix()) {
+        var visualNode = visualTreeNodes[node];
+        visualNode.LineColor = Color.LightGray;
+        visualNode.TextColor = Color.LightGray;
+        if (node.SubtreeCount > 0) {
+          foreach (var subtree in node.Subtrees) {
+            var visualLine = visualLines[new Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(node, subtree)];
+            visualLine.LineColor = Color.LightGray;
+          }
+        }
+      }
+      Repaint();
+    }
+
+    private void deleteNodeToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.DeleteNode;
+      var node = currSelected.SymbolicExpressionTreeNode;
+      var parent = node.Parent;
+      if (parent.Symbol.MaximumArity >= node.SubtreeCount + parent.SubtreeCount - 1) { // -1 because tempNode will be removed
+        parent.RemoveSubtree(parent.IndexOfSubtree(node));
+        for (int i = node.SubtreeCount - 1; i >= 0; --i) {
+          var child = node.GetSubtree(i);
+          node.RemoveSubtree(i);
+          parent.AddSubtree(child);
+        }
+      } else {
+        // if the node cannot be deleted without breaking the tree, do nothing
+        // TODO: decide what to do
+      }
+      OnSymbolicExpressionTreeChanged(sender, e);
+    }
+
+    private void deleteSubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.DeleteSubtree;
+      var node = currSelected.SymbolicExpressionTreeNode;
+      var parent = node.Parent;
+      parent.RemoveSubtree(parent.IndexOfSubtree(node));
+      OnSymbolicExpressionTreeChanged(sender, e);
+    }
+
+    private void pasteToolStripMenuItem_Clicked(object sender, EventArgs e) {
+      if (!(lastOp == EditOp.CopyNode || lastOp == EditOp.CopySubtree || lastOp == EditOp.CutNode || lastOp == EditOp.CutSubtree))
+        return;
+      // check if the copied/cut node (stored in the tempNode) can be inserted as a child of the current selected node
+      var node = currSelected.SymbolicExpressionTreeNode;
+      if (node is ConstantTreeNode || node is VariableTreeNode) return; // nothing to do
+      // check if the currently selected node can accept the copied node as a child 
+      // no need to check the grammar, an arity check will do just fine here
+      if (node.Symbol.MaximumArity > node.SubtreeCount) {
+        switch (lastOp) {
+          case (EditOp.CutNode): {
+              // cut node
+              var parent = tempNode.Parent;
+              // arity checks to see if parent can accept node's children (we assume the grammar is already ok with that)
+              if (parent.Symbol.MaximumArity >= tempNode.SubtreeCount + parent.SubtreeCount - 1) {
+                // -1 because tempNode will be removed
+                parent.RemoveSubtree(parent.IndexOfSubtree(tempNode));
+                for (int i = tempNode.SubtreeCount - 1; i >= 0; --i) {
+                  var child = tempNode.GetSubtree(i);
+                  tempNode.RemoveSubtree(i);
+                  parent.AddSubtree(child);
+                }
+                lastOp = EditOp.CopyNode;
+              }
+              break;
+            }
+          case (EditOp.CutSubtree): {
+              // cut subtree
+              tempNode.Parent.RemoveSubtree(tempNode.Parent.IndexOfSubtree(tempNode));
+              lastOp = EditOp.CopySubtree; // do this so the next paste will actually perform a copy
+              break;
+            }
+          case (EditOp.CopyNode): {
+              // copy node
+              var clone = tempNode.Clone() as ISymbolicExpressionTreeNode; // should never be null
+              clone.Parent = tempNode.Parent;
+              tempNode = clone;
+              if (tempNode != null && tempNode.SubtreeCount > 0) {
+                for (int i = tempNode.SubtreeCount - 1; i >= 0; --i)
+                  tempNode.RemoveSubtree(i);
+              }
+              break;
+            }
+          case (EditOp.CopySubtree): {
+              // copy subtree
+              var clone = tempNode.Clone() as ISymbolicExpressionTreeNode;
+              clone.Parent = tempNode.Parent;
+              tempNode = clone;
+              break;
+            }
+        }
+        node.AddSubtree(tempNode);
+        Tree = Tree; // hack in order to trigger the reinitialization of the dictionaries after new nodes appeared in the graph
+        OnSymbolicExpressionTreeChanged(sender, e);
+      } else {
+        // throw exception or show a warning to the user about invalid arity
+      }
+    }
+
+    private bool IsValid(ISymbolicExpressionTree tree) {
+      if (tree.IterateNodesPostfix().Any(node => node.SubtreeCount < node.Symbol.MinimumArity || node.SubtreeCount > node.Symbol.MaximumArity)) {
+        treeState = TreeState.Invalid;
+        return false;
+      }
+      treeState = TreeState.Valid;
+      return true;
+    }
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.Designer.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.Designer.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.Designer.cs	(revision 8409)
@@ -0,0 +1,159 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Problems.DataAnalysis.Symbolic.Views {
+  partial class ValueChangeDialog {
+    /// <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) {
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form 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();
+      this.originalValueLabel = new System.Windows.Forms.Label();
+      this.oldValueTextBox = new System.Windows.Forms.TextBox();
+      this.newValueTextBox = new System.Windows.Forms.TextBox();
+      this.newValueLabel = new System.Windows.Forms.Label();
+      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
+      this.variableNameLabel = new System.Windows.Forms.Label();
+      this.variableNamesCombo = new System.Windows.Forms.ComboBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // originalValueLabel
+      // 
+      this.originalValueLabel.AutoSize = true;
+      this.originalValueLabel.Location = new System.Drawing.Point(14, 15);
+      this.originalValueLabel.Name = "originalValueLabel";
+      this.originalValueLabel.Size = new System.Drawing.Size(72, 13);
+      this.originalValueLabel.TabIndex = 2;
+      this.originalValueLabel.Text = "Original Value";
+      // 
+      // oldValueTextBox
+      // 
+      this.oldValueTextBox.Location = new System.Drawing.Point(123, 12);
+      this.oldValueTextBox.Name = "oldValueTextBox";
+      this.oldValueTextBox.ReadOnly = true;
+      this.oldValueTextBox.Size = new System.Drawing.Size(131, 20);
+      this.oldValueTextBox.TabIndex = 3;
+      // 
+      // newValueTextBox
+      // 
+      this.newValueTextBox.Location = new System.Drawing.Point(123, 38);
+      this.newValueTextBox.Name = "newValueTextBox";
+      this.newValueTextBox.Size = new System.Drawing.Size(131, 20);
+      this.newValueTextBox.TabIndex = 0;
+      this.newValueTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
+      this.newValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.newValueTextBox_Validating);
+      this.newValueTextBox.Validated += new System.EventHandler(this.newValueTextBox_Validated);
+      // 
+      // newValueLabel
+      // 
+      this.newValueLabel.AutoSize = true;
+      this.newValueLabel.Location = new System.Drawing.Point(14, 41);
+      this.newValueLabel.Name = "newValueLabel";
+      this.newValueLabel.Size = new System.Drawing.Size(59, 13);
+      this.newValueLabel.TabIndex = 5;
+      this.newValueLabel.Text = "New Value";
+      // 
+      // errorProvider
+      // 
+      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
+      this.errorProvider.ContainerControl = this;
+      this.errorProvider.RightToLeft = true;
+      // 
+      // variableNameLabel
+      // 
+      this.variableNameLabel.AutoSize = true;
+      this.variableNameLabel.Location = new System.Drawing.Point(14, 74);
+      this.variableNameLabel.Name = "variableNameLabel";
+      this.variableNameLabel.Size = new System.Drawing.Size(76, 13);
+      this.variableNameLabel.TabIndex = 6;
+      this.variableNameLabel.Text = "Variable Name";
+      this.variableNameLabel.Visible = false;
+      // 
+      // variableNamesCombo
+      // 
+      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.variableNamesCombo.FormattingEnabled = true;
+      this.variableNamesCombo.Location = new System.Drawing.Point(123, 71);
+      this.variableNamesCombo.Name = "variableNamesCombo";
+      this.variableNamesCombo.Size = new System.Drawing.Size(131, 21);
+      this.variableNamesCombo.TabIndex = 7;
+      this.variableNamesCombo.Visible = false;
+      this.variableNamesCombo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
+      this.variableNamesCombo.Validating += new System.ComponentModel.CancelEventHandler(this.variableNamesCombo_Validating);
+      this.variableNamesCombo.Validated += new System.EventHandler(this.variableNamesCombo_Validated);
+      // 
+      // ValueChangeDialog
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoSize = true;
+      this.ClientSize = new System.Drawing.Size(269, 103);
+      this.Controls.Add(this.variableNamesCombo);
+      this.Controls.Add(this.variableNameLabel);
+      this.Controls.Add(this.newValueLabel);
+      this.Controls.Add(this.newValueTextBox);
+      this.Controls.Add(this.oldValueTextBox);
+      this.Controls.Add(this.originalValueLabel);
+      this.MaximizeBox = false;
+      this.MinimizeBox = false;
+      this.Name = "ValueChangeDialog";
+      this.ShowIcon = false;
+      this.ShowInTaskbar = false;
+      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+      this.Text = "Change Value or Weight";
+      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ValueChangeDialog_KeyDown);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label originalValueLabel;
+    private System.Windows.Forms.TextBox oldValueTextBox;
+    private System.Windows.Forms.TextBox newValueTextBox;
+    private System.Windows.Forms.Label newValueLabel;
+    private System.Windows.Forms.ErrorProvider errorProvider;
+    private System.Windows.Forms.ComboBox variableNamesCombo;
+    private System.Windows.Forms.Label variableNameLabel;
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.cs	(revision 8409)
@@ -0,0 +1,162 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Text;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public partial class ValueChangeDialog : Form {
+    private ISymbolicExpressionTreeNode _content;
+    public ISymbolicExpressionTreeNode Content {
+      get { return _content; }
+      set {
+        if (InvokeRequired)
+          Invoke(new Action<SymbolicExpressionTreeNode>(x => _content = x), value);
+        else
+          _content = value;
+      }
+    }
+
+    public string Caption {
+      get { return this.Text; }
+      set {
+        if (InvokeRequired)
+          Invoke(new Action<string>(x => this.Caption = x), value);
+        else
+          this.Text = value;
+      }
+    }
+
+    public string OldValue {
+      get { return oldValueTextBox.Text; }
+      set {
+        if (InvokeRequired)
+          Invoke(new Action<string>(x => this.NewValue = x), value);
+        else
+          oldValueTextBox.Text = value;
+      }
+    }
+
+    public string NewValue {
+      get { return newValueTextBox.Text; }
+      set {
+        if (InvokeRequired)
+          Invoke(new Action<string>(x => this.NewValue = x), value);
+        else
+          newValueTextBox.Text = value;
+      }
+    }
+
+    public TextBox NewValueTextBox {
+      get { return newValueTextBox; }
+    }
+
+    public ComboBox VariableNameComboBox {
+      get { return variableNamesCombo; }
+    }
+
+    public ValueChangeDialog() {
+      InitializeComponent();
+      oldValueTextBox.TabStop = false; // cannot receive focus using tab key
+    }
+
+    public void SetContent(ISymbolicExpressionTreeNode content) {
+      Content = content;
+      if (Content is VariableTreeNode) {
+        Caption = "Change variable name or weight";
+        var variable = Content as VariableTreeNode;
+        OldValue = Math.Round(variable.Weight, 4).ToString();
+        NewValue = OldValue;
+        // add a dropbox containing all the available variable names
+        variableNameLabel.Visible = true;
+        variableNamesCombo.Visible = true;
+        foreach (var name in variable.Symbol.VariableNames) variableNamesCombo.Items.Add(name);
+        variableNamesCombo.SelectedIndex = 0;
+      } else if (Content is ConstantTreeNode) {
+        Caption = "Change constant value";
+        var constant = Content as ConstantTreeNode;
+        OldValue = Math.Round(constant.Value, 4).ToString();
+        NewValue = OldValue;
+      }
+    }
+
+    #region text box validation and events
+    private void newValueTextBox_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (!ValidateNewValue(newValueTextBox.Text, out errorMessage)) {
+        e.Cancel = true;
+        errorProvider.SetError(newValueTextBox, errorMessage);
+        newValueTextBox.SelectAll();
+      }
+    }
+
+    private void newValueTextBox_Validated(object sender, EventArgs e) {
+      errorProvider.SetError(newValueTextBox, string.Empty);
+    }
+
+    private static bool ValidateNewValue(string value, out string errorMessage) {
+      double val;
+      bool valid = double.TryParse(value, out val);
+      errorMessage = string.Empty;
+      if (!valid) {
+        var sb = new StringBuilder();
+        sb.Append("Invalid Value (Valid Value Format: \"");
+        sb.Append(FormatPatterns.GetDoubleFormatPattern());
+        sb.Append("\")");
+        errorMessage = sb.ToString();
+      }
+      return valid;
+    }
+    #endregion
+
+    #region combo box validation and events
+    private void variableNamesCombo_Validating(object sender, CancelEventArgs e) {
+      if (!(Content is VariableTreeNode)) return;
+      if (variableNamesCombo.Items.Contains(variableNamesCombo.SelectedItem)) return;
+      e.Cancel = true;
+      errorProvider.SetError(variableNamesCombo, "Invalid variable name");
+      variableNamesCombo.SelectAll();
+    }
+
+    private void variableNamesCombo_Validated(object sender, EventArgs e) {
+      errorProvider.SetError(variableNamesCombo, String.Empty);
+    }
+    #endregion
+    // proxy handler passing key strokes to the parent control
+    private void childControl_KeyDown(object sender, KeyEventArgs e) {
+      ValueChangeDialog_KeyDown(sender, e);
+    }
+
+    private void ValueChangeDialog_KeyDown(object sender, KeyEventArgs e) {
+      if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return)) {
+        if (!ValidateChildren()) return;
+        DialogValidated(this, e);
+        Close();
+      }
+    }
+
+    public event EventHandler DialogValidated;
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs	(revision 8409)
@@ -0,0 +1,159 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  partial class InsertNodeDialog {
+    /// <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 Windows Form 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();
+      this.nodeSymbolLabel = new System.Windows.Forms.Label();
+      this.allowedSymbolsCombo = new System.Windows.Forms.ComboBox();
+      this.variableWeightLabel = new System.Windows.Forms.Label();
+      this.variableNameLabel = new System.Windows.Forms.Label();
+      this.variableNamesCombo = new System.Windows.Forms.ComboBox();
+      this.variableWeightTextBox = new System.Windows.Forms.TextBox();
+      this.constantValueTextBox = new System.Windows.Forms.TextBox();
+      this.constantValueLabel = new System.Windows.Forms.Label();
+      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // nodeSymbolLabel
+      // 
+      this.nodeSymbolLabel.AutoSize = true;
+      this.nodeSymbolLabel.Location = new System.Drawing.Point(13, 13);
+      this.nodeSymbolLabel.Name = "nodeSymbolLabel";
+      this.nodeSymbolLabel.Size = new System.Drawing.Size(41, 13);
+      this.nodeSymbolLabel.TabIndex = 0;
+      this.nodeSymbolLabel.Text = "Symbol";
+      // 
+      // allowedSymbolsCombo
+      // 
+      this.allowedSymbolsCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.allowedSymbolsCombo.FormattingEnabled = true;
+      this.allowedSymbolsCombo.Location = new System.Drawing.Point(120, 10);
+      this.allowedSymbolsCombo.Name = "allowedSymbolsCombo";
+      this.allowedSymbolsCombo.Size = new System.Drawing.Size(108, 21);
+      this.allowedSymbolsCombo.TabIndex = 1;
+      this.allowedSymbolsCombo.SelectedIndexChanged += new System.EventHandler(this.allowedSymbolsCombo_SelectedIndexChanged);
+      this.allowedSymbolsCombo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
+      // 
+      // variableWeightLabel
+      // 
+      this.variableWeightLabel.AutoSize = true;
+      this.variableWeightLabel.Location = new System.Drawing.Point(13, 44);
+      this.variableWeightLabel.Name = "variableWeightLabel";
+      this.variableWeightLabel.Size = new System.Drawing.Size(41, 13);
+      this.variableWeightLabel.TabIndex = 2;
+      this.variableWeightLabel.Text = "Weight";
+      this.variableWeightLabel.Visible = false;
+      // 
+      // variableNameLabel
+      // 
+      this.variableNameLabel.AutoSize = true;
+      this.variableNameLabel.Location = new System.Drawing.Point(13, 77);
+      this.variableNameLabel.Name = "variableNameLabel";
+      this.variableNameLabel.Size = new System.Drawing.Size(35, 13);
+      this.variableNameLabel.TabIndex = 3;
+      this.variableNameLabel.Text = "Name";
+      this.variableNameLabel.Visible = false;
+      // 
+      // variableNamesCombo
+      // 
+      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.variableNamesCombo.FormattingEnabled = true;
+      this.variableNamesCombo.Location = new System.Drawing.Point(120, 74);
+      this.variableNamesCombo.Name = "variableNamesCombo";
+      this.variableNamesCombo.Size = new System.Drawing.Size(108, 21);
+      this.variableNamesCombo.TabIndex = 5;
+      this.variableNamesCombo.Visible = false;
+      // 
+      // variableWeightTextBox
+      // 
+      this.variableWeightTextBox.Location = new System.Drawing.Point(120, 41);
+      this.variableWeightTextBox.Name = "variableWeightTextBox";
+      this.variableWeightTextBox.Size = new System.Drawing.Size(108, 20);
+      this.variableWeightTextBox.TabIndex = 6;
+      this.variableWeightTextBox.Text = "0.0";
+      this.variableWeightTextBox.Visible = false;
+      this.variableWeightTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.variableWeightTextBox_Validating);
+      // 
+      // constantValueTextBox
+      // 
+      this.constantValueTextBox.Location = new System.Drawing.Point(120, 41);
+      this.constantValueTextBox.Name = "constantValueTextBox";
+      this.constantValueTextBox.Size = new System.Drawing.Size(108, 20);
+      this.constantValueTextBox.TabIndex = 7;
+      this.constantValueTextBox.Text = "0.0";
+      this.constantValueTextBox.Visible = false;
+      this.constantValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.constantValueTextBox_Validating);
+      // 
+      // constantValueLabel
+      // 
+      this.constantValueLabel.AutoSize = true;
+      this.constantValueLabel.Location = new System.Drawing.Point(13, 44);
+      this.constantValueLabel.Name = "constantValueLabel";
+      this.constantValueLabel.Size = new System.Drawing.Size(34, 13);
+      this.constantValueLabel.TabIndex = 8;
+      this.constantValueLabel.Text = "Value";
+      this.constantValueLabel.Visible = false;
+      // 
+      // errorProvider
+      // 
+      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
+      this.errorProvider.ContainerControl = this;
+      this.errorProvider.RightToLeft = true;
+      // 
+      // InsertNodeDialog
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.ClientSize = new System.Drawing.Size(240, 107);
+      this.Controls.Add(this.constantValueLabel);
+      this.Controls.Add(this.constantValueTextBox);
+      this.Controls.Add(this.variableWeightTextBox);
+      this.Controls.Add(this.variableNamesCombo);
+      this.Controls.Add(this.variableNameLabel);
+      this.Controls.Add(this.variableWeightLabel);
+      this.Controls.Add(this.allowedSymbolsCombo);
+      this.Controls.Add(this.nodeSymbolLabel);
+      this.Name = "InsertNodeDialog";
+      this.Text = "SymbolicExpressionTreeNodeInsertDialog";
+      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.insertNodeDialog_KeyDown);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label nodeSymbolLabel;
+    private System.Windows.Forms.ComboBox allowedSymbolsCombo;
+    private System.Windows.Forms.Label variableWeightLabel;
+    private System.Windows.Forms.Label variableNameLabel;
+    private System.Windows.Forms.Label constantValueLabel;
+    private System.Windows.Forms.ErrorProvider errorProvider;
+    internal System.Windows.Forms.TextBox constantValueTextBox;
+    internal System.Windows.Forms.TextBox variableWeightTextBox;
+    internal System.Windows.Forms.ComboBox variableNamesCombo;
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs	(revision 8409)
@@ -0,0 +1,106 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public partial class InsertNodeDialog : Form {
+    public string Caption {
+      get { return this.Text; }
+      set {
+        if (InvokeRequired)
+          Invoke(new Action<string>(x => this.Caption = x), value);
+        else
+          this.Text = value;
+      }
+    }
+
+    public InsertNodeDialog() {
+      InitializeComponent();
+    }
+
+    public void SetAllowedSymbols(IEnumerable<ISymbol> symbols) {
+      allowedSymbolsCombo.Items.Clear();
+      foreach (var s in symbols) allowedSymbolsCombo.Items.Add(s);
+      allowedSymbolsCombo.SelectedIndex = 0;
+    }
+
+    public ISymbol SelectedSymbol() {
+      return (ISymbol)allowedSymbolsCombo.SelectedItem;
+    }
+
+    private void allowedSymbolsCombo_SelectedIndexChanged(object sender, EventArgs e) {
+      var combo = (ComboBox)sender;
+      var symbol = combo.Items[combo.SelectedIndex];
+      if (symbol is Constant) {
+        // add controls to the dialog for changing the constant value
+        variableNameLabel.Visible = false;
+        variableNamesCombo.Visible = false;
+        variableWeightLabel.Visible = false;
+        variableWeightTextBox.Visible = false;
+        constantValueLabel.Visible = true;
+        constantValueTextBox.Visible = true;
+      } else if (symbol is Variable) {
+        var variable = (Variable)symbol;
+        foreach (var name in variable.VariableNames) variableNamesCombo.Items.Add(name);
+        variableNamesCombo.SelectedIndex = 0;
+        variableNameLabel.Visible = true;
+        variableNamesCombo.Visible = true;
+        variableWeightLabel.Visible = true;
+        variableWeightTextBox.Visible = true;
+        constantValueLabel.Visible = false;
+        constantValueTextBox.Visible = false;
+        // add controls to the dialog for changing the variable name or weight
+      }
+    }
+
+    // validation
+    private void variableWeightTextBox_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (ValidateDoubleValue(variableWeightTextBox.Text, out errorMessage)) return;
+      e.Cancel = true;
+      errorProvider.SetError(variableWeightTextBox, errorMessage);
+      variableWeightTextBox.SelectAll();
+    }
+
+    private void constantValueTextBox_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (ValidateDoubleValue(constantValueTextBox.Text, out errorMessage)) return;
+      e.Cancel = true;
+      errorProvider.SetError(constantValueTextBox, errorMessage);
+      constantValueTextBox.SelectAll();
+    }
+
+    private static bool ValidateDoubleValue(string value, out string errorMessage) {
+      double val;
+      bool valid = double.TryParse(value, out val);
+      errorMessage = string.Empty;
+      if (!valid) {
+        var sb = new StringBuilder();
+        sb.Append("Invalid Value (Valid Value Format: \"");
+        sb.Append(FormatPatterns.GetDoubleFormatPattern());
+        sb.Append("\")");
+        errorMessage = sb.ToString();
+      }
+      return valid;
+    }
+
+    public event EventHandler DialogValidated;
+
+    private void childControl_KeyDown(object sender, KeyEventArgs e) {
+      insertNodeDialog_KeyDown(sender, e);
+    }
+
+    private void insertNodeDialog_KeyDown(object sender, KeyEventArgs e) {
+      if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) {
+        if (ValidateChildren()) {
+          DialogValidated(this, e);
+          Close();
+        }
+      }
+    }
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 8409)
+++ branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 8409)
@@ -0,0 +1,52 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator {
+    // should be moved to an interface, then un-abstract the class
+    public abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData);
+    public abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit);
+
+    protected void SwitchNode(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode oldBranch, ISymbolicExpressionTreeNode newBranch) {
+      for (int i = 0; i < root.SubtreeCount; i++) {
+        if (root.GetSubtree(i) == oldBranch) {
+          root.RemoveSubtree(i);
+          root.InsertSubtree(i, newBranch);
+          return;
+        }
+      }
+    }
+
+    protected double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData) {
+      var root = new ProgramRootSymbol().CreateTreeNode();
+      var start = new StartSymbol().CreateTreeNode();
+      root.AddSubtree(start);
+      start.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());
+      var rows = problemData.TrainingIndices;
+      var tempTree = new SymbolicExpressionTree(root);
+      return interpreter.GetSymbolicExpressionTreeValues(tempTree, problemData.Dataset, rows).Median();
+    }
+  }
+}
Index: branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionValuesCalculator.cs
===================================================================
--- branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionValuesCalculator.cs	(revision 8395)
+++ 	(revision )
@@ -1,67 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  public abstract class SymbolicDataAnalysisSolutionValuesCalculator {
-    protected readonly ISymbolicExpressionTree tempTree;
-    protected readonly ConstantTreeNode constantNode;
-
-    public SymbolicDataAnalysisSolutionValuesCalculator() {
-      constantNode = ((ConstantTreeNode)new Constant().CreateTreeNode());
-      ISymbolicExpressionTreeNode root = new ProgramRootSymbol().CreateTreeNode();
-      ISymbolicExpressionTreeNode start = new StartSymbol().CreateTreeNode();
-      root.AddSubtree(start);
-      tempTree = new SymbolicExpressionTree(root);
-    }
-
-    // should be moved to an interface, then un-abstract the class
-    public abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData);
-    public abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit);
-
-    protected void SwitchNode(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode oldBranch, ISymbolicExpressionTreeNode newBranch) {
-      for (int i = 0; i < root.SubtreeCount; i++) {
-        if (root.GetSubtree(i) == oldBranch) {
-          root.RemoveSubtree(i);
-          root.InsertSubtree(i, newBranch);
-          return;
-        }
-      }
-    }
-
-    protected double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData) {
-      // remove old ADFs
-      while (tempTree.Root.SubtreeCount > 1) tempTree.Root.RemoveSubtree(1);
-      // clone ADFs of source tree
-      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.SubtreeCount > 0) start.RemoveSubtree(0);
-      start.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());
-      var rows = problemData.TrainingIndices;
-      return interpreter.GetSymbolicExpressionTreeValues(tempTree, problemData.Dataset, rows).Median();
-    }
-  }
-}
