Index: /branches/3040_VectorBasedGP/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 17604)
@@ -33,4 +33,7 @@
     bool HasLocalParameters { get; }
 
+    // Can be null for "unknown"
+    Type DataType { get; }
+
     int GetDepth();
     int GetLength();
Index: /branches/3040_VectorBasedGP/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 17604)
@@ -96,4 +96,8 @@
     }
 
+    public virtual Type DataType {
+      get { return null; }
+    }
+
     public virtual IEnumerable<ISymbolicExpressionTreeNode> Subtrees {
       get { return subtrees; }
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 17604)
@@ -315,5 +315,5 @@
     private void btnSimplify_Click(object sender, EventArgs e) {
       if (Content.Model.Interpreter is SymbolicDataAnalysisExpressionTreeVectorInterpreter interpreter) { // TODO: Own interface for data-dependent node-types-interpreter?
-        var simplifier = new VectorTreeSimplifier(interpreter, Content.ProblemData);
+        var simplifier = new VectorTreeSimplifier(interpreter);
         var simplifiedExpressionTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree);
         UpdateModel(simplifiedExpressionTree);
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/VectorTreeSimplifier.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/VectorTreeSimplifier.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/VectorTreeSimplifier.cs	(revision 17604)
@@ -27,4 +27,6 @@
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
@@ -66,9 +68,7 @@
 
     private readonly SymbolicDataAnalysisExpressionTreeVectorInterpreter interpreter;
-    private readonly IDataAnalysisProblemData problemData;
-
-    public VectorTreeSimplifier(SymbolicDataAnalysisExpressionTreeVectorInterpreter interpreter, IDataAnalysisProblemData problemData) {
+
+    public VectorTreeSimplifier(SymbolicDataAnalysisExpressionTreeVectorInterpreter interpreter) {
       this.interpreter = interpreter;
-      this.problemData = problemData;
     }
 
@@ -286,10 +286,8 @@
     #region type predicates
     public bool IsScalarNode(ISymbolicExpressionTreeNode node) {
-      var results = interpreter.EvaluateNode(node, problemData.Dataset, problemData.TrainingIndices);
-      return results.All(r => r.IsScalar);
+      return interpreter.GetNodeType(node) == typeof(double);
     }
     public bool IsVectorNode(ISymbolicExpressionTreeNode node) {
-      var results = interpreter.EvaluateNode(node, problemData.Dataset, problemData.TrainingIndices);
-      return results.All(r => r.IsVector);
+      return interpreter.GetNodeType(node) == typeof(DoubleVector);
     }
     #endregion
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentVectorExpressionGrammar.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentVectorExpressionGrammar.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentVectorExpressionGrammar.cs	(revision 17604)
@@ -130,5 +130,5 @@
       var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { square, sqrt, cube, cubeRoot, power, root });
       var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variable, binFactorVariable, factorVariable });
-      var statisticsSymbols = new GroupSymbol(VectorStatisticsName, new List<ISymbol> {mean, sd, sum, length, min, max, variance, skewness, kurtosis});
+      var statisticsSymbols = new GroupSymbol(VectorStatisticsName, new List<ISymbol> { mean, sd, sum, length, min, max, variance, skewness, kurtosis });
       var distancesSymbols = new GroupSymbol(VectorDistancesName, new List<ISymbol> { euclideanDistance, covariance });
       var aggregationSymbols = new GroupSymbol(VectorAggregationName, new List<ISymbol> { statisticsSymbols, distancesSymbols });
@@ -217,4 +217,5 @@
           varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<double>(x));
           varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<double>(x));
+          varSymbol.VariableDataType = typeof(double);
         }
       }
@@ -223,4 +224,5 @@
           varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<DoubleVector>(x));
           varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<DoubleVector>(x));
+          varSymbol.VariableDataType = typeof(DoubleVector);
         }
       }
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs	(revision 17604)
@@ -46,4 +46,11 @@
       Exception
     }
+
+    #region Aggregation Symbols
+    private static Type[] AggregationSymbols = new[] {
+      typeof(Sum), typeof(Mean), typeof(Length), typeof(StandardDeviation), typeof(Variance),
+      typeof(EuclideanDistance), typeof(Covariance)
+    };
+    #endregion
 
     private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
@@ -254,23 +261,16 @@
     }
 
-    public virtual IEnumerable<EvaluationResult> EvaluateNode(ISymbolicExpressionTreeNode node, IDataset dataset, IEnumerable<int> rows) {
-      //lock (syncRoot) {
-      //  EvaluatedSolutions++; // increment the evaluated solutions counter
-      //}
-
-      var startNode = new StartSymbol().CreateTreeNode();
-      startNode.AddSubtree(node);
-      var programNode = new ProgramRootSymbol().CreateTreeNode();
-      programNode.AddSubtree(startNode);
-      var tree = new SymbolicExpressionTree(programNode);
-
-      var state = PrepareInterpreterState(tree, dataset);
-
-      foreach (var rowEnum in rows) {
-        int row = rowEnum;
-        var result = Evaluate(dataset, ref row, state);
-        yield return result;
-        state.Reset();
-      }
+    public virtual Type GetNodeType(ISymbolicExpressionTreeNode node) {
+      if (node.DataType != null)
+        return node.DataType;
+
+      if (AggregationSymbols.Contains(node.Symbol.GetType()))
+        return typeof(double);
+
+      var argumentTypes = node.Subtrees.Select(GetNodeType);
+      if (argumentTypes.Any(t => t == typeof(DoubleVector)))
+        return typeof(DoubleVector);
+
+      return typeof(double);
     }
 
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ConstantTreeNode.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ConstantTreeNode.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ConstantTreeNode.cs	(revision 17604)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -37,4 +38,8 @@
       get { return constantValue; }
       set { constantValue = value; }
+    }
+
+    public override Type DataType {
+      get { return typeof(double); }
     }
 
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs	(revision 17604)
@@ -44,4 +44,8 @@
       get { return variableName; }
       set { variableName = value; }
+    }
+
+    public override Type DataType {
+      get { return typeof(double); }
     }
 
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs	(revision 17604)
@@ -142,4 +142,15 @@
       get { return maximumArity; }
     }
+
+    [Storable]
+    private Type variableDataType;
+    public Type VariableDataType {
+      get { return variableDataType; }
+      set {
+        if (variableDataType == value) return;
+        variableDataType = value;
+        OnChanged(EventArgs.Empty);
+      }
+    }
     #endregion
 
@@ -166,4 +177,5 @@
       multiplicativeWeightManipulatorSigma = original.multiplicativeWeightManipulatorSigma;
       variableChangeProbability = original.variableChangeProbability;
+      variableDataType = original.variableDataType;
     }
     protected VariableBase(string name, string description)
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs	(revision 17603)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs	(revision 17604)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -42,4 +43,8 @@
       get { return variableName; }
       set { variableName = value; }
+    }
+
+    public override Type DataType {
+      get { return Symbol.VariableDataType; }
     }
 
