Index: /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
===================================================================
--- /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 13221)
+++ /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 13222)
@@ -22,5 +22,4 @@
 using System;
 using System.Collections.Generic;
-using System.Collections.ObjectModel;
 using System.Linq;
 using System.Linq.Expressions;
@@ -38,4 +37,5 @@
   public sealed class SymbolicDataAnalysisExpressionCompiledTreeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
     private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
     private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
 
@@ -62,10 +62,5 @@
     #endregion
 
-    private static readonly Func<ReadOnlyCollection<double>, IList<double>> ReadOnlyCollectionRetrieveList = GetField<ReadOnlyCollection<double>, IList<double>>("list"); // retrieve underlying field of type IList<double> from a ReadOnlyCollection<double>
-    private static readonly Func<List<double>, double[]> ListRetrieveItems = GetField<List<double>, double[]>("_items"); // retrieve underlying field of type double[] from a List<double>
-    private static MethodInfo listGetValue = typeof(IList<double>).GetProperty("Item", new Type[] { typeof(int) }).GetGetMethod();
-
     public override bool CanChangeName { get { return false; } }
-
     public override bool CanChangeDescription { get { return false; } }
 
@@ -106,6 +101,5 @@
     public SymbolicDataAnalysisExpressionCompiledTreeInterpreter() :
       base("SymbolicDataAnalysisExpressionCompiledTreeInterpreter", "Interpreter which compiles the tree into a lambda") {
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
       Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
     }
@@ -113,17 +107,6 @@
     public SymbolicDataAnalysisExpressionCompiledTreeInterpreter(string name, string description) :
       base(name, description) {
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
       Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      Parameters.Remove(EvaluatedSolutionsParameterName);
-      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
-
-      Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
     }
 
@@ -132,6 +115,5 @@
     }
 
-    public void ClearState() {
-    }
+    public void ClearState() { }
 
     public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
@@ -142,16 +124,15 @@
         EvaluatedSolutions++; // increment the evaluated solutions counter
       }
-      //      var columns = dataset.DoubleVariables.Select(x => ListRetrieveItems((List<double>)ReadOnlyCollectionRetrieveList(dataset.GetReadOnlyDoubleValues(x)))).ToArray();
-      var columns = dataset.DoubleVariables.Select(x => (List<double>)dataset.GetDoubleValues(x)).ToArray();
+      var columns = dataset.DoubleVariables.Select(x => (IList<double>)dataset.GetReadOnlyDoubleValues(x)).ToArray();
       var compiled = CompileTree(tree, dataset);
       return rows.Select(x => compiled(x, columns));
     }
 
-    public static Func<int, List<double>[], double> CompileTree(ISymbolicExpressionTree tree, IDataset dataset) {
+    public static Func<int, IList<double>[], double> CompileTree(ISymbolicExpressionTree tree, IDataset dataset) {
       var row = Expression.Parameter(typeof(int));
-      var columns = Expression.Parameter(typeof(List<double>[]));
+      var columns = Expression.Parameter(typeof(IList<double>[]));
       var variableIndices = dataset.DoubleVariables.Select((x, i) => new { x, i }).ToDictionary(e => e.x, e => e.i);
       var expr = MakeExpr(tree, variableIndices, row, columns);
-      var lambda = Expression.Lambda<Func<int, List<double>[], double>>(expr, row, columns);
+      var lambda = Expression.Lambda<Func<int, IList<double>[], double>>(expr, row, columns);
       return lambda.Compile();
     }
@@ -162,15 +143,14 @@
     }
 
+    private static readonly PropertyInfo Indexer = typeof(IList<double>).GetProperty("Item");
     private static Expression MakeExpr(ISymbolicExpressionTreeNode node, Dictionary<string, int> variableIndices, Expression row, Expression columns) {
       var opcode = OpCodes.MapSymbolToOpCode(node);
       #region switch opcode
       switch (opcode) {
-        case OpCodes.Constant:
-          {
+        case OpCodes.Constant: {
             var constantTreeNode = (ConstantTreeNode)node;
             return Expression.Constant(constantTreeNode.Value);
           }
-        case OpCodes.Variable:
-          {
+        case OpCodes.Variable: {
             var variableTreeNode = (VariableTreeNode)node;
             var variableWeight = Expression.Constant(variableTreeNode.Weight);
@@ -178,10 +158,8 @@
             var indexExpr = Expression.Constant(variableIndices[variableName]);
             var valuesExpr = Expression.ArrayIndex(columns, indexExpr);
-            var variableValue = Expression.ArrayIndex(Expression.Field(valuesExpr, "_items"), row);
-            //            var variableValue = Expression.Property(valuesExpr, Indexer, row);
+            var variableValue = Expression.Property(valuesExpr, Indexer, row);
             return Expression.Multiply(variableWeight, variableValue);
           }
-        case OpCodes.Add:
-          {
+        case OpCodes.Add: {
             Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             for (int i = 1; i < node.SubtreeCount; ++i) {
@@ -190,6 +168,5 @@
             return result;
           }
-        case OpCodes.Sub:
-          {
+        case OpCodes.Sub: {
             Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             if (node.SubtreeCount == 1)
@@ -200,6 +177,5 @@
             return result;
           }
-        case OpCodes.Mul:
-          {
+        case OpCodes.Mul: {
             Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             for (int i = 1; i < node.SubtreeCount; ++i) {
@@ -208,6 +184,5 @@
             return result;
           }
-        case OpCodes.Div:
-          {
+        case OpCodes.Div: {
             Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             if (node.SubtreeCount == 1)
@@ -218,6 +193,5 @@
             return result;
           }
-        case OpCodes.Average:
-          {
+        case OpCodes.Average: {
             Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             for (int i = 1; i < node.SubtreeCount; ++i) {
@@ -226,53 +200,43 @@
             return Expression.Divide(result, Expression.Constant((double)node.SubtreeCount));
           }
-        case OpCodes.Cos:
-          {
+        case OpCodes.Cos: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             return Expression.Call(Cos, arg);
           }
-        case OpCodes.Sin:
-          {
+        case OpCodes.Sin: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             return Expression.Call(Sin, arg);
           }
-        case OpCodes.Tan:
-          {
+        case OpCodes.Tan: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             return Expression.Call(Tan, arg);
           }
-        case OpCodes.Square:
-          {
+        case OpCodes.Square: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             return Expression.Power(arg, Expression.Constant(2));
           }
-        case OpCodes.Power:
-          {
+        case OpCodes.Power: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var power = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
             return Expression.Power(arg, Expression.Call(Floor, power));
           }
-        case OpCodes.SquareRoot:
-          {
+        case OpCodes.SquareRoot: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             return Expression.Call(Sqrt, arg);
           }
-        case OpCodes.Root:
-          {
+        case OpCodes.Root: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var power = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
             return Expression.Power(arg, Expression.Divide(Expression.Constant(1.0), power));
           }
-        case OpCodes.Exp:
-          {
+        case OpCodes.Exp: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             return Expression.Call(Exp, arg);
           }
-        case OpCodes.Log:
-          {
+        case OpCodes.Log: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             return Expression.Call(Log, arg);
           }
-        case OpCodes.Gamma:
-          {
+        case OpCodes.Gamma: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -291,6 +255,5 @@
             return expr;
           }
-        case OpCodes.Psi:
-          {
+        case OpCodes.Psi: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -314,6 +277,5 @@
             return expr;
           }
-        case OpCodes.Dawson:
-          {
+        case OpCodes.Dawson: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -331,6 +293,5 @@
             return expr;
           }
-        case OpCodes.ExponentialIntegralEi:
-          {
+        case OpCodes.ExponentialIntegralEi: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -348,6 +309,5 @@
             return expr;
           }
-        case OpCodes.SineIntegral:
-          {
+        case OpCodes.SineIntegral: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -370,6 +330,5 @@
             return expr;
           }
-        case OpCodes.CosineIntegral:
-          {
+        case OpCodes.CosineIntegral: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -392,6 +351,5 @@
             return expr;
           }
-        case OpCodes.HyperbolicSineIntegral:
-          {
+        case OpCodes.HyperbolicSineIntegral: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -414,6 +372,5 @@
             return expr;
           }
-        case OpCodes.HyperbolicCosineIntegral:
-          {
+        case OpCodes.HyperbolicCosineIntegral: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -436,6 +393,5 @@
             return expr;
           }
-        case OpCodes.FresnelSineIntegral:
-          {
+        case OpCodes.FresnelSineIntegral: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -454,6 +410,5 @@
             return expr;
           }
-        case OpCodes.FresnelCosineIntegral:
-          {
+        case OpCodes.FresnelCosineIntegral: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -472,6 +427,5 @@
             return expr;
           }
-        case OpCodes.AiryA:
-          {
+        case OpCodes.AiryA: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -492,6 +446,5 @@
             return expr;
           }
-        case OpCodes.AiryB:
-          {
+        case OpCodes.AiryB: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -512,6 +465,5 @@
             return expr;
           }
-        case OpCodes.Norm:
-          {
+        case OpCodes.Norm: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -525,6 +477,5 @@
             return expr;
           }
-        case OpCodes.Erf:
-          {
+        case OpCodes.Erf: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -538,6 +489,5 @@
             return expr;
           }
-        case OpCodes.Bessel:
-          {
+        case OpCodes.Bessel: {
             var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var isNaN = Expression.Call(IsNaN, arg);
@@ -554,6 +504,5 @@
             return expr;
           }
-        case OpCodes.IfThenElse:
-          {
+        case OpCodes.IfThenElse: {
             var test = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var result = Expression.Variable(typeof(double));
@@ -563,6 +512,5 @@
             return Expression.Block(new[] { result }, condition, result);
           }
-        case OpCodes.AND:
-          {
+        case OpCodes.AND: {
             var result = Expression.Variable(typeof(double));
             var expr = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
@@ -589,6 +537,5 @@
               );
           }
-        case OpCodes.OR:
-          {
+        case OpCodes.OR: {
             var result = Expression.Variable(typeof(double));
             var expr = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
@@ -615,6 +562,5 @@
               );
           }
-        case OpCodes.NOT:
-          {
+        case OpCodes.NOT: {
             var value = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var result = Expression.Variable(typeof(double));
@@ -624,6 +570,5 @@
             return Expression.Block(new[] { result }, condition, result);
           }
-        case OpCodes.XOR:
-          {
+        case OpCodes.XOR: {
             var ps = Expression.Variable(typeof(int));
             var block = Expression.Block(
@@ -656,6 +601,5 @@
             return xorExpr;
           }
-        case OpCodes.GT:
-          {
+        case OpCodes.GT: {
             var left = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var right = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
@@ -669,6 +613,5 @@
               result);
           }
-        case OpCodes.LT:
-          {
+        case OpCodes.LT: {
             var left = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
             var right = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
@@ -679,6 +622,5 @@
             return Expression.Block(new[] { result }, condition, result);
           }
-        case OpCodes.VariableCondition:
-          {
+        case OpCodes.VariableCondition: {
             var variableConditionTreeNode = (VariableConditionTreeNode)node;
             var variableName = variableConditionTreeNode.VariableName;
@@ -700,6 +642,5 @@
               );
           }
-        case OpCodes.LagVariable:
-          {
+        case OpCodes.LagVariable: {
             var laggedVariableTreeNode = (LaggedVariableTreeNode)node;
             var lag = Expression.Constant(laggedVariableTreeNode.Lag);
@@ -708,15 +649,13 @@
             var indexExpr = Expression.Constant(variableIndices[variableName]);
             var valuesExpr = Expression.ArrayIndex(columns, indexExpr);
-            var variableValue = Expression.ArrayIndex(Expression.Field(valuesExpr, "_items"), Expression.Add(row, lag));
+            var variableValue = Expression.Property(valuesExpr, Indexer, Expression.Add(row, lag));
             return Expression.Multiply(variableWeight, variableValue);
           }
-        case OpCodes.TimeLag:
-          {
+        case OpCodes.TimeLag: {
             var timeLagTreeNode = (LaggedTreeNode)node;
             var lag = Expression.Constant(timeLagTreeNode.Lag);
             return MakeExpr(timeLagTreeNode.GetSubtree(0), variableIndices, Expression.Add(row, lag), columns);
           }
-        case OpCodes.Integral:
-          {
+        case OpCodes.Integral: {
             var timeLagTreeNode = (LaggedTreeNode)node;
             var subtree = node.GetSubtree(0);
@@ -730,6 +669,5 @@
             return sum;
           }
-        case OpCodes.Derivative:
-          {
+        case OpCodes.Derivative: {
             var subtree = node.GetSubtree(0);
             var f0 = MakeExpr(subtree, variableIndices, row, columns);
Index: /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
===================================================================
--- /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 13221)
+++ /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 13222)
@@ -69,4 +69,5 @@
 
     private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
     private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
 
@@ -124,14 +125,21 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      Parameters.Remove(EvaluatedSolutionsParameterName);
-      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
-
-      Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      var evaluatedSolutions = new IntValue(0);
+      var checkExpressionsWithIntervalArithmetic = new BoolValue(false);
+      if (Parameters.ContainsKey(EvaluatedSolutionsParameterName)) {
+        var evaluatedSolutionsParameter = (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName];
+        evaluatedSolutions = evaluatedSolutionsParameter.Value;
+        Parameters.Remove(EvaluatedSolutionsParameterName);
+      }
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", evaluatedSolutions));
+      if (Parameters.ContainsKey(CheckExpressionsWithIntervalArithmeticParameterName)) {
+        var checkExpressionsWithIntervalArithmeticParameter = (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName];
+        Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
+        checkExpressionsWithIntervalArithmetic = checkExpressionsWithIntervalArithmeticParameter.Value;
+      }
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, checkExpressionsWithIntervalArithmetic));
     }
 
     #region IStatefulItem
-
     public void InitializeState() {
       EvaluatedSolutions = 0;
@@ -140,5 +148,4 @@
     public void ClearState() {
     }
-
     #endregion
 
@@ -192,6 +199,5 @@
 
       switch (currentInstr.opCode) {
-        case OpCodes.Add:
-          {
+        case OpCodes.Add: {
             if (nArgs > 0) {
               CompileInstructions(il, state, ds);
@@ -203,6 +209,5 @@
             return;
           }
-        case OpCodes.Sub:
-          {
+        case OpCodes.Sub: {
             if (nArgs == 1) {
               CompileInstructions(il, state, ds);
@@ -219,6 +224,5 @@
             return;
           }
-        case OpCodes.Mul:
-          {
+        case OpCodes.Mul: {
             if (nArgs > 0) {
               CompileInstructions(il, state, ds);
@@ -230,6 +234,5 @@
             return;
           }
-        case OpCodes.Div:
-          {
+        case OpCodes.Div: {
             if (nArgs == 1) {
               il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0);
@@ -247,6 +250,5 @@
             return;
           }
-        case OpCodes.Average:
-          {
+        case OpCodes.Average: {
             CompileInstructions(il, state, ds);
             for (int i = 1; i < nArgs; i++) {
@@ -258,24 +260,20 @@
             return;
           }
-        case OpCodes.Cos:
-          {
+        case OpCodes.Cos: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, cos);
             return;
           }
-        case OpCodes.Sin:
-          {
+        case OpCodes.Sin: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, sin);
             return;
           }
-        case OpCodes.Tan:
-          {
+        case OpCodes.Tan: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, tan);
             return;
           }
-        case OpCodes.Power:
-          {
+        case OpCodes.Power: {
             CompileInstructions(il, state, ds);
             CompileInstructions(il, state, ds);
@@ -284,6 +282,5 @@
             return;
           }
-        case OpCodes.Root:
-          {
+        case OpCodes.Root: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1 / round(...)
@@ -294,18 +291,15 @@
             return;
           }
-        case OpCodes.Exp:
-          {
+        case OpCodes.Exp: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, exp);
             return;
           }
-        case OpCodes.Log:
-          {
+        case OpCodes.Log: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, log);
             return;
           }
-        case OpCodes.Square:
-          {
+        case OpCodes.Square: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0);
@@ -313,102 +307,85 @@
             return;
           }
-        case OpCodes.SquareRoot:
-          {
+        case OpCodes.SquareRoot: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, sqrt);
             return;
           }
-        case OpCodes.AiryA:
-          {
+        case OpCodes.AiryA: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, airyA);
             return;
           }
-        case OpCodes.AiryB:
-          {
+        case OpCodes.AiryB: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, airyB);
             return;
           }
-        case OpCodes.Bessel:
-          {
+        case OpCodes.Bessel: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, bessel);
             return;
           }
-        case OpCodes.CosineIntegral:
-          {
+        case OpCodes.CosineIntegral: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, cosIntegral);
             return;
           }
-        case OpCodes.Dawson:
-          {
+        case OpCodes.Dawson: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, dawson);
             return;
           }
-        case OpCodes.Erf:
-          {
+        case OpCodes.Erf: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, erf);
             return;
           }
-        case OpCodes.ExponentialIntegralEi:
-          {
+        case OpCodes.ExponentialIntegralEi: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, expIntegralEi);
             return;
           }
-        case OpCodes.FresnelCosineIntegral:
-          {
+        case OpCodes.FresnelCosineIntegral: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelCosIntegral);
             return;
           }
-        case OpCodes.FresnelSineIntegral:
-          {
+        case OpCodes.FresnelSineIntegral: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelSinIntegral);
             return;
           }
-        case OpCodes.Gamma:
-          {
+        case OpCodes.Gamma: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, gamma);
             return;
           }
-        case OpCodes.HyperbolicCosineIntegral:
-          {
+        case OpCodes.HyperbolicCosineIntegral: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, hypCosIntegral);
             return;
           }
-        case OpCodes.HyperbolicSineIntegral:
-          {
+        case OpCodes.HyperbolicSineIntegral: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, hypSinIntegral);
             return;
           }
-        case OpCodes.Norm:
-          {
+        case OpCodes.Norm: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, norm);
             return;
           }
-        case OpCodes.Psi:
-          {
+        case OpCodes.Psi: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, psi);
             return;
           }
-        case OpCodes.SineIntegral:
-          {
+        case OpCodes.SineIntegral: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Call, sinIntegral);
             return;
           }
-        case OpCodes.IfThenElse:
-          {
+        case OpCodes.IfThenElse: {
             Label end = il.DefineLabel();
             Label c1 = il.DefineLabel();
@@ -424,6 +401,5 @@
             return;
           }
-        case OpCodes.AND:
-          {
+        case OpCodes.AND: {
             Label falseBranch = il.DefineLabel();
             Label end = il.DefineLabel();
@@ -446,6 +422,5 @@
             return;
           }
-        case OpCodes.OR:
-          {
+        case OpCodes.OR: {
             Label trueBranch = il.DefineLabel();
             Label end = il.DefineLabel();
@@ -475,6 +450,5 @@
             return;
           }
-        case OpCodes.NOT:
-          {
+        case OpCodes.NOT: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
@@ -487,6 +461,5 @@
             return;
           }
-        case OpCodes.XOR:
-          {
+        case OpCodes.XOR: {
             CompileInstructions(il, state, ds);
             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
@@ -505,6 +478,5 @@
             return;
           }
-        case OpCodes.GT:
-          {
+        case OpCodes.GT: {
             CompileInstructions(il, state, ds);
             CompileInstructions(il, state, ds);
@@ -517,6 +489,5 @@
             return;
           }
-        case OpCodes.LT:
-          {
+        case OpCodes.LT: {
             CompileInstructions(il, state, ds);
             CompileInstructions(il, state, ds);
@@ -528,6 +499,5 @@
             return;
           }
-        case OpCodes.TimeLag:
-          {
+        case OpCodes.TimeLag: {
             LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
             il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -= lag
@@ -545,6 +515,5 @@
             return;
           }
-        case OpCodes.Integral:
-          {
+        case OpCodes.Integral: {
             int savedPc = state.ProgramCounter;
             LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
@@ -573,6 +542,5 @@
         //one sided smooth differentiatior, N = 4
         // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
-        case OpCodes.Derivative:
-          {
+        case OpCodes.Derivative: {
             int savedPc = state.ProgramCounter;
             CompileInstructions(il, state, ds);
@@ -616,16 +584,13 @@
             return;
           }
-        case OpCodes.Call:
-          {
+        case OpCodes.Call: {
             throw new NotSupportedException(
               "Automatically defined functions are not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter. Either turn of ADFs or change the interpeter.");
           }
-        case OpCodes.Arg:
-          {
+        case OpCodes.Arg: {
             throw new NotSupportedException(
               "Automatically defined functions are not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter. Either turn of ADFs or change the interpeter.");
           }
-        case OpCodes.Variable:
-          {
+        case OpCodes.Variable: {
             VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode;
             il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array
@@ -659,6 +624,5 @@
             return;
           }
-        case OpCodes.LagVariable:
-          {
+        case OpCodes.LagVariable: {
             var nanResult = il.DefineLabel();
             var normalResult = il.DefineLabel();
@@ -688,6 +652,5 @@
             return;
           }
-        case OpCodes.Constant:
-          {
+        case OpCodes.Constant: {
             ConstantTreeNode constNode = (ConstantTreeNode)currentInstr.dynamicNode;
             il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, constNode.Value);
@@ -697,6 +660,5 @@
         //mkommend: this symbol uses the logistic function f(x) = 1 / (1 + e^(-alpha * x) ) 
         //to determine the relative amounts of the true and false branch see http://en.wikipedia.org/wiki/Logistic_function
-        case OpCodes.VariableCondition:
-          {
+        case OpCodes.VariableCondition: {
             throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name +
                                             " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
Index: /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 13221)
+++ /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 13222)
@@ -32,10 +32,17 @@
   [StorableClass]
   [Item("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.")]
-  public class SymbolicDataAnalysisExpressionTreeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
+  public class SymbolicDataAnalysisExpressionTreeInterpreter : ParameterizedNamedItem,
+    ISymbolicDataAnalysisExpressionTreeInterpreter {
     private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
     private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
 
-    public override bool CanChangeName { get { return false; } }
-    public override bool CanChangeDescription { get { return false; } }
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
 
     #region parameter properties
@@ -54,4 +61,5 @@
       set { CheckExpressionsWithIntervalArithmeticParameter.Value.Value = value; }
     }
+
     public int EvaluatedSolutions {
       get { return EvaluatedSolutionsParameter.Value.Value; }
@@ -62,5 +70,8 @@
     [StorableConstructor]
     protected SymbolicDataAnalysisExpressionTreeInterpreter(bool deserializing) : base(deserializing) { }
-    protected SymbolicDataAnalysisExpressionTreeInterpreter(SymbolicDataAnalysisExpressionTreeInterpreter original, Cloner cloner) : base(original, cloner) { }
+
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(SymbolicDataAnalysisExpressionTreeInterpreter original,
+      Cloner cloner) : base(original, cloner) { }
+
     public override IDeepCloneable Clone(Cloner cloner) {
       return new SymbolicDataAnalysisExpressionTreeInterpreter(this, cloner);
@@ -69,6 +80,5 @@
     public SymbolicDataAnalysisExpressionTreeInterpreter()
       : base("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.") {
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
       Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
     }
@@ -76,6 +86,5 @@
     protected SymbolicDataAnalysisExpressionTreeInterpreter(string name, string description)
       : base(name, description) {
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
       Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
     }
@@ -83,10 +92,18 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      Parameters.Remove(EvaluatedSolutionsParameterName);
-      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
-
-      Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      var evaluatedSolutions = new IntValue(0);
+      var checkExpressionsWithIntervalArithmetic = new BoolValue(false);
+      if (Parameters.ContainsKey(EvaluatedSolutionsParameterName)) {
+        var evaluatedSolutionsParameter = (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName];
+        evaluatedSolutions = evaluatedSolutionsParameter.Value;
+        Parameters.Remove(EvaluatedSolutionsParameterName);
+      }
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", evaluatedSolutions));
+      if (Parameters.ContainsKey(CheckExpressionsWithIntervalArithmeticParameterName)) {
+        var checkExpressionsWithIntervalArithmeticParameter = (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName];
+        Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
+        checkExpressionsWithIntervalArithmetic = checkExpressionsWithIntervalArithmeticParameter.Value;
+      }
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, checkExpressionsWithIntervalArithmetic));
     }
 
@@ -96,11 +113,12 @@
     }
 
-    public void ClearState() {
-    }
+    public void ClearState() { }
     #endregion
 
-    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
-      if (CheckExpressionsWithIntervalArithmetic)
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset,
+      IEnumerable<int> rows) {
+      if (CheckExpressionsWithIntervalArithmetic) {
         throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
+      }
 
       lock (EvaluatedSolutionsParameter.Value) {
@@ -136,10 +154,8 @@
     }
 
-
     public virtual double Evaluate(IDataset dataset, ref int row, InterpreterState state) {
       Instruction currentInstr = state.NextInstruction();
       switch (currentInstr.opCode) {
-        case OpCodes.Add:
-          {
+        case OpCodes.Add: {
             double s = Evaluate(dataset, ref row, state);
             for (int i = 1; i < currentInstr.nArguments; i++) {
@@ -148,15 +164,13 @@
             return s;
           }
-        case OpCodes.Sub:
-          {
+        case OpCodes.Sub: {
             double s = Evaluate(dataset, ref row, state);
             for (int i = 1; i < currentInstr.nArguments; i++) {
               s -= Evaluate(dataset, ref row, state);
             }
-            if (currentInstr.nArguments == 1) s = -s;
+            if (currentInstr.nArguments == 1) { s = -s; }
             return s;
           }
-        case OpCodes.Mul:
-          {
+        case OpCodes.Mul: {
             double p = Evaluate(dataset, ref row, state);
             for (int i = 1; i < currentInstr.nArguments; i++) {
@@ -165,15 +179,13 @@
             return p;
           }
-        case OpCodes.Div:
-          {
+        case OpCodes.Div: {
             double p = Evaluate(dataset, ref row, state);
             for (int i = 1; i < currentInstr.nArguments; i++) {
               p /= Evaluate(dataset, ref row, state);
             }
-            if (currentInstr.nArguments == 1) p = 1.0 / p;
+            if (currentInstr.nArguments == 1) { p = 1.0 / p; }
             return p;
           }
-        case OpCodes.Average:
-          {
+        case OpCodes.Average: {
             double sum = Evaluate(dataset, ref row, state);
             for (int i = 1; i < currentInstr.nArguments; i++) {
@@ -182,52 +194,40 @@
             return sum / currentInstr.nArguments;
           }
-        case OpCodes.Cos:
-          {
+        case OpCodes.Cos: {
             return Math.Cos(Evaluate(dataset, ref row, state));
           }
-        case OpCodes.Sin:
-          {
+        case OpCodes.Sin: {
             return Math.Sin(Evaluate(dataset, ref row, state));
           }
-        case OpCodes.Tan:
-          {
+        case OpCodes.Tan: {
             return Math.Tan(Evaluate(dataset, ref row, state));
           }
-        case OpCodes.Square:
-          {
+        case OpCodes.Square: {
             return Math.Pow(Evaluate(dataset, ref row, state), 2);
           }
-        case OpCodes.Power:
-          {
+        case OpCodes.Power: {
             double x = Evaluate(dataset, ref row, state);
             double y = Math.Round(Evaluate(dataset, ref row, state));
             return Math.Pow(x, y);
           }
-        case OpCodes.SquareRoot:
-          {
+        case OpCodes.SquareRoot: {
             return Math.Sqrt(Evaluate(dataset, ref row, state));
           }
-        case OpCodes.Root:
-          {
+        case OpCodes.Root: {
             double x = Evaluate(dataset, ref row, state);
             double y = Math.Round(Evaluate(dataset, ref row, state));
             return Math.Pow(x, 1 / y);
           }
-        case OpCodes.Exp:
-          {
+        case OpCodes.Exp: {
             return Math.Exp(Evaluate(dataset, ref row, state));
           }
-        case OpCodes.Log:
-          {
+        case OpCodes.Log: {
             return Math.Log(Evaluate(dataset, ref row, state));
           }
-        case OpCodes.Gamma:
-          {
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else return alglib.gammafunction(x);
-          }
-        case OpCodes.Psi:
-          {
+        case OpCodes.Gamma: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) { return double.NaN; } else { return alglib.gammafunction(x); }
+          }
+        case OpCodes.Psi: {
             var x = Evaluate(dataset, ref row, state);
             if (double.IsNaN(x)) return double.NaN;
@@ -235,18 +235,15 @@
             return alglib.psi(x);
           }
-        case OpCodes.Dawson:
-          {
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
+        case OpCodes.Dawson: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) { return double.NaN; }
             return alglib.dawsonintegral(x);
           }
-        case OpCodes.ExponentialIntegralEi:
-          {
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
+        case OpCodes.ExponentialIntegralEi: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) { return double.NaN; }
             return alglib.exponentialintegralei(x);
           }
-        case OpCodes.SineIntegral:
-          {
+        case OpCodes.SineIntegral: {
             double si, ci;
             var x = Evaluate(dataset, ref row, state);
@@ -257,6 +254,5 @@
             }
           }
-        case OpCodes.CosineIntegral:
-          {
+        case OpCodes.CosineIntegral: {
             double si, ci;
             var x = Evaluate(dataset, ref row, state);
@@ -267,6 +263,5 @@
             }
           }
-        case OpCodes.HyperbolicSineIntegral:
-          {
+        case OpCodes.HyperbolicSineIntegral: {
             double shi, chi;
             var x = Evaluate(dataset, ref row, state);
@@ -277,6 +272,5 @@
             }
           }
-        case OpCodes.HyperbolicCosineIntegral:
-          {
+        case OpCodes.HyperbolicCosineIntegral: {
             double shi, chi;
             var x = Evaluate(dataset, ref row, state);
@@ -287,6 +281,5 @@
             }
           }
-        case OpCodes.FresnelCosineIntegral:
-          {
+        case OpCodes.FresnelCosineIntegral: {
             double c = 0, s = 0;
             var x = Evaluate(dataset, ref row, state);
@@ -297,6 +290,5 @@
             }
           }
-        case OpCodes.FresnelSineIntegral:
-          {
+        case OpCodes.FresnelSineIntegral: {
             double c = 0, s = 0;
             var x = Evaluate(dataset, ref row, state);
@@ -307,6 +299,5 @@
             }
           }
-        case OpCodes.AiryA:
-          {
+        case OpCodes.AiryA: {
             double ai, aip, bi, bip;
             var x = Evaluate(dataset, ref row, state);
@@ -317,6 +308,5 @@
             }
           }
-        case OpCodes.AiryB:
-          {
+        case OpCodes.AiryB: {
             double ai, aip, bi, bip;
             var x = Evaluate(dataset, ref row, state);
@@ -327,24 +317,20 @@
             }
           }
-        case OpCodes.Norm:
-          {
+        case OpCodes.Norm: {
             var x = Evaluate(dataset, ref row, state);
             if (double.IsNaN(x)) return double.NaN;
             else return alglib.normaldistribution(x);
           }
-        case OpCodes.Erf:
-          {
+        case OpCodes.Erf: {
             var x = Evaluate(dataset, ref row, state);
             if (double.IsNaN(x)) return double.NaN;
             else return alglib.errorfunction(x);
           }
-        case OpCodes.Bessel:
-          {
+        case OpCodes.Bessel: {
             var x = Evaluate(dataset, ref row, state);
             if (double.IsNaN(x)) return double.NaN;
             else return alglib.besseli0(x);
           }
-        case OpCodes.IfThenElse:
-          {
+        case OpCodes.IfThenElse: {
             double condition = Evaluate(dataset, ref row, state);
             double result;
@@ -356,6 +342,5 @@
             return result;
           }
-        case OpCodes.AND:
-          {
+        case OpCodes.AND: {
             double result = Evaluate(dataset, ref row, state);
             for (int i = 1; i < currentInstr.nArguments; i++) {
@@ -367,6 +352,5 @@
             return result > 0.0 ? 1.0 : -1.0;
           }
-        case OpCodes.OR:
-          {
+        case OpCodes.OR: {
             double result = Evaluate(dataset, ref row, state);
             for (int i = 1; i < currentInstr.nArguments; i++) {
@@ -378,34 +362,27 @@
             return result > 0.0 ? 1.0 : -1.0;
           }
-        case OpCodes.NOT:
-          {
+        case OpCodes.NOT: {
             return Evaluate(dataset, ref row, state) > 0.0 ? -1.0 : 1.0;
           }
-        case OpCodes.XOR:
-          {
+        case OpCodes.XOR: {
             //mkommend: XOR on multiple inputs is defined as true if the number of positive signals is odd
             // this is equal to a consecutive execution of binary XOR operations.
             int positiveSignals = 0;
             for (int i = 0; i < currentInstr.nArguments; i++) {
-              if (Evaluate(dataset, ref row, state) > 0.0) positiveSignals++;
+              if (Evaluate(dataset, ref row, state) > 0.0) { positiveSignals++; }
             }
             return positiveSignals % 2 != 0 ? 1.0 : -1.0;
           }
-        case OpCodes.GT:
-          {
+        case OpCodes.GT: {
             double x = Evaluate(dataset, ref row, state);
             double y = Evaluate(dataset, ref row, state);
-            if (x > y) return 1.0;
-            else return -1.0;
-          }
-        case OpCodes.LT:
-          {
+            if (x > y) { return 1.0; } else { return -1.0; }
+          }
+        case OpCodes.LT: {
             double x = Evaluate(dataset, ref row, state);
             double y = Evaluate(dataset, ref row, state);
-            if (x < y) return 1.0;
-            else return -1.0;
-          }
-        case OpCodes.TimeLag:
-          {
+            if (x < y) { return 1.0; } else { return -1.0; }
+          }
+        case OpCodes.TimeLag: {
             var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
             row += timeLagTreeNode.Lag;
@@ -414,6 +391,5 @@
             return result;
           }
-        case OpCodes.Integral:
-          {
+        case OpCodes.Integral: {
             int savedPc = state.ProgramCounter;
             var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
@@ -433,6 +409,5 @@
         //one sided smooth differentiatior, N = 4
         // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
-        case OpCodes.Derivative:
-          {
+        case OpCodes.Derivative: {
             int savedPc = state.ProgramCounter;
             double f_0 = Evaluate(dataset, ref row, state); row--;
@@ -447,6 +422,5 @@
             return (f_0 + 2 * f_1 - 2 * f_3 - f_4) / 8; // h = 1
           }
-        case OpCodes.Call:
-          {
+        case OpCodes.Call: {
             // evaluate sub-trees
             double[] argValues = new double[currentInstr.nArguments];
@@ -471,23 +445,19 @@
             return v;
           }
-        case OpCodes.Arg:
-          {
+        case OpCodes.Arg: {
             return state.GetStackFrameValue((ushort)currentInstr.data);
           }
-        case OpCodes.Variable:
-          {
+        case OpCodes.Variable: {
             if (row < 0 || row >= dataset.Rows) return double.NaN;
             var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode;
             return ((IList<double>)currentInstr.data)[row] * variableTreeNode.Weight;
           }
-        case OpCodes.LagVariable:
-          {
+        case OpCodes.LagVariable: {
             var laggedVariableTreeNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
             int actualRow = row + laggedVariableTreeNode.Lag;
-            if (actualRow < 0 || actualRow >= dataset.Rows) return double.NaN;
+            if (actualRow < 0 || actualRow >= dataset.Rows) { return double.NaN; }
             return ((IList<double>)currentInstr.data)[actualRow] * laggedVariableTreeNode.Weight;
           }
-        case OpCodes.Constant:
-          {
+        case OpCodes.Constant: {
             var constTreeNode = (ConstantTreeNode)currentInstr.dynamicNode;
             return constTreeNode.Value;
@@ -496,6 +466,5 @@
         //mkommend: this symbol uses the logistic function f(x) = 1 / (1 + e^(-alpha * x) ) 
         //to determine the relative amounts of the true and false branch see http://en.wikipedia.org/wiki/Logistic_function
-        case OpCodes.VariableCondition:
-          {
+        case OpCodes.VariableCondition: {
             if (row < 0 || row >= dataset.Rows) return double.NaN;
             var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode;
@@ -509,5 +478,6 @@
             return trueBranch * p + falseBranch * (1 - p);
           }
-        default: throw new NotSupportedException();
+        default:
+          throw new NotSupportedException();
       }
     }
Index: /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
===================================================================
--- /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 13221)
+++ /branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 13222)
@@ -35,4 +35,5 @@
   public sealed class SymbolicDataAnalysisExpressionTreeLinearInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
     private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
     private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
 
@@ -84,6 +85,5 @@
     public SymbolicDataAnalysisExpressionTreeLinearInterpreter()
       : base("SymbolicDataAnalysisExpressionTreeLinearInterpreter", "Linear (non-recursive) interpreter for symbolic expression trees (does not support ADFs).") {
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
       Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
       interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
@@ -92,6 +92,5 @@
     public SymbolicDataAnalysisExpressionTreeLinearInterpreter(string name, string description)
       : base(name, description) {
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
       Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
       interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
@@ -100,11 +99,18 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      if (interpreter == null) interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
-      Parameters.Remove(EvaluatedSolutionsParameterName);
-      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
-
-      Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
-      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
-        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      var evaluatedSolutions = new IntValue(0);
+      var checkExpressionsWithIntervalArithmetic = new BoolValue(false);
+      if (Parameters.ContainsKey(EvaluatedSolutionsParameterName)) {
+        var evaluatedSolutionsParameter = (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName];
+        evaluatedSolutions = evaluatedSolutionsParameter.Value;
+        Parameters.Remove(EvaluatedSolutionsParameterName);
+      }
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", evaluatedSolutions));
+      if (Parameters.ContainsKey(CheckExpressionsWithIntervalArithmeticParameterName)) {
+        var checkExpressionsWithIntervalArithmeticParameter = (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName];
+        Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
+        checkExpressionsWithIntervalArithmetic = checkExpressionsWithIntervalArithmeticParameter.Value;
+      }
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, checkExpressionsWithIntervalArithmetic));
     }
 
@@ -372,6 +378,5 @@
         #region opcode switch
         switch (instr.opCode) {
-          case OpCodes.Constant:
-            {
+          case OpCodes.Constant: {
               var constTreeNode = (ConstantTreeNode)instr.dynamicNode;
               instr.value = constTreeNode.Value;
@@ -379,18 +384,15 @@
             }
             break;
-          case OpCodes.Variable:
-            {
+          case OpCodes.Variable: {
               var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
               instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
             }
             break;
-          case OpCodes.LagVariable:
-            {
+          case OpCodes.LagVariable: {
               var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
               instr.data = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
             }
             break;
-          case OpCodes.VariableCondition:
-            {
+          case OpCodes.VariableCondition: {
               var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
               instr.data = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
@@ -399,6 +401,5 @@
           case OpCodes.TimeLag:
           case OpCodes.Integral:
-          case OpCodes.Derivative:
-            {
+          case OpCodes.Derivative: {
               var seq = GetPrefixSequence(code, i);
               var interpreterState = new InterpreterState(seq, 0);
