Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs	(revision 14238)
@@ -167,16 +167,11 @@
       if (aggregateLaggedVariables) {
         tree.Root.ForEachNodePrefix(node => {
-          if (node.Symbol is Variable) {
-            var varNode = node as VariableTreeNode;
-            IncReferenceCount(references, varNode.VariableName);
-          } else if (node.Symbol is VariableCondition) {
-            var varCondNode = node as VariableConditionTreeNode;
-            IncReferenceCount(references, varCondNode.VariableName);
-          } else if (node.Symbol is FactorVariable) {
+          if (node is IVariableTreeNode) {
             var factorNode = node as FactorVariableTreeNode;
-            if (aggregateFactorVariables) {
-              IncReferenceCount(references, factorNode.VariableName);
+            if (factorNode != null && !aggregateFactorVariables) {
+              IncReferenceCount(references, factorNode.VariableName + "=" + factorNode.VariableValue);
             } else {
-              IncReferenceCount(references, factorNode.ToString());
+              var varNode = node as IVariableTreeNode;
+              IncReferenceCount(references, varNode.VariableName);
             }
           }
@@ -189,22 +184,24 @@
 
     private static void GetVariableReferences(Dictionary<string, int> references, ISymbolicExpressionTreeNode node, int currentLag, bool aggregateFactorVariables) {
-      if (node.Symbol is LaggedVariable) {
-        var laggedVarNode = node as LaggedVariableTreeNode;
-        IncReferenceCount(references, laggedVarNode.VariableName, currentLag + laggedVarNode.Lag);
-      } else if (node.Symbol is Variable) {
-        var varNode = node as VariableTreeNode;
-        IncReferenceCount(references, varNode.VariableName, currentLag);
-      } else if (node.Symbol is FactorVariable) {
-        var factorNode = node as FactorVariableTreeNode;
-        if (aggregateFactorVariables) {
-          IncReferenceCount(references, factorNode.VariableName, currentLag);
+      if (node is IVariableTreeNode) {
+        var laggedVarTreeNode = node as LaggedVariableTreeNode;
+        var factorVarTreeNode = node as FactorVariableTreeNode;
+        var varConditionTreeNode = node as VariableConditionTreeNode;
+        if (laggedVarTreeNode != null) {
+          IncReferenceCount(references, laggedVarTreeNode.VariableName, currentLag + laggedVarTreeNode.Lag);
+        } else if (factorVarTreeNode != null) {
+          if (aggregateFactorVariables) {
+            IncReferenceCount(references, factorVarTreeNode.VariableName, currentLag);
+          } else {
+            IncReferenceCount(references, factorVarTreeNode.VariableName + "=" + factorVarTreeNode.VariableValue, currentLag);
+          }
+        } else if (varConditionTreeNode != null) {
+          IncReferenceCount(references, varConditionTreeNode.VariableName, currentLag);
+          GetVariableReferences(references, node.GetSubtree(0), currentLag, aggregateFactorVariables);
+          GetVariableReferences(references, node.GetSubtree(1), currentLag, aggregateFactorVariables);
         } else {
-          IncReferenceCount(references, factorNode.ToString(), currentLag);
-        }
-      } else if (node.Symbol is VariableCondition) {
-        var varCondNode = node as VariableConditionTreeNode;
-        IncReferenceCount(references, varCondNode.VariableName, currentLag);
-        GetVariableReferences(references, node.GetSubtree(0), currentLag, aggregateFactorVariables);
-        GetVariableReferences(references, node.GetSubtree(1), currentLag, aggregateFactorVariables);
+          var varNode = node as IVariableTreeNode;
+          IncReferenceCount(references, varNode.VariableName, currentLag);
+        }
       } else if (node.Symbol is Integral) {
         var laggedNode = node as LaggedTreeNode;
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 14238)
@@ -140,4 +140,5 @@
     <Compile Include="Importer\Token.cs" />
     <Compile Include="Interfaces\IModelBacktransformator.cs" />
+    <Compile Include="Interfaces\IVariableSymbol.cs" />
     <Compile Include="Interpreter\SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs" />
     <Compile Include="SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs" />
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableSymbol.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableSymbol.cs	(revision 14238)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableSymbol.cs	(revision 14238)
@@ -0,0 +1,37 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Encodings.SymbolicExpressionTreeEncoding;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+
+  /// <summary>
+  /// Any symbol that references a variable
+  /// </summary>
+  public interface IVariableSymbol : ISymbol {
+  }
+
+  /// <summary>
+  /// Any tree node that references a variable 
+  /// </summary>
+  public interface IVariableTreeNode : ISymbolicExpressionTreeNode {
+    string VariableName { get; }
+  }
+}
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs	(revision 14238)
@@ -182,5 +182,7 @@
       return node.Symbol is Variable;
     }
-
+    private bool IsVariableBase(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is VariableBase;
+    }
     private bool IsConstant(ISymbolicExpressionTreeNode node) {
       return node.Symbol is Constant;
@@ -203,5 +205,5 @@
     /// <returns></returns>
     public ISymbolicExpressionTreeNode GetSimplifiedTree(ISymbolicExpressionTreeNode original) {
-      if (IsConstant(original) || IsVariable(original)) {
+      if (IsConstant(original) || IsVariableBase(original)) {
         return (ISymbolicExpressionTreeNode)original.Clone();
       } else if (IsAddition(original)) {
@@ -718,10 +720,10 @@
       } if (IsConstant(a) && !((ConstantTreeNode)a).Value.IsAlmost(1.0)) {
         return MakeFraction(MakeConstant(1.0), MakeProduct(b, Invert(a)));
-      } else if (IsVariable(a) && IsConstant(b)) {
+      } else if (IsVariableBase(a) && IsConstant(b)) {
         // merge constant values into variable weights
         var constB = ((ConstantTreeNode)b).Value;
-        ((VariableTreeNode)a).Weight /= constB;
+        ((VariableTreeNodeBase)a).Weight /= constB;
         return a;
-      } else if (IsVariable(a) && IsVariable(b) && AreSameVariable(a, b)) {
+      } else if (IsVariableBase(a) && IsVariableBase(b) && AreSameVariable(a, b)) {
         // cancel variables
         var aVar = a as VariableTreeNode;
@@ -835,5 +837,6 @@
       var groupedVarNodes = from node in subtrees.OfType<VariableTreeNodeBase>()
                             let lag = (node is LaggedVariableTreeNode) ? ((LaggedVariableTreeNode)node).Lag : 0
-                            group node by node.VariableName + lag into g
+                            let cat = (node is FactorVariableTreeNode) ? ((FactorVariableTreeNode)node).VariableValue : string.Empty
+                            group node by node.VariableName + cat + lag into g
                             select g;
       var unchangedSubtrees = subtrees.Where(t => !(t is VariableTreeNodeBase));
@@ -861,7 +864,7 @@
         // $ * 1.0 => $
         return a;
-      } else if (IsConstant(b) && IsVariable(a)) {
+      } else if (IsConstant(b) && IsVariableBase(a)) {
         // multiply constants into variables weights
-        ((VariableTreeNode)a).Weight *= ((ConstantTreeNode)b).Value;
+        ((VariableTreeNodeBase)a).Weight *= ((ConstantTreeNode)b).Value;
         return a;
       } else if (IsConstant(b) && IsAddition(a)) {
@@ -944,4 +947,11 @@
         return aVar.VariableName == bVar.VariableName;
       }
+      var aFactor = a as FactorVariableTreeNode;
+      var bFactor = b as FactorVariableTreeNode;
+      if (aFactor != null && bFactor != null) {
+        return aFactor.VariableName == bFactor.VariableName &&
+          aFactor.VariableValue == bFactor.VariableValue;
+      }
+
       return false;
     }
@@ -951,10 +961,10 @@
       var subtrees = new List<ISymbolicExpressionTreeNode>(prod.Subtrees);
       while (prod.Subtrees.Any()) prod.RemoveSubtree(0);
-      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
+      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNodeBase>()
                             let lag = (node is LaggedVariableTreeNode) ? ((LaggedVariableTreeNode)node).Lag : 0
                             group node by node.VariableName + lag into g
                             orderby g.Count()
                             select g;
-      var constantProduct = (from node in subtrees.OfType<VariableTreeNode>()
+      var constantProduct = (from node in subtrees.OfType<VariableTreeNodeBase>()
                              select node.Weight)
                             .Concat(from node in subtrees.OfType<ConstantTreeNode>()
@@ -964,5 +974,5 @@
 
       var unchangedSubtrees = from tree in subtrees
-                              where !(tree is VariableTreeNode)
+                              where !(tree is VariableTreeNodeBase)
                               where !(tree is ConstantTreeNode)
                               select tree;
@@ -1000,6 +1010,6 @@
       if (IsConstant(x)) {
         ((ConstantTreeNode)x).Value *= -1;
-      } else if (IsVariable(x)) {
-        var variableTree = (VariableTreeNode)x;
+      } else if (IsVariableBase(x)) {
+        var variableTree = (VariableTreeNodeBase)x;
         variableTree.Weight *= -1.0;
       } else if (IsAddition(x)) {
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs	(revision 14238)
@@ -63,11 +63,9 @@
         var variables =
           SymbolicExpressionTree.IterateNodesPrefix()
-            .OfType<VariableTreeNode>()
+            .OfType<IVariableTreeNode>()
             .Select(x => x.VariableName)
             .Distinct();
-        var variableConditions = SymbolicExpressionTree.IterateNodesPrefix()
-          .OfType<VariableConditionTreeNode>().Select(x => x.VariableName).Distinct();
 
-        return variables.Union(variableConditions).OrderBy(x => x);
+        return variables.OrderBy(x => x);
       }
     }
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 14238)
@@ -213,5 +213,5 @@
       grammar.MaximumFunctionArguments = MaximumFunctionArguments.Value;
       grammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;
-      foreach (var varSymbol in grammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) {
+      foreach (var varSymbol in grammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableBase>()) {
         if (!varSymbol.Fixed) {
           varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<double>(x));
@@ -225,10 +225,4 @@
           factorSymbol.VariableValues = factorSymbol.VariableNames
             .ToDictionary(varName => varName, varName => ds.GetStringValues(varName).Distinct().ToList());
-        }
-      }
-      foreach (var varSymbol in grammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableCondition>()) {
-        if (!varSymbol.Fixed) {
-          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<double>(x));
-          varSymbol.VariableNames = problemData.AllowedInputVariables;
         }
       }
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs	(revision 14238)
@@ -39,4 +39,5 @@
     }
     public Variable() : base("Variable", "Represents a variable value.") { }
+    public Variable(string name, string description) : base(name, description) { }
 
     public override ISymbolicExpressionTreeNode CreateTreeNode() {
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs	(revision 14238)
@@ -27,5 +27,5 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableClass]
-  public abstract class VariableBase : Symbol {
+  public abstract class VariableBase : Symbol, IVariableSymbol {
     #region Properties
     [Storable]
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 14238)
@@ -30,5 +30,5 @@
   [StorableClass]
   [Item("Variable Condition", "Represents a condition that tests a given variable against a specified threshold.")]
-  public sealed class VariableCondition : Symbol {
+  public sealed class VariableCondition : Symbol, IVariableSymbol {
     #region properties
     [Storable]
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs	(revision 14238)
@@ -29,5 +29,5 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableClass]
-  public sealed class VariableConditionTreeNode : SymbolicExpressionTreeNode {
+  public sealed class VariableConditionTreeNode : SymbolicExpressionTreeNode, IVariableTreeNode {
     #region properties
     public new VariableCondition Symbol {
Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs	(revision 14237)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs	(revision 14238)
@@ -27,5 +27,5 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableClass]
-  public abstract class VariableTreeNodeBase : SymbolicExpressionTreeTerminalNode {
+  public abstract class VariableTreeNodeBase : SymbolicExpressionTreeTerminalNode, IVariableTreeNode {
     public new VariableBase Symbol {
       get { return (VariableBase)base.Symbol; }
