Index: /trunk/sources/HeuristicLab.Common/3.3/Cloner.cs
===================================================================
--- /trunk/sources/HeuristicLab.Common/3.3/Cloner.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Common/3.3/Cloner.cs	(revision 6233)
@@ -41,17 +41,4 @@
     /// <param name="item">The object which should be cloned.</param>
     /// <returns>A clone of the given object.</returns>
-    public IDeepCloneable Clone(IDeepCloneable obj) {
-      if (obj == null) return null;
-      IDeepCloneable clone;
-      if (mapping.TryGetValue(obj, out clone))
-        return clone;
-      else
-        return obj.Clone(this);
-    }
-    /// <summary>
-    /// Creates a deep clone of a given deeply cloneable object.
-    /// </summary>
-    /// <param name="item">The object which should be cloned.</param>
-    /// <returns>A clone of the given object.</returns>
     public T Clone<T>(T obj) where T : class, IDeepCloneable {
       if (obj == null) return null;
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs	(revision 6233)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Drawing;
 using System.Windows.Forms;
 using HeuristicLab.Collections;
@@ -49,7 +50,12 @@
     }
 
+    private Color backupColor = Color.Empty;
     protected override void SetEnabledStateOfControls() {
+      if (backupColor == Color.Empty) backupColor = base.itemsListView.BackColor;
       base.SetEnabledStateOfControls();
-      base.itemsListView.Enabled = !this.Locked;
+      if (ReadOnly || Locked)
+        base.itemsListView.BackColor = ListView.DefaultBackColor;
+      else
+        base.itemsListView.BackColor = backupColor;
     }
 
@@ -70,5 +76,6 @@
         bool check = e.NewValue == CheckState.Checked;
         if (Content.ItemChecked(checkedItem) != check) {
-          Content.SetItemCheckedState(checkedItem, check);
+          if (!ReadOnly && !Locked) Content.SetItemCheckedState(checkedItem, check);
+          else e.NewValue = e.CurrentValue;
         }
       }
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs	(revision 6233)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Drawing;
 using System.Windows.Forms;
 using HeuristicLab.Collections;
@@ -51,7 +52,12 @@
     }
 
+    private Color backupColor = Color.Empty;
     protected override void SetEnabledStateOfControls() {
+      if(backupColor == Color.Empty) backupColor = base.itemsListView.BackColor;
       base.SetEnabledStateOfControls();
-      base.itemsListView.Enabled = !this.Locked;
+      if (ReadOnly || Locked)
+        base.itemsListView.BackColor = ListView.DefaultBackColor;
+      else
+        base.itemsListView.BackColor = backupColor;
     }
 
@@ -72,5 +78,6 @@
         bool check = e.NewValue == CheckState.Checked;
         if (Content.ItemChecked(checkedItem) != check) {
-          Content.SetItemCheckedState(checkedItem, check);
+          if (!ReadOnly && !Locked) Content.SetItemCheckedState(checkedItem, check);
+          else e.NewValue = e.CurrentValue;
         }
       }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 6233)
@@ -21,9 +21,9 @@
 
 using System;
+using System.ComponentModel;
 using System.Windows.Forms;
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
-using System.ComponentModel;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
@@ -91,5 +91,5 @@
       if (double.TryParse(initialFrequencyTextBox.Text, out freq) && freq >= 0.0) {
         Content.InitialFrequency = freq;
-      } 
+      }
     }
     #endregion
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 6233)
@@ -39,8 +39,28 @@
     }
 
+    public override bool ReadOnly {
+      get {
+        if ((Content != null) && Content.ReadOnly) return true;
+        return base.ReadOnly;
+      }
+      set {
+        if ((Content != null) && Content.ReadOnly) base.ReadOnly = true;
+        else base.ReadOnly = value;
+      }
+    }
+
     public SymbolicExpressionGrammarView() {
       InitializeComponent();
       symbols = new CheckedItemList<ISymbol>();
       symbols.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<ISymbol>>(symbols_CheckedItemsChanged);
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged);
     }
 
@@ -50,8 +70,6 @@
     }
 
-    protected override void SetEnabledStateOfControls() {
-      base.SetEnabledStateOfControls();
-      checkedItemListView.Enabled = Content != null;
-      checkedItemListView.ReadOnly = ReadOnly;
+    private void Content_ReadOnlyChanged(object sender, EventArgs e) {
+      ReadOnly = Content.ReadOnly;
     }
 
@@ -69,5 +87,5 @@
       } else {
         ClearSymbols();
-        foreach (Symbol symbol in Content.Symbols) {
+        foreach (ISymbol symbol in Content.Symbols) {
           if (!(symbol is IReadOnlySymbol)) {
             symbol.Changed += new EventHandler(symbol_Changed);
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 6233)
@@ -83,5 +83,5 @@
           subtree.Grammar.SetSubtreeCount(invokeSymbol, duplicatedDefunBranch.NumberOfArguments, duplicatedDefunBranch.NumberOfArguments);
 
-          foreach (Symbol symbol in subtree.Grammar.Symbols) {
+          foreach (ISymbol symbol in subtree.Grammar.Symbols) {
             if (subtree.Grammar.IsAllowedChildSymbol(symbol, matchingInvokeSymbol))
               subtree.Grammar.AddAllowedChildSymbol(symbol, invokeSymbol);
@@ -93,9 +93,9 @@
           }
 
-          foreach (Symbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol))
+          foreach (ISymbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol))
             if (symbol != invokeSymbol) //avoid duplicate entry invokesymbol / invokesymbol
               subtree.Grammar.AddAllowedChildSymbol(invokeSymbol, symbol);
           for (int i = 0; i < subtree.Grammar.GetMaximumSubtreeCount(matchingInvokeSymbol); i++) {
-            foreach (Symbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol, i).Except(subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol)))
+            foreach (ISymbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol, i).Except(subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol)))
               subtree.Grammar.AddAllowedChildSymbol(invokeSymbol, symbol, i);
           }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 6233)
@@ -38,4 +38,5 @@
     private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
     private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
+    private const string ClonedSymbolicExpressionTreeGrammarParameterName = "ClonedSymbolicExpressionTreeGrammar";
     #region Parameter Properties
     public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
@@ -47,4 +48,7 @@
     public IValueLookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionTreeGrammarParameter {
       get { return (IValueLookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionGrammar> ClonedSymbolicExpressionTreeGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[ClonedSymbolicExpressionTreeGrammarParameterName]; }
     }
     #endregion
@@ -57,5 +61,5 @@
     }
     public ISymbolicExpressionGrammar SymbolicExpressionTreeGrammar {
-      get { return SymbolicExpressionTreeGrammarParameter.ActualValue; }
+      get { return ClonedSymbolicExpressionTreeGrammarParameter.ActualValue; }
     }
     #endregion
@@ -69,4 +73,5 @@
       Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
       Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
     }
 
@@ -74,8 +79,24 @@
       return new ProbabilisticTreeCreator(this, cloner);
     }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(ClonedSymbolicExpressionTreeGrammarParameterName))
+        Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+    }
+
+    public override IOperation Apply() {
+      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
+        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
+        IScope globalScope = ExecutionContext.Scope;
+        while (globalScope.Parent != null)
+          globalScope = globalScope.Parent;
+
+        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
+      }
+      return base.Apply();
+    }
 
     protected override ISymbolicExpressionTree Create(IRandom random) {
       return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
-
     }
 
@@ -165,4 +186,5 @@
                                 select s)
                                .ToList();
+          if (allowedSymbols.Count == 0) return false;
           var weights = allowedSymbols.Select(x => x.InitialFrequency).ToList();
           var selectedSymbol = allowedSymbols.SelectRandom(weights, random);
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 6233)
@@ -22,5 +22,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -55,5 +54,5 @@
     }
 
-    public sealed override IOperation Apply() {
+    public override IOperation Apply() {
       SymbolicExpressionTree = Create(Random);
       return base.Apply();
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs	(revision 6233)
@@ -21,6 +21,8 @@
 
 
+using System;
+using HeuristicLab.Core;
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
-  public interface ISymbolicExpressionGrammar : ISymbolicExpressionGrammarBase {
+  public interface ISymbolicExpressionGrammar : ISymbolicExpressionGrammarBase, IStatefulItem {
     ISymbol ProgramRootSymbol { get; }
     ISymbol StartSymbol { get; }
@@ -30,4 +32,7 @@
     int MinimumFunctionArguments { get; set; }
     int MaximumFunctionArguments { get; set; }
+
+    bool ReadOnly { get; set; }
+    event EventHandler ReadOnlyChanged;
   }
 }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammar.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammar.cs	(revision 6233)
@@ -20,6 +20,7 @@
 #endregion
 
-using System.Linq;
+using System;
 using HeuristicLab.Common;
+using HeuristicLab.Core;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -28,4 +29,16 @@
   public abstract class SymbolicExpressionGrammar : SymbolicExpressionGrammarBase, ISymbolicExpressionGrammar {
     #region fields & properties
+    [Storable(DefaultValue = false)]
+    private bool readOnly;
+    public bool ReadOnly {
+      get { return readOnly; }
+      set {
+        if (readOnly != value) {
+          readOnly = value;
+          OnReadOnlyChanged();
+        }
+      }
+    }
+
     [Storable]
     private int minimumFunctionDefinitions;
@@ -102,9 +115,8 @@
     protected SymbolicExpressionGrammar(SymbolicExpressionGrammar original, Cloner cloner)
       : base(original, cloner) {
-      programRootSymbol = (ProgramRootSymbol)cloner.Clone(original.programRootSymbol);
-      startSymbol = (StartSymbol)cloner.Clone(original.StartSymbol);
-      defunSymbol = (Defun)cloner.Clone(original.defunSymbol);
-      symbols = original.symbols
-        .ToDictionary(x => x.Key, y => (ISymbol)cloner.Clone(y.Value));
+      programRootSymbol = cloner.Clone(original.programRootSymbol);
+      startSymbol = cloner.Clone(original.StartSymbol);
+      defunSymbol = cloner.Clone(original.defunSymbol);
+
       maximumFunctionArguments = original.maximumFunctionArguments;
       minimumFunctionArguments = original.minimumFunctionArguments;
@@ -140,4 +152,18 @@
       }
     }
+
+    public event EventHandler ReadOnlyChanged;
+    protected virtual void OnReadOnlyChanged() {
+      var handler = ReadOnlyChanged;
+      if (handler != null)
+        handler(this, EventArgs.Empty);
+    }
+
+    #region IStatefulItem
+    void IStatefulItem.InitializeState() { }
+    void IStatefulItem.ClearState() {
+      ReadOnly = false;
+    }
+    #endregion
   }
 }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammarBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammarBase.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammarBase.cs	(revision 6233)
@@ -81,4 +81,10 @@
       cachedMinExpressionDepth = new Dictionary<string, int>();
     }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      foreach (ISymbol symbol in symbols.Values)
+        RegisterSymbolEvents(symbol);
+    }
+
     protected SymbolicExpressionGrammarBase(SymbolicExpressionGrammarBase original, Cloner cloner)
       : base(original, cloner) {
@@ -87,6 +93,7 @@
       cachedMinExpressionDepth = new Dictionary<string, int>();
 
+
+      symbols = original.symbols.ToDictionary(x => x.Key, y => (ISymbol)cloner.Clone(y.Value));
       symbolSubtreeCount = new Dictionary<string, Tuple<int, int>>(original.symbolSubtreeCount);
-      symbols = new Dictionary<string, ISymbol>(original.symbols);
 
       allowedChildSymbols = new Dictionary<string, List<string>>();
@@ -97,4 +104,7 @@
       foreach (var element in original.allowedChildSymbolsPerIndex)
         allowedChildSymbolsPerIndex.Add(element.Key, new List<string>(element.Value));
+
+      foreach (ISymbol symbol in symbols.Values)
+        RegisterSymbolEvents(symbol);
     }
 
@@ -114,6 +124,58 @@
     protected void AddSymbol(ISymbol symbol) {
       if (ContainsSymbol(symbol)) throw new ArgumentException("Symbol " + symbol + " is already defined.");
+      RegisterSymbolEvents(symbol);
       symbols.Add(symbol.Name, symbol);
       symbolSubtreeCount.Add(symbol.Name, Tuple.Create(0, 0));
+      ClearCaches();
+    }
+
+    private void RegisterSymbolEvents(ISymbol symbol) {
+      symbol.NameChanging += new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
+      symbol.NameChanged += new EventHandler(Symbol_NameChanged);
+    }
+    private void DeregisterSymbolEvents(ISymbol symbol) {
+      symbol.NameChanging -= new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
+      symbol.NameChanged -= new EventHandler(Symbol_NameChanged);
+    }
+
+    private void Symbol_NameChanging(object sender, CancelEventArgs<string> e) {
+      if (symbols.ContainsKey(e.Value)) e.Cancel = true;
+    }
+    private void Symbol_NameChanged(object sender, EventArgs e) {
+      ISymbol symbol = (ISymbol)sender;
+      string oldName = symbols.Where(x => x.Value == symbol).First().Key;
+      string newName = symbol.Name;
+
+      symbols.Remove(oldName);
+      symbols.Add(newName, symbol);
+
+      var subtreeCount = symbolSubtreeCount[oldName];
+      symbolSubtreeCount.Remove(oldName);
+      symbolSubtreeCount.Add(newName, subtreeCount);
+
+      List<string> allowedChilds;
+      if (allowedChildSymbols.TryGetValue(oldName, out allowedChilds)) {
+        allowedChildSymbols.Remove(oldName);
+        allowedChildSymbols.Add(newName, allowedChilds);
+      }
+
+      for (int i = 0; i < GetMaximumSubtreeCount(symbol); i++) {
+        if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(oldName, i), out allowedChilds)) {
+          allowedChildSymbolsPerIndex.Remove(Tuple.Create(oldName, i));
+          allowedChildSymbolsPerIndex.Add(Tuple.Create(newName, i), allowedChilds);
+        }
+      }
+
+      foreach (var parent in Symbols) {
+        if (allowedChildSymbols.TryGetValue(parent.Name, out allowedChilds))
+          if (allowedChilds.Remove(oldName))
+            allowedChilds.Add(newName);
+
+        for (int i = 0; i < GetMaximumSubtreeCount(parent); i++) {
+          if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, i), out allowedChilds))
+            if (allowedChilds.Remove(oldName)) allowedChilds.Add(newName);
+        }
+      }
+
       ClearCaches();
     }
@@ -126,5 +188,4 @@
       symbolSubtreeCount.Remove(symbol.Name);
 
-
       foreach (var parent in Symbols) {
         List<string> allowedChilds;
@@ -137,4 +198,5 @@
         }
       }
+      DeregisterSymbolEvents(symbol);
       ClearCaches();
     }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeGrammar.cs	(revision 6233)
@@ -36,4 +36,6 @@
     }
     public override IDeepCloneable Clone(Cloner cloner) {
+      foreach (ISymbol symbol in base.Symbols)
+        cloner.RegisterClonedObject(symbol, symbol);
       return new SymbolicExpressionTreeGrammar(this, cloner);
     }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs	(revision 6233)
@@ -45,5 +45,5 @@
     protected SymbolicExpressionTreeTerminalNode() : base() { }
 
-    protected SymbolicExpressionTreeTerminalNode(Symbol symbol)
+    protected SymbolicExpressionTreeTerminalNode(ISymbol symbol)
       : base() {
       // symbols are reused
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTopLevelNode.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTopLevelNode.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTopLevelNode.cs	(revision 6233)
@@ -42,5 +42,5 @@
     }
     public SymbolicExpressionTreeTopLevelNode() : base() { }
-    public SymbolicExpressionTreeTopLevelNode(Symbol symbol) : base(symbol) { }
+    public SymbolicExpressionTreeTopLevelNode(ISymbol symbol) : base(symbol) { }
 
 
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 6233)
@@ -38,8 +38,4 @@
     }
 
-    public override bool CanChangeDescription {
-      get { return false; }
-    }
-
     [StorableConstructor]
     private Argument(bool deserializing) : base(deserializing) { }
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 6233)
@@ -20,5 +20,4 @@
 #endregion
 
-using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -38,8 +37,4 @@
     public string FunctionName {
       get { return functionName; }
-      set {
-        if (value == null) throw new ArgumentNullException();
-        functionName = value;
-      }
     }
 
@@ -53,5 +48,5 @@
     public InvokeFunction(string functionName)
       : base("Invoke: " + functionName, InvokeFunction.InvokeFunctionDescription) {
-      this.FunctionName = functionName;
+      this.functionName = functionName;
     }
 
Index: /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 6233)
@@ -43,5 +43,5 @@
     }
     public override bool CanChangeName {
-      get { return false; }
+      get { return !(this is IReadOnlySymbol); }
     }
     public override bool CanChangeDescription {
@@ -56,8 +56,4 @@
       initialFrequency = original.initialFrequency;
     }
-    protected Symbol()
-      : base() {
-      initialFrequency = 1.0;
-    }
 
     protected Symbol(string name, string description)
@@ -65,5 +61,4 @@
       initialFrequency = 1.0;
     }
-
 
     public virtual ISymbolicExpressionTreeNode CreateTreeNode() {
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs	(revision 6233)
@@ -20,15 +20,11 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Operators;
-using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Optimization;
-using System;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
@@ -149,6 +145,10 @@
       } else {
         var mainBranch = startNode.GetSubtree(0);
+        var product = MakeProduct(mainBranch, beta);
         startNode.RemoveSubtree(0);
-        var scaledMainBranch = MakeSum(MakeProduct(beta, mainBranch), alpha);
+        startNode.AddSubtree(product);
+
+        var scaledMainBranch = MakeSum(product, alpha);
+        startNode.RemoveSubtree(0);
         startNode.AddSubtree(scaledMainBranch);
       }
@@ -159,5 +159,7 @@
         return treeNode;
       } else {
-        var node = (new Addition()).CreateTreeNode();
+        var addition = treeNode.Grammar.Symbols.OfType<Addition>().FirstOrDefault();
+        if (addition == null) addition = new Addition();
+        var node = addition.CreateTreeNode();
         var alphaConst = MakeConstant(alpha);
         node.AddSubtree(treeNode);
@@ -167,9 +169,11 @@
     }
 
-    private static ISymbolicExpressionTreeNode MakeProduct(double beta, ISymbolicExpressionTreeNode treeNode) {
+    private static ISymbolicExpressionTreeNode MakeProduct(ISymbolicExpressionTreeNode treeNode, double beta) {
       if (beta.IsAlmost(1.0)) {
         return treeNode;
       } else {
-        var node = (new Multiplication()).CreateTreeNode();
+        var multipliciation = treeNode.Grammar.Symbols.OfType<Multiplication>().FirstOrDefault();
+        if (multipliciation == null) multipliciation = new Multiplication();
+        var node = multipliciation.CreateTreeNode();
         var betaConst = MakeConstant(beta);
         node.AddSubtree(treeNode);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs	(revision 6233)
@@ -21,4 +21,5 @@
 
 using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -94,6 +95,10 @@
       } else {
         var mainBranch = startNode.GetSubtree(0);
+        var product = MakeProduct(mainBranch, beta);
         startNode.RemoveSubtree(0);
-        var scaledMainBranch = MakeSum(MakeProduct(beta, mainBranch), alpha);
+        startNode.AddSubtree(product);
+
+        var scaledMainBranch = MakeSum(product, alpha);
+        startNode.RemoveSubtree(0);
         startNode.AddSubtree(scaledMainBranch);
       }
@@ -104,5 +109,7 @@
         return treeNode;
       } else {
-        var node = (new Addition()).CreateTreeNode();
+        var addition = treeNode.Grammar.Symbols.OfType<Addition>().FirstOrDefault();
+        if (addition == null) addition = new Addition();
+        var node = addition.CreateTreeNode();
         var alphaConst = MakeConstant(alpha);
         node.AddSubtree(treeNode);
@@ -112,9 +119,11 @@
     }
 
-    private static ISymbolicExpressionTreeNode MakeProduct(double beta, ISymbolicExpressionTreeNode treeNode) {
+    private static ISymbolicExpressionTreeNode MakeProduct(ISymbolicExpressionTreeNode treeNode, double beta) {
       if (beta.IsAlmost(1.0)) {
         return treeNode;
       } else {
-        var node = (new Multiplication()).CreateTreeNode();
+        var multipliciation = treeNode.Grammar.Symbols.OfType<Multiplication>().FirstOrDefault();
+        if (multipliciation == null) multipliciation = new Multiplication();
+        var node = multipliciation.CreateTreeNode();
         var betaConst = MakeConstant(beta);
         node.AddSubtree(treeNode);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs	(revision 6233)
@@ -75,5 +75,5 @@
     }
 
-    private new void RecalculateResults() {
+    private void RecalculateResults() {
       ModelLength = Model.SymbolicExpressionTree.Length;
       ModelDepth = Model.SymbolicExpressionTree.Depth;
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs	(revision 6233)
@@ -23,11 +23,11 @@
 using System.Linq;
 using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Data;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Core.Views;
-using HeuristicLab.Collections;
 
 
@@ -81,4 +81,5 @@
     protected override void OnContentChanged() {
       base.OnContentChanged();
+      variableNamesView.Content.Clear();
       UpdateControl();
     }
@@ -162,5 +163,5 @@
       } else {
         var existingEntries = variableNamesView.Content.Select(x => x.Value);
-        
+
         // temporarily deregister to prevent circular calling of events
         DeregisterVariableNamesViewContentEvents();
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs	(revision 6232)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs	(revision 6233)
@@ -21,8 +21,7 @@
 
 using System.Collections.Generic;
-using HeuristicLab.Core;
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IRegressionEnsembleSolution : IRegressionSolution {
-    IRegressionEnsembleModel Model { get; }
+    new IRegressionEnsembleModel Model { get; }
     IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(Dataset dataset, IEnumerable<int> rows);
   }
