Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/DataAnalysisGrammar.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/DataAnalysisGrammar.cs	(revision 17459)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/DataAnalysisGrammar.cs	(revision 17460)
@@ -35,5 +35,5 @@
     protected DataAnalysisGrammar(string name, string description) : base(name, description) { }
 
-    public void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
+    public virtual void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
       var dataset = problemData.Dataset;
       foreach (var varSymbol in Symbols.OfType<VariableBase>()) {
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalVectorExpressionGrammar.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalVectorExpressionGrammar.cs	(revision 17460)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalVectorExpressionGrammar.cs	(revision 17460)
@@ -0,0 +1,147 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableType("C913F5C6-AF16-4F2C-BA93-2D5AE1F8E68A")]
+  [Item("FullFunctionalVectorExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
+  public class FullFunctionalVectorExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
+    [StorableConstructor]
+    protected FullFunctionalVectorExpressionGrammar(StorableConstructorFlag _) : base(_) { }
+    protected FullFunctionalVectorExpressionGrammar(FullFunctionalVectorExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public FullFunctionalVectorExpressionGrammar()
+      : base(ItemAttribute.GetName(typeof(FullFunctionalVectorExpressionGrammar)), ItemAttribute.GetDescription(typeof(FullFunctionalVectorExpressionGrammar))) {
+      Initialize();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FullFunctionalVectorExpressionGrammar(this, cloner);
+    }
+
+    private void Initialize() {
+      var add = new Addition();
+      var sub = new Subtraction();
+      var mul = new Multiplication();
+      var div = new Division();
+
+      var sin = new Sine();
+      var cos = new Cosine();
+      var tan = new Tangent();
+
+      var log = new Logarithm();
+      var exp = new Exponential();
+
+
+      var pow = new Power { InitialFrequency = 0.0 };
+      var root = new Root { InitialFrequency = 0.0 };
+      var square = new Square { InitialFrequency = 0.0 };
+      var sqrt = new SquareRoot { InitialFrequency = 0.0 };
+      var cube = new Cube { InitialFrequency = 0.0 };
+      var cubeRoot = new CubeRoot { InitialFrequency = 0.0 };
+
+      var constant = new Constant { MinValue = -20, MaxValue = 20 };
+      var variable = new Variable();
+      var binFactorVariable = new BinaryFactorVariable();
+      var factorVariable = new FactorVariable();
+      var vectorVariable = new Variable() { Name = "Vector Variable" };
+
+      var sum = new Sum();
+      var mean = new Average() { Name = "Mean" };
+
+
+      var allSymbols = new List<Symbol>() {
+        add, sub, mul, div,
+        sin, cos, tan,
+        log, exp,
+        square, sqrt, cube, cubeRoot, pow, root,
+        constant, variable, binFactorVariable, factorVariable, vectorVariable,
+        sum, mean
+      };
+      var unaryFunctionSymbols = new List<Symbol>() {
+        sin, cos, tan,
+        log, exp
+      };
+
+      var binaryFunctionSymbols = new List<Symbol>() { pow, root };
+      var ternarySymbols = new List<Symbol>() { add, sub, mul, div };
+      var terminalSymbols = new List<Symbol>() { variable, binFactorVariable, factorVariable, vectorVariable, constant };
+
+      var aggregationSymbols = new List<Symbol>() { sum, mean };
+
+      foreach (var symb in allSymbols)
+        AddSymbol(symb);
+
+      foreach (var funSymb in ternarySymbols) {
+        SetSubtreeCount(funSymb, 1, 3);
+      }
+      foreach (var funSymb in unaryFunctionSymbols) {
+        SetSubtreeCount(funSymb, 1, 1);
+      }
+      foreach (var funSymb in binaryFunctionSymbols) {
+        SetSubtreeCount(funSymb, 2, 2);
+      }
+      foreach (var terminalSymbol in terminalSymbols) {
+        SetSubtreeCount(terminalSymbol, 0, 0);
+      }
+      foreach (var aggrSymb in aggregationSymbols) {
+        SetSubtreeCount(aggrSymb, 1, 1);
+      }
+
+
+      // allow each symbol as child of the start symbol
+      foreach (var symb in allSymbols) {
+        AddAllowedChildSymbol(StartSymbol, symb);
+        AddAllowedChildSymbol(DefunSymbol, symb);
+      }
+
+      // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+      foreach (var parent in allSymbols.Except(terminalSymbols)) {
+        foreach (var child in allSymbols)
+          AddAllowedChildSymbol(parent, child);
+      }
+    }
+
+    public override void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
+      base.ConfigureVariableSymbols(problemData);
+
+      var dataset = problemData.Dataset;
+      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Variable")) {
+        if (!varSymbol.Fixed) {
+          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<double>(x));
+          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<double>(x));
+        }
+      }
+      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Vector Variable")) {
+        if (!varSymbol.Fixed) {
+          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<DoubleVector>(x));
+          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<DoubleVector>(x));
+        }
+      }
+    }
+  }
+}
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 17459)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 17460)
@@ -42,5 +42,4 @@
     private const string SpecialFunctionsName = "Special Functions";
     private const string TimeSeriesSymbolsName = "Time Series Symbols";
-    private const string VectorSymbolsName = "Vector Symbols";
 
     [StorableConstructor]
@@ -250,5 +249,4 @@
       Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
       Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
-      Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
     }
 
@@ -264,5 +262,4 @@
       Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
       Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
-      Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
     }
 
@@ -275,5 +272,4 @@
       Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
       Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
-      Symbols.First(s => s.Name == VectorSymbolsName).Enabled = false;
 
       Symbols.Single(s => s.Name == "Variable").Enabled = false;
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 17460)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentVectorExpressionGrammar.cs	(revision 17460)
@@ -0,0 +1,262 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableType("7EC7B4A7-0E27-4011-B983-B0E15A6944EC")]
+  [Item("TypeCoherentVectorExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that vector and scalar expressions are not mixed.")]
+  public class TypeCoherentVectorExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
+    private const string ArithmeticFunctionsName = "Arithmetic Functions";
+    private const string TrigonometricFunctionsName = "Trigonometric Functions";
+    private const string ExponentialFunctionsName = "Exponential and Logarithmic Functions";
+    private const string RealValuedSymbolsName = "Real Valued Symbols";
+    private const string TerminalsName = "Terminals";
+    private const string PowerFunctionsName = "Power Functions";
+    private const string ConditionsName = "Conditions";
+    private const string ComparisonsName = "Comparisons";
+    private const string BooleanOperatorsName = "Boolean Operators";
+    private const string ConditionalSymbolsName = "ConditionalSymbols";
+    private const string SpecialFunctionsName = "Special Functions";
+    private const string TimeSeriesSymbolsName = "Time Series Symbols";
+
+    [StorableConstructor]
+    protected TypeCoherentVectorExpressionGrammar(StorableConstructorFlag _) : base(_) { }
+    protected TypeCoherentVectorExpressionGrammar(TypeCoherentVectorExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public TypeCoherentVectorExpressionGrammar()
+      : base(ItemAttribute.GetName(typeof(TypeCoherentVectorExpressionGrammar)), ItemAttribute.GetDescription(typeof(TypeCoherentVectorExpressionGrammar))) {
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TypeCoherentVectorExpressionGrammar(this, cloner);
+    }
+
+    private void Initialize() {
+      #region symbol declaration
+      var add = new Addition();
+      var sub = new Subtraction();
+      var mul = new Multiplication();
+      var div = new Division();
+      var mean = new Average();
+      var sin = new Sine();
+      var cos = new Cosine();
+      var tan = new Tangent();
+      var log = new Logarithm();
+      var pow = new Power();
+      var square = new Square();
+      var root = new Root();
+      var sqrt = new SquareRoot();
+      var cube = new Cube();
+      var cubeRoot = new CubeRoot();
+      var exp = new Exponential();
+      var abs = new Absolute();
+
+      var airyA = new AiryA();
+      var airyB = new AiryB();
+      var bessel = new Bessel();
+      var cosineIntegral = new CosineIntegral();
+      var dawson = new Dawson();
+      var erf = new Erf();
+      var expIntegralEi = new ExponentialIntegralEi();
+      var fresnelCosineIntegral = new FresnelCosineIntegral();
+      var fresnelSineIntegral = new FresnelSineIntegral();
+      var gamma = new Gamma();
+      var hypCosineIntegral = new HyperbolicCosineIntegral();
+      var tanh = new HyperbolicTangent();
+      var hypSineIntegral = new HyperbolicSineIntegral();
+      var norm = new Norm();
+      var psi = new Psi();
+      var sineIntegral = new SineIntegral();
+      var analyticalQuotient = new AnalyticQuotient();
+
+      var @if = new IfThenElse();
+      var gt = new GreaterThan();
+      var lt = new LessThan();
+      var and = new And();
+      var or = new Or();
+      var not = new Not();
+      var xor = new Xor();
+      var variableCondition = new VariableCondition();
+
+      var timeLag = new TimeLag();
+      var integral = new Integral();
+      var derivative = new Derivative();
+
+      var constant = new Constant();
+      constant.MinValue = -20;
+      constant.MaxValue = 20;
+      var variableSymbol = new Variable();
+      var binFactorVariable = new BinaryFactorVariable();
+      var factorVariable = new FactorVariable();
+      var laggedVariable = new LaggedVariable();
+      var autoregressiveVariable = new AutoregressiveTargetVariable();
+      #endregion
+
+      #region group symbol declaration
+      var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean });
+      var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan, tanh });
+      var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log });
+      var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi,
+        fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient});
+      var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable });
+      var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols });
+
+      var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { square, pow, sqrt, root, cube, cubeRoot });
+
+      var conditionSymbols = new GroupSymbol(ConditionsName, new List<ISymbol> { @if, variableCondition });
+      var comparisonSymbols = new GroupSymbol(ComparisonsName, new List<ISymbol> { gt, lt });
+      var booleanOperationSymbols = new GroupSymbol(BooleanOperatorsName, new List<ISymbol> { and, or, not, xor });
+      var conditionalSymbols = new GroupSymbol(ConditionalSymbolsName, new List<ISymbol> { conditionSymbols, comparisonSymbols, booleanOperationSymbols });
+
+      var timeSeriesSymbols = new GroupSymbol(TimeSeriesSymbolsName, new List<ISymbol> { timeLag, integral, derivative, laggedVariable, autoregressiveVariable });
+      #endregion
+
+      AddSymbol(realValuedSymbols);
+      AddSymbol(powerSymbols);
+      AddSymbol(conditionalSymbols);
+      AddSymbol(timeSeriesSymbols);
+
+      #region subtree count configuration
+      SetSubtreeCount(arithmeticSymbols, 2, 2);
+      SetSubtreeCount(trigonometricSymbols, 1, 1);
+      SetSubtreeCount(pow, 2, 2);
+      SetSubtreeCount(root, 2, 2);
+      SetSubtreeCount(square, 1, 1);
+      SetSubtreeCount(cube, 1, 1);
+      SetSubtreeCount(sqrt, 1, 1);
+      SetSubtreeCount(cubeRoot, 1, 1);
+      SetSubtreeCount(exponentialAndLogarithmicSymbols, 1, 1);
+      foreach (var sy in specialFunctions.Symbols.Except(new[] { analyticalQuotient })) {
+        SetSubtreeCount(sy, 1, 1);
+      }
+      SetSubtreeCount(analyticalQuotient, 2, 2);
+
+      SetSubtreeCount(terminalSymbols, 0, 0);
+
+      SetSubtreeCount(@if, 3, 3);
+      SetSubtreeCount(variableCondition, 2, 2);
+      SetSubtreeCount(comparisonSymbols, 2, 2);
+      SetSubtreeCount(and, 2, 2);
+      SetSubtreeCount(or, 2, 2);
+      SetSubtreeCount(not, 1, 1);
+      SetSubtreeCount(xor, 2, 2);
+
+      SetSubtreeCount(timeLag, 1, 1);
+      SetSubtreeCount(integral, 1, 1);
+      SetSubtreeCount(derivative, 1, 1);
+      SetSubtreeCount(laggedVariable, 0, 0);
+      SetSubtreeCount(autoregressiveVariable, 0, 0);
+      #endregion
+
+      #region allowed child symbols configuration
+      AddAllowedChildSymbol(StartSymbol, realValuedSymbols);
+      AddAllowedChildSymbol(StartSymbol, powerSymbols);
+      AddAllowedChildSymbol(StartSymbol, conditionSymbols);
+      AddAllowedChildSymbol(StartSymbol, timeSeriesSymbols);
+      AddAllowedChildSymbol(StartSymbol, specialFunctions);
+
+      AddAllowedChildSymbol(DefunSymbol, realValuedSymbols);
+      AddAllowedChildSymbol(DefunSymbol, powerSymbols);
+      AddAllowedChildSymbol(DefunSymbol, conditionSymbols);
+      AddAllowedChildSymbol(DefunSymbol, timeSeriesSymbols);
+      AddAllowedChildSymbol(DefunSymbol, specialFunctions);
+
+      AddAllowedChildSymbol(realValuedSymbols, realValuedSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, powerSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, conditionSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, timeSeriesSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, specialFunctions);
+
+      AddAllowedChildSymbol(powerSymbols, variableSymbol, 0);
+      AddAllowedChildSymbol(powerSymbols, laggedVariable, 0);
+      AddAllowedChildSymbol(powerSymbols, autoregressiveVariable, 0);
+      AddAllowedChildSymbol(powerSymbols, constant, 1);
+
+      AddAllowedChildSymbol(square, realValuedSymbols, 0);
+      AddAllowedChildSymbol(square, conditionSymbols, 0);
+      AddAllowedChildSymbol(square, timeSeriesSymbols, 0);
+
+      AddAllowedChildSymbol(sqrt, realValuedSymbols, 0);
+      AddAllowedChildSymbol(sqrt, conditionSymbols, 0);
+      AddAllowedChildSymbol(sqrt, timeSeriesSymbols, 0);
+
+      AddAllowedChildSymbol(@if, comparisonSymbols, 0);
+      AddAllowedChildSymbol(@if, booleanOperationSymbols, 0);
+      AddAllowedChildSymbol(@if, conditionSymbols, 1);
+      AddAllowedChildSymbol(@if, realValuedSymbols, 1);
+      AddAllowedChildSymbol(@if, powerSymbols, 1);
+      AddAllowedChildSymbol(@if, timeSeriesSymbols, 1);
+      AddAllowedChildSymbol(@if, conditionSymbols, 2);
+      AddAllowedChildSymbol(@if, realValuedSymbols, 2);
+      AddAllowedChildSymbol(@if, powerSymbols, 2);
+      AddAllowedChildSymbol(@if, timeSeriesSymbols, 2);
+
+      AddAllowedChildSymbol(booleanOperationSymbols, comparisonSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, realValuedSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, powerSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, conditionSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, timeSeriesSymbols);
+
+      AddAllowedChildSymbol(variableCondition, realValuedSymbols);
+      AddAllowedChildSymbol(variableCondition, powerSymbols);
+      AddAllowedChildSymbol(variableCondition, conditionSymbols);
+      AddAllowedChildSymbol(variableCondition, timeSeriesSymbols);
+
+
+      AddAllowedChildSymbol(timeLag, realValuedSymbols);
+      AddAllowedChildSymbol(timeLag, powerSymbols);
+      AddAllowedChildSymbol(timeLag, conditionSymbols);
+
+      AddAllowedChildSymbol(integral, realValuedSymbols);
+      AddAllowedChildSymbol(integral, powerSymbols);
+      AddAllowedChildSymbol(integral, conditionSymbols);
+
+      AddAllowedChildSymbol(derivative, realValuedSymbols);
+      AddAllowedChildSymbol(derivative, powerSymbols);
+      AddAllowedChildSymbol(derivative, conditionSymbols);
+      #endregion
+    }
+
+    public override void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
+      base.ConfigureVariableSymbols(problemData);
+
+      var dataset = problemData.Dataset;
+      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Variable")) {
+        if (!varSymbol.Fixed) {
+          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<double>(x));
+          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<double>(x));
+        }
+      }
+      foreach (var varSymbol in Symbols.OfType<VariableBase>().Where(sym => sym.Name == "Vector Variable")) {
+        if (!varSymbol.Fixed) {
+          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<DoubleVector>(x));
+          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<DoubleVector>(x));
+        }
+      }
+    }
+  }
+}
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 17459)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 17460)
@@ -161,4 +161,6 @@
     <Compile Include="Formatters\SymbolicDataAnalysisExpressionCSharpFormatter.cs" />
     <Compile Include="Grammars\DataAnalysisGrammar.cs" />
+    <Compile Include="Grammars\FullFunctionalVectorExpressionGrammar.cs" />
+    <Compile Include="Grammars\TypeCoherentVectorExpressionGrammar.cs" />
     <Compile Include="Hashing\HashExtensions.cs" />
     <Compile Include="Hashing\HashUtil.cs" />
@@ -229,4 +231,5 @@
     <Compile Include="Symbols\And.cs" />
     <Compile Include="Symbols\AutoregressiveVariable.cs" />
+    <Compile Include="Symbols\Sum.cs" />
     <Compile Include="Symbols\Average.cs" />
     <Compile Include="Symbols\Constant.cs" />
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 17459)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 17460)
@@ -77,5 +77,6 @@
     Cube = 50,
     CubeRoot = 51,
-    Tanh = 52
+    Tanh = 52,
+    Sum = 53
   };
   public static class OpCodes {
@@ -133,4 +134,5 @@
     public const byte CubeRoot = (byte)OpCode.CubeRoot;
     public const byte Tanh = (byte)OpCode.Tanh;
+    public const byte Sum = (byte)OpCode.Sum;
 
     private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
@@ -187,5 +189,6 @@
       { typeof(AnalyticQuotient), OpCodes.AnalyticQuotient },
       { typeof(Cube), OpCodes.Cube },
-      { typeof(CubeRoot), OpCodes.CubeRoot }
+      { typeof(CubeRoot), OpCodes.CubeRoot },
+      { typeof(Sum), OpCodes.Sum }
     };
 
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 17459)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs	(revision 17460)
@@ -118,5 +118,9 @@
         if (instr.opCode == OpCodes.Variable) {
           var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
-          instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
+          if (dataset.VariableHasType<double>(variableTreeNode.VariableName))
+            instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
+          else if (dataset.VariableHasType<DoubleVector>(variableTreeNode.VariableName))
+            instr.data = dataset.GetReadOnlyDoubleVectorValues(variableTreeNode.VariableName);
+          else throw new NotSupportedException($"Type of variable {variableTreeNode.VariableName} is not supported.");
         } else if (instr.opCode == OpCodes.FactorVariable) {
           var factorTreeNode = instr.dynamicNode as FactorVariableTreeNode;
@@ -186,4 +190,11 @@
       throw new NotSupportedException($"Unsupported argument type ({val})");
     }
+    private static EvaluationResult AggregateApply(EvaluationResult val,
+      Func<double, double> sFunc = null,
+      Func<DoubleVector, double> vFunc = null) {
+      if (val.IsScalar && sFunc != null) return new EvaluationResult(sFunc(val.Scalar));
+      if (val.IsVector && vFunc != null) return new EvaluationResult(vFunc(val.Vector));
+      throw new NotSupportedException($"Unsupported argument type ({val})");
+    }
 
     public virtual EvaluationResult Evaluate(IDataset dataset, ref int row, InterpreterState state) {
@@ -312,4 +323,16 @@
               v => DoubleVector.Log(v));
           }
+        case OpCodes.Sum: {
+            var cur = Evaluate(dataset, ref row, state);
+            return AggregateApply(cur,
+              s => s,
+              v => v.Sum());
+          }
+        case OpCodes.Average: {
+            var cur = Evaluate(dataset, ref row, state);
+            return AggregateApply(cur,
+              s => s,
+              v => v.Mean());
+          }
         case OpCodes.Variable: {
             if (row < 0 || row >= dataset.Rows) return EvaluationResult.NaN;
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sum.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sum.cs	(revision 17460)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sum.cs	(revision 17460)
@@ -0,0 +1,49 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HEAL.Attic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableType("C6C245BF-C44A-4207-A268-55641483F27F")]
+  [Item("Sum", "Symbol that represents the Sum function.")]
+  public sealed class Sum : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Sum(StorableConstructorFlag _) : base(_) { }
+    private Sum(Sum original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Sum(this, cloner);
+    }
+    public Sum() : base("Sum", "Symbol that represents the sum function.") { }
+  }
+}
