Index: /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.cs
===================================================================
--- /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.cs	(revision 18067)
+++ /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.cs	(revision 18068)
@@ -22,5 +22,4 @@
     private const string ProblemDataParameterName = "ProblemData";
     private const string StructureDefinitionParameterName = "Structure Definition";
-    private const string GrammarParameterName = "Grammar";
     private const string StructureTemplateParameterName = "Structure Template";
     #endregion
@@ -30,5 +29,4 @@
     public IFixedValueParameter<StringValue> StructureDefinitionParameter => (IFixedValueParameter<StringValue>)Parameters[StructureDefinitionParameterName];
     public IFixedValueParameter<StructureTemplate> StructureTemplateParameter => (IFixedValueParameter<StructureTemplate>)Parameters[StructureTemplateParameterName];
-    public IValueParameter<ISymbolicDataAnalysisGrammar> GrammarParameter => (IValueParameter<ISymbolicDataAnalysisGrammar>)Parameters[GrammarParameterName];
     #endregion
 
@@ -51,9 +49,4 @@
     }
 
-    public ISymbolicDataAnalysisGrammar Grammar {
-      get => GrammarParameter.Value;
-      set => GrammarParameter.Value = value;
-    }
-
     IParameter IDataAnalysisProblem.ProblemDataParameter => ProblemDataParameter;
     IDataAnalysisProblemData IDataAnalysisProblem.ProblemData => ProblemData;
@@ -69,9 +62,4 @@
     public StructuredSymbolicRegressionSingleObjectiveProblem() {
       var problemData = new ShapeConstrainedRegressionProblemData();
-      var grammar = new LinearScalingGrammar();
-      var varSym = (Variable)grammar.GetSymbol("Variable");
-      varSym.AllVariableNames = problemData.InputVariables.Select(x => x.Value);
-      varSym.VariableNames = problemData.InputVariables.Select(x => x.Value);
-      varSym.Enabled = true;
 
       var structureTemplate = new StructureTemplate();
@@ -80,7 +68,5 @@
       Parameters.Add(new ValueParameter<IRegressionProblemData>(ProblemDataParameterName, problemData));
       Parameters.Add(new FixedValueParameter<StructureTemplate>(StructureTemplateParameterName, structureTemplate));
-      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(GrammarParameterName, grammar));
 
-      //structureTemplate.Template = "f(x)*f(y)+5";
     }
 
@@ -97,9 +83,15 @@
 
     private void OnTemplateChanged(object sender, EventArgs args) {
+      SetupStructureTemplate();
+    }
+
+    private void SetupStructureTemplate() {
       foreach (var e in Encoding.Encodings.ToArray())
         Encoding.Remove(e);
 
-      foreach (var sf in StructureTemplate.SubFunctions.Values) {
-        Encoding.Add(new SymbolicExpressionTreeEncoding(sf.Name, sf.Grammar, sf.MaximumSymbolicExpressionTreeLength, sf.MaximumSymbolicExpressionTreeDepth));
+      foreach (var f in StructureTemplate.SubFunctions.Values) {
+        SetupVariables(f);
+        if(!Encoding.Encodings.Any(x => x.Name == f.Name)) // to prevent the same encoding twice
+          Encoding.Add(new SymbolicExpressionTreeEncoding(f.Name, f.Grammar, f.MaximumSymbolicExpressionTreeLength, f.MaximumSymbolicExpressionTreeDepth));
       }
     }
@@ -122,13 +114,4 @@
       else
         results.Add(new Result("Best Tree", BuildTree(individuals[bestIdx])));
-
-      /*
-      if (results.TryGetValue("Tree", out IResult result)) {
-        var list = result.Value as ItemList<ISymbolicExpressionTree>;
-        list.Clear();
-        list.AddRange(individuals.Select(x => (BuildTree(x))));
-      } else 
-        results.Add(new Result("Tree", new ItemList<ISymbolicExpressionTree>(individuals.Select(x => (BuildTree(x))))));
-      */
     }
 
@@ -152,5 +135,5 @@
         if (n.Symbol is SubFunctionSymbol) {
           var subFunctionTreeNode = n as SubFunctionTreeNode;
-          var subFunctionTree = individual.SymbolicExpressionTree(subFunctionTreeNode.SubFunction.Name);
+          var subFunctionTree = individual.SymbolicExpressionTree(subFunctionTreeNode.Name);
           var parent = n.Parent;
 
@@ -167,6 +150,40 @@
     }
 
+    private void SetupVariables(SubFunction subFunction) {
+      var varSym = (Variable)subFunction.Grammar.GetSymbol("Variable");
+      if (varSym == null) {
+        varSym = new Variable();
+        subFunction.Grammar.AddSymbol(varSym);
+      }
+
+      var allVariables = ProblemData.InputVariables.Select(x => x.Value);
+      var allInputs = allVariables.Where(x => x != ProblemData.TargetVariable);
+
+      // set all variables
+      varSym.AllVariableNames = allVariables;
+
+      // set all allowed variables
+      if (subFunction.Arguments.Contains("_")) {
+        varSym.VariableNames = allInputs;
+      } else {
+        var vars = new List<string>();
+        var exceptions = new List<Exception>();
+        foreach (var arg in subFunction.Arguments) {
+          if (allInputs.Contains(arg))
+            vars.Add(arg);
+          else
+            exceptions.Add(new ArgumentException($"The argument '{arg}' for sub-function '{subFunction.Name}' is not a valid variable."));
+        }
+        if (exceptions.Any())
+          throw new AggregateException(exceptions);
+        varSym.VariableNames = vars;
+      }
+
+      varSym.Enabled = true;
+    }
+
     public void Load(RegressionProblemData data) {
       ProblemData = data;
+      SetupStructureTemplate();
     }
   }
Index: /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.Designer.cs
===================================================================
--- /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.Designer.cs	(revision 18067)
+++ /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.Designer.cs	(revision 18068)
@@ -30,9 +30,9 @@
       this.expressionInput = new System.Windows.Forms.TextBox();
       this.parseButton = new System.Windows.Forms.Button();
-      this.errorLabel = new System.Windows.Forms.Label();
-      this.symRegTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.GraphicalSymbolicExpressionTreeView();
+      this.infoLabel = new System.Windows.Forms.Label();
       this.templateStructureGroupBox = new System.Windows.Forms.GroupBox();
       this.treeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
       this.templateStructureGroupBox.SuspendLayout();
@@ -41,4 +41,5 @@
       this.splitContainer.Panel2.SuspendLayout();
       this.splitContainer.SuspendLayout();
+      this.detailsGroupBox.SuspendLayout();
       this.SuspendLayout();
       // 
@@ -51,5 +52,5 @@
       this.expressionInput.Size = new System.Drawing.Size(288, 20);
       this.expressionInput.TabIndex = 1;
-      this.expressionInput.TextChanged += new System.EventHandler(this.expressionInput_TextChanged);
+      this.expressionInput.TextChanged += new System.EventHandler(this.ExpressionInputTextChanged);
       // 
       // parseButton
@@ -61,34 +62,20 @@
       this.parseButton.Text = "Parse";
       this.parseButton.UseVisualStyleBackColor = true;
-      this.parseButton.Click += new System.EventHandler(this.parseButton_Click);
+      this.parseButton.Click += new System.EventHandler(this.ParseButtonClick);
       // 
       // errorLabel
       // 
-      this.errorLabel.AutoSize = true;
-      this.errorLabel.Location = new System.Drawing.Point(155, 50);
-      this.errorLabel.Name = "errorLabel";
-      this.errorLabel.Size = new System.Drawing.Size(54, 13);
-      this.errorLabel.TabIndex = 4;
-      this.errorLabel.Text = "errorLabel";
-      // 
-      // symRegTreeChart
-      // 
-      this.symRegTreeChart.AllowDrop = true;
-      this.symRegTreeChart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-      this.symRegTreeChart.Caption = "Graphical SymbolicExpressionTree View";
-      this.symRegTreeChart.Content = null;
-      this.symRegTreeChart.Location = new System.Drawing.Point(6, 74);
-      this.symRegTreeChart.Name = "symRegTreeChart";
-      this.symRegTreeChart.ReadOnly = false;
-      this.symRegTreeChart.Size = new System.Drawing.Size(288, 153);
-      this.symRegTreeChart.TabIndex = 6;
+      this.infoLabel.AutoSize = true;
+      this.infoLabel.Location = new System.Drawing.Point(155, 50);
+      this.infoLabel.Name = "errorLabel";
+      this.infoLabel.Size = new System.Drawing.Size(54, 13);
+      this.infoLabel.TabIndex = 4;
+      this.infoLabel.Text = "errorLabel";
       // 
       // templateStructureGroupBox
       // 
       this.templateStructureGroupBox.Controls.Add(this.treeChart);
-      this.templateStructureGroupBox.Controls.Add(this.symRegTreeChart);
       this.templateStructureGroupBox.Controls.Add(this.parseButton);
-      this.templateStructureGroupBox.Controls.Add(this.errorLabel);
+      this.templateStructureGroupBox.Controls.Add(this.infoLabel);
       this.templateStructureGroupBox.Controls.Add(this.expressionInput);
       this.templateStructureGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -102,9 +89,10 @@
       // treeChart
       // 
-      this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)(((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;
       this.treeChart.LineColor = System.Drawing.Color.Black;
-      this.treeChart.Location = new System.Drawing.Point(6, 233);
+      this.treeChart.Location = new System.Drawing.Point(6, 74);
       this.treeChart.MinimumHorizontalDistance = 30;
       this.treeChart.MinimumHorizontalPadding = 20;
@@ -114,5 +102,5 @@
       this.treeChart.PreferredNodeHeight = 46;
       this.treeChart.PreferredNodeWidth = 70;
-      this.treeChart.Size = new System.Drawing.Size(288, 150);
+      this.treeChart.Size = new System.Drawing.Size(288, 320);
       this.treeChart.SuspendRepaint = false;
       this.treeChart.TabIndex = 7;
@@ -134,9 +122,20 @@
       // splitContainer.Panel2
       // 
-      this.splitContainer.Panel2.Controls.Add(this.viewHost);
+      this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox);
       this.splitContainer.Panel2MinSize = 5;
       this.splitContainer.Size = new System.Drawing.Size(600, 400);
       this.splitContainer.SplitterDistance = 300;
       this.splitContainer.TabIndex = 10;
+      // 
+      // detailsGroupBox
+      // 
+      this.detailsGroupBox.Controls.Add(this.viewHost);
+      this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.detailsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.detailsGroupBox.Name = "detailsGroupBox";
+      this.detailsGroupBox.Size = new System.Drawing.Size(296, 400);
+      this.detailsGroupBox.TabIndex = 9;
+      this.detailsGroupBox.TabStop = false;
+      this.detailsGroupBox.Text = "Details";
       // 
       // viewHost
@@ -146,8 +145,8 @@
       this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
       this.viewHost.Enabled = false;
-      this.viewHost.Location = new System.Drawing.Point(0, 0);
+      this.viewHost.Location = new System.Drawing.Point(3, 16);
       this.viewHost.Name = "viewHost";
       this.viewHost.ReadOnly = false;
-      this.viewHost.Size = new System.Drawing.Size(296, 400);
+      this.viewHost.Size = new System.Drawing.Size(290, 381);
       this.viewHost.TabIndex = 8;
       this.viewHost.ViewsLabelVisible = true;
@@ -167,4 +166,5 @@
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
       this.splitContainer.ResumeLayout(false);
+      this.detailsGroupBox.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -174,10 +174,10 @@
     private System.Windows.Forms.TextBox expressionInput;
     private System.Windows.Forms.Button parseButton;
-    private System.Windows.Forms.Label errorLabel;
-    private Encodings.SymbolicExpressionTreeEncoding.Views.GraphicalSymbolicExpressionTreeView symRegTreeChart;
+    private System.Windows.Forms.Label infoLabel;
     private System.Windows.Forms.GroupBox templateStructureGroupBox;
     private System.Windows.Forms.SplitContainer splitContainer;
     private Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart treeChart;
     private MainForm.WindowsForms.ViewHost viewHost;
+    private System.Windows.Forms.GroupBox detailsGroupBox;
   }
 }
Index: /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.cs
===================================================================
--- /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.cs	(revision 18067)
+++ /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.cs	(revision 18068)
@@ -24,13 +24,15 @@
     public StructureTemplateView() {
       InitializeComponent();
-      errorLabel.Text = "";
-      treeChart.SymbolicExpressionTreeNodeClicked += TreeChart_SymbolicExpressionTreeNodeClicked;
+      infoLabel.Text = "";
+      treeChart.SymbolicExpressionTreeNodeClicked += SymbolicExpressionTreeNodeClicked;
+      
     }
 
-    private void TreeChart_SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
+    private void SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
       var visualTreeNode = sender as VisualTreeNode<ISymbolicExpressionTreeNode>;
       if(visualTreeNode != null) {
         var subFunctionTreeNode = visualTreeNode.Content as SubFunctionTreeNode;
-        viewHost.Content = subFunctionTreeNode?.SubFunction;
+        if(Content.SubFunctions.TryGetValue(subFunctionTreeNode.Name, out SubFunction subFunction))
+          viewHost.Content = subFunction;
       }
     }
@@ -39,35 +41,42 @@
       base.OnContentChanged();
       if (Content == null) return;
-
       expressionInput.Text = Content.Template;
-      symRegTreeChart.Content = Content.Tree;
-
-      treeChart.Tree = Content.Tree;
-
-      errorLabel.Text = "";
-      
+      PaintTree();
+      infoLabel.Text = "";
     }
 
-    private void parseButton_Click(object sender, EventArgs e) {
+    private void ParseButtonClick(object sender, EventArgs e) {
       if(!string.IsNullOrEmpty(expressionInput.Text)) {
         try {
           Content.Template = expressionInput.Text;
-          symRegTreeChart.Content = Content.Tree;
-          treeChart.Tree = Content.Tree;
-
-          errorLabel.Text = "Template structure successfully parsed.";
-          errorLabel.ForeColor = Color.DarkGreen;
+          PaintTree();
+          infoLabel.Text = "Template structure successfully parsed.";
+          infoLabel.ForeColor = Color.DarkGreen;
         } catch (Exception ex) {
-          errorLabel.Text = ex.Message;
-          errorLabel.ForeColor = Color.DarkRed;
+          infoLabel.Text = ex.Message;
+          infoLabel.ForeColor = Color.DarkRed;
         }
       }
     }
 
-    private void expressionInput_TextChanged(object sender, EventArgs e) {
-      errorLabel.Text = "Unparsed changes! Press parse button to save changes.";
-      errorLabel.ForeColor = Color.DarkOrange;
+    private void ExpressionInputTextChanged(object sender, EventArgs e) {
+      infoLabel.Text = "Unparsed changes! Press parse button to save changes.";
+      infoLabel.ForeColor = Color.DarkOrange;
     }
 
+
+    private void PaintTree() {
+      if(Content != null && Content.Tree != null) {
+        treeChart.Tree = Content.Tree;
+        foreach (var n in Content.Tree.IterateNodesPrefix()) {
+          if (n.Symbol is SubFunctionSymbol) {
+            var visualNode = treeChart.GetVisualSymbolicExpressionTreeNode(n);
+            visualNode.FillColor = Color.LightCyan;
+            visualNode.LineColor = Color.SlateGray;
+          }
+        }
+        treeChart.RepaintNodes();
+      }
+    }
   }
 }
Index: /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs
===================================================================
--- /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs	(revision 18067)
+++ /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/StructureTemplate.cs	(revision 18068)
@@ -1,3 +1,4 @@
 ﻿using System;
+using System.Linq;
 using System.Collections.Generic;
 using HeuristicLab.Core;
@@ -17,10 +18,8 @@
       get => template; 
       set {
-        if(template != value) {
-          template = value;
-          tree = Parser.Parse(template);
-          GetSubFunctions(Tree);
-          OnChanged();
-        }
+        template = value;
+        tree = Parser.Parse(template);
+        GetSubFunctions(Tree);
+        OnChanged();
       } 
     }
@@ -31,7 +30,8 @@
 
     [Storable]
-    public IDictionary<SubFunctionTreeNode, SubFunction> SubFunctions { get; private set; } = new Dictionary<SubFunctionTreeNode, SubFunction>();
+    public IReadOnlyDictionary<string, SubFunction> SubFunctions { get; private set; } = new Dictionary<string, SubFunction>();
 
     protected InfixExpressionParser Parser { get; set; } = new InfixExpressionParser();
+
     #endregion
 
@@ -57,16 +57,28 @@
 
     private void GetSubFunctions(ISymbolicExpressionTree tree) {
-      int count = 1;
-      SubFunctions.Clear();
+      var subFunctions = new Dictionary<string, SubFunction>();
       foreach (var node in tree.IterateNodesPrefix())
-        if (node is SubFunctionTreeNode subFunctionTreeNode) { 
-          var subFunction = new SubFunction() { 
-            Name = $"f{count++}({string.Join(",", subFunctionTreeNode.Arguments)})", 
-            FunctionArguments = subFunctionTreeNode.Arguments 
-          };
-          subFunctionTreeNode.SubFunction = subFunction;
-          SubFunctions.Add(subFunctionTreeNode, subFunction);
+        if (node is SubFunctionTreeNode subFunctionTreeNode) {
+          if (!subFunctionTreeNode.Arguments.Any())
+            throw new ArgumentException($"The sub-function '{subFunctionTreeNode}' requires inputs (e.g. {subFunctionTreeNode.Name}(var1, var2)).");
+
+          if (subFunctions.TryGetValue(subFunctionTreeNode.Name, out SubFunction v)) {
+            if(!v.Arguments.SequenceEqual(subFunctionTreeNode.Arguments))
+              throw new ArgumentException(
+                $"The sub-function '{v.Name}' has (at least two) different signatures " + 
+                $"({v.Name}({string.Join(",", v.Arguments)}) <> {subFunctionTreeNode.Name}({string.Join(",", subFunctionTreeNode.Arguments)})).");
+          } else {
+            var subFunction = new SubFunction() {
+              Name = subFunctionTreeNode.Name,
+              Arguments = subFunctionTreeNode.Arguments
+            };
+            subFunction.Changed += OnSubFunctionChanged;
+            subFunctions.Add(subFunction.Name, subFunction);
+          }
         }
+      SubFunctions = subFunctions;
     }
+
+    private void OnSubFunctionChanged(object sender, EventArgs e) => OnChanged();
   }
 }
Index: /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/SubFunction.cs
===================================================================
--- /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/SubFunction.cs	(revision 18067)
+++ /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/StructureTemplate/SubFunction.cs	(revision 18068)
@@ -18,5 +18,4 @@
     private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
     private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
-    private const string FunctionArgumentsParameterName = "Function Arguments";
     #endregion
 
@@ -25,5 +24,4 @@
     public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter => (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName];
     public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter => (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName];
-    public IValueParameter<ReadOnlyItemList<StringValue>> FunctionArgumentsParameter => (IValueParameter<ReadOnlyItemList<StringValue>>)Parameters[FunctionArgumentsParameterName];
     #endregion
 
@@ -44,18 +42,9 @@
     }
 
-    public IEnumerable<string> FunctionArguments { // TODO: gehört weg
-      get => FunctionArgumentsParameter.Value.Select(x => x.Value); 
-      set {
-        var varSym = (Variable)Grammar.GetSymbol("Variable");
-        if (varSym == null)
-          throw new ArgumentException($"No variable symbol existent.");
+    public IEnumerable<string> Arguments { get; set; }
+    #endregion
 
-        FunctionArgumentsParameter.Value = new ItemList<StringValue>(value.Select(x => new StringValue(x))).AsReadOnly();
-
-        varSym.AllVariableNames = FunctionArguments;
-        varSym.VariableNames = FunctionArguments;
-        varSym.Enabled = true;
-      } 
-    }
+    #region Events
+    public event EventHandler Changed;
     #endregion
 
@@ -65,6 +54,12 @@
       Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, new IntValue(10)));
       Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, new IntValue(30)));
-      Parameters.Add(new ValueParameter<ReadOnlyItemList<StringValue>>(FunctionArgumentsParameterName, new ReadOnlyItemList<StringValue>()));
+
+      // TODO: separate events for each parameter
+      GrammarParameter.ValueChanged += OnParameterValueChanged;
+      MaximumSymbolicExpressionTreeDepthParameter.Value.ValueChanged += OnParameterValueChanged; 
+      MaximumSymbolicExpressionTreeLengthParameter.Value.ValueChanged += OnParameterValueChanged;
     }
+
+    private void OnParameterValueChanged(object sender, EventArgs e) => Changed?.Invoke(this, EventArgs.Empty);
 
     protected SubFunction(SubFunction original, Cloner cloner) { }
Index: /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionSymbol.cs
===================================================================
--- /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionSymbol.cs	(revision 18067)
+++ /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionSymbol.cs	(revision 18068)
@@ -9,6 +9,6 @@
   [Item("SubFunctionSymbol", "Symbol that represents a sub function.")]
   public class SubFunctionSymbol : Symbol {
-    public override int MinimumArity => 1;
-    public override int MaximumArity => byte.MaxValue;
+    public override int MinimumArity => 0;
+    public override int MaximumArity => 1;
 
     public SubFunctionSymbol() : base("SubFunctionSymbol", "Symbol that represents a sub function.") { }
Index: /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionTreeNode.cs
===================================================================
--- /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionTreeNode.cs	(revision 18067)
+++ /branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SubFunctionTreeNode.cs	(revision 18068)
@@ -10,5 +10,5 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableType("05130B5F-0125-4367-A4E9-C42D1085024E")]
-  public class SubFunctionTreeNode : SymbolicExpressionTreeNode { //TODO: as TerminalNode? -> but has children in a fully builded tree
+  public class SubFunctionTreeNode : SymbolicExpressionTreeNode {
 
     #region Properties
@@ -17,6 +17,4 @@
     public IEnumerable<string> Arguments { get; set; } = Enumerable.Empty<string>();
     
-    public SubFunction SubFunction { get; set; }
-
     public string Name { get; set; }
     #endregion
@@ -28,7 +26,5 @@
     protected SubFunctionTreeNode(StorableConstructorFlag _) : base(_) { }
 
-    protected SubFunctionTreeNode(SubFunctionTreeNode original, Cloner cloner) : base(original, cloner) {
-      this.SubFunction = original.SubFunction;
-    }
+    protected SubFunctionTreeNode(SubFunctionTreeNode original, Cloner cloner) : base(original, cloner) { }
     #endregion
 
@@ -40,5 +36,5 @@
       if (string.IsNullOrEmpty(Name))
         return base.ToString();
-      return Name;
+      return $"{Name}({string.Join(",", Arguments)})";
     }
     
