Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs	(revision 8916)
@@ -21,5 +21,5 @@
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
-  partial class SymbolicExpressionTreeChart {
+  public partial class SymbolicExpressionTreeChart {
     /// <summary> 
     /// Required designer variable.
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj	(revision 8916)
@@ -0,0 +1,240 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{BF1E4DF4-A4CC-451F-9D50-303F405E265E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="InteractiveSymbolicClassificationSolutionSimplifierView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicClassificationSolutionSimplifierView.Designer.cs">
+      <DependentUpon>InteractiveSymbolicClassificationSolutionSimplifierView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicClassificationSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicClassificationSolutionView.Designer.cs">
+      <DependentUpon>SymbolicClassificationSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="InteractiveSymbolicClassificationSolutionSimplifierViewBase.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicClassificationSolutionSimplifierViewBase.Designer.cs">
+      <DependentUpon>InteractiveSymbolicClassificationSolutionSimplifierViewBase.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="SymbolicDiscriminantFunctionClassificationSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicDiscriminantFunctionClassificationSolutionView.Designer.cs">
+      <DependentUpon>SymbolicDiscriminantFunctionClassificationSolutionView.cs</DependentUpon>
+    </Compile>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+    <Compile Include="InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.Designer.cs">
+      <DependentUpon>InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj">
+      <Project>{05bae4e1-a9fa-4644-aa77-42558720159e}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj">
+      <Project>{7a2531ce-3f7c-4f13-bcca-ed6dc27a7086}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierView.Designer.cs	(revision 8916)
@@ -0,0 +1,60 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  partial class InteractiveSymbolicClassificationSolutionSimplifierView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.SuspendLayout();
+      // 
+      // InteractiveSymbolicRegressionSolutionSimplifierView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Name = "InteractiveSymbolicRegressionSolutionSimplifierView";
+      this.Size = new System.Drawing.Size(564, 348);
+      this.ResumeLayout(false);
+    }
+
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierView.cs	(revision 8916)
@@ -0,0 +1,38 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Classification.Views {
+  public partial class InteractiveSymbolicClassificationSolutionSimplifierView : InteractiveSymbolicClassificationSolutionSimplifierViewBase {
+
+    public new SymbolicClassificationSolution Content {
+      get { return (SymbolicClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public InteractiveSymbolicClassificationSolutionSimplifierView() : base() { }
+
+    protected override void UpdateModel(ISymbolicExpressionTree tree) {
+      Content.Model = CreateModel(tree);
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.Designer.cs	(revision 8916)
@@ -0,0 +1,60 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  partial class InteractiveSymbolicClassificationSolutionSimplifierViewBase {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.SuspendLayout();
+      // 
+      // InteractiveSymbolicRegressionSolutionSimplifierView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Name = "InteractiveSymbolicRegressionSolutionSimplifierView";
+      this.Size = new System.Drawing.Size(564, 348);
+      this.ResumeLayout(false);
+    }
+
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.cs	(revision 8916)
@@ -0,0 +1,139 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  public abstract partial class InteractiveSymbolicClassificationSolutionSimplifierViewBase : InteractiveSymbolicDataAnalysisSolutionSimplifierView {
+    private readonly ConstantTreeNode constantNode;
+    private readonly SymbolicExpressionTree tempTree;
+
+    public new ISymbolicClassificationSolution Content {
+      get { return (ISymbolicClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public InteractiveSymbolicClassificationSolutionSimplifierViewBase()
+      : base() {
+      InitializeComponent();
+      this.Caption = "Interactive Classification Solution Simplifier";
+
+      constantNode = ((ConstantTreeNode)new Constant().CreateTreeNode());
+      ISymbolicExpressionTreeNode root = new ProgramRootSymbol().CreateTreeNode();
+      ISymbolicExpressionTreeNode start = new StartSymbol().CreateTreeNode();
+      root.AddSubtree(start);
+      tempTree = new SymbolicExpressionTree(root);
+    }
+
+    /// <summary>
+    /// It is necessary to create new models of an unknown type with new trees in the simplifier.
+    /// For this purpose the cloner is used by registering the new tree as already cloned object and invoking the clone mechanism.
+    /// This results in a new model of the same type as the old one with an exchanged tree.
+    /// </summary>
+    /// <param name="tree">The new tree that should be included in the new object</param>
+    /// <returns></returns>
+    protected ISymbolicClassificationModel CreateModel(ISymbolicExpressionTree tree) {
+      var cloner = new Cloner();
+      cloner.RegisterClonedObject(Content.Model.SymbolicExpressionTree, tree);
+
+      var model = (ISymbolicClassificationModel)Content.Model.Clone(cloner);
+      model.RecalculateModelParameters(Content.ProblemData, Content.ProblemData.TrainingIndices);
+      return model;
+    }
+
+    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree) {
+      Dictionary<ISymbolicExpressionTreeNode, double> replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      foreach (ISymbolicExpressionTreeNode node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
+        replacementValues[node] = CalculateReplacementValue(node, tree);
+      }
+      return replacementValues;
+    }
+
+    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree) {
+      var model = Content.Model;
+      var dataset = Content.ProblemData.Dataset;
+      var rows = Content.ProblemData.TrainingIndices;
+      string targetVariable = Content.ProblemData.TargetVariable;
+      Dictionary<ISymbolicExpressionTreeNode, double> impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPostfix().ToList();
+
+      var targetClassValues = dataset.GetDoubleValues(targetVariable, rows);
+      var originalClassValues = model.GetEstimatedClassValues(dataset, rows);
+      OnlineCalculatorError errorState;
+      double originalAccuracy = OnlineAccuracyCalculator.Calculate(targetClassValues, originalClassValues, out errorState);
+      if (errorState != OnlineCalculatorError.None) originalAccuracy = 0.0;
+
+      foreach (ISymbolicExpressionTreeNode node in nodes) {
+        var parent = node.Parent;
+        constantNode.Value = CalculateReplacementValue(node, tree);
+        ISymbolicExpressionTreeNode replacementNode = constantNode;
+        SwitchNode(parent, node, replacementNode);
+        var newModel = CreateModel(tree);
+        var newClassValues = newModel.GetEstimatedClassValues(dataset, rows);
+        double newAccuracy = OnlineAccuracyCalculator.Calculate(targetClassValues, newClassValues, out errorState);
+        if (errorState != OnlineCalculatorError.None) newAccuracy = 0.0;
+
+        // impact = 0 if no change
+        // impact < 0 if new solution is better
+        // impact > 0 if new solution is worse
+        impactValues[node] = originalAccuracy - newAccuracy;
+        SwitchNode(parent, replacementNode, node);
+      }
+      return impactValues;
+    }
+
+    private double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree) {
+      // remove old ADFs
+      while (tempTree.Root.SubtreeCount > 1) tempTree.Root.RemoveSubtree(1);
+      // clone ADFs of source tree
+      for (int i = 1; i < sourceTree.Root.SubtreeCount; i++) {
+        tempTree.Root.AddSubtree((ISymbolicExpressionTreeNode)sourceTree.Root.GetSubtree(i).Clone());
+      }
+      var start = tempTree.Root.GetSubtree(0);
+      while (start.SubtreeCount > 0) start.RemoveSubtree(0);
+      start.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());
+      var interpreter = Content.Model.Interpreter;
+      var rows = Content.ProblemData.TrainingIndices;
+      return interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, rows)
+             .LimitToRange(Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit).Median();
+    }
+
+
+    private void SwitchNode(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode oldBranch, ISymbolicExpressionTreeNode newBranch) {
+      for (int i = 0; i < root.SubtreeCount; i++) {
+        if (root.GetSubtree(i) == oldBranch) {
+          root.RemoveSubtree(i);
+          root.InsertSubtree(i, newBranch);
+          return;
+        }
+      }
+    }
+
+    protected override void btnOptimizeConstants_Click(object sender, EventArgs e) {
+
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.Designer.cs	(revision 8916)
@@ -0,0 +1,60 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  partial class InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.SuspendLayout();
+      // 
+      // InteractiveSymbolicRegressionSolutionSimplifierView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Name = "InteractiveSymbolicRegressionSolutionSimplifierView";
+      this.Size = new System.Drawing.Size(564, 348);
+      this.ResumeLayout(false);
+    }
+
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs	(revision 8916)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  public partial class InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView : InteractiveSymbolicClassificationSolutionSimplifierViewBase {
+    private readonly SymbolicDiscriminantFunctionClassificationSolutionImpactValuesCalculator calculator;
+
+    public new SymbolicDiscriminantFunctionClassificationSolution Content {
+      get { return (SymbolicDiscriminantFunctionClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView()
+      : base() {
+      InitializeComponent();
+      this.Caption = "Interactive Classification Solution Simplifier";
+
+      calculator = new SymbolicDiscriminantFunctionClassificationSolutionImpactValuesCalculator();
+    }
+
+    protected override void UpdateModel(ISymbolicExpressionTree tree) {
+      var model = CreateModel(tree);
+      model.RecalculateModelParameters(Content.ProblemData, Content.ProblemData.TrainingIndices);
+      Content.Model = (ISymbolicDiscriminantFunctionClassificationModel)model;
+    }
+
+    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree) {
+      return calculator.CalculateReplacementValues(tree, Content.Model.Interpreter, Content.ProblemData);
+    }
+
+    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree) {
+      return calculator.CalculateImpactValues(tree, Content.Model.Interpreter, Content.ProblemData,
+                                               Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit);
+    }
+
+    protected override void btnOptimizeConstants_Click(object sender, EventArgs e) {
+
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/Plugin.cs.frame
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/Plugin.cs.frame	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/Plugin.cs.frame	(revision 8916)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views","Provides views for symbolic classification problem classes.", "3.4.3.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization","3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Views", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")]
+  public class HeuristicLabProblemsDataAnalysisSymbolicClassificationViewsPlugin : PluginBase {
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 8916)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views")]
+[assembly: AssemblyDescription("Provides views for symbolic classification problem classes.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("87754F6C-2EC5-4CE8-BBB0-BBA7DE59A68B")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.3.$WCREV$")]
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.Designer.cs	(revision 8916)
@@ -0,0 +1,92 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  partial class SymbolicClassificationSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SymbolicDiscriminantFunctionClassificationSolutionView));
+      this.btnSimplify = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.itemsGroupBox.SuspendLayout();
+      this.detailsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // splitContainer
+      // 
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.btnSimplify);
+      // 
+      // btnSimplify
+      // 
+      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.btnSimplify.Location = new System.Drawing.Point(172, 4);
+      this.btnSimplify.Name = "btnSimplify";
+      this.btnSimplify.Size = new System.Drawing.Size(75, 23);
+      this.btnSimplify.TabIndex = 6;
+      this.btnSimplify.Text = "Simplify";
+      this.btnSimplify.UseVisualStyleBackColor = true;
+      this.btnSimplify.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
+      // 
+      // SymbolicDiscriminantFunctionClassificationSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.Name = "SymbolicDiscriminantFunctionClassificationSolutionView";
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.itemsGroupBox.ResumeLayout(false);
+      this.detailsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+    #endregion
+
+    protected System.Windows.Forms.Button btnSimplify;
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.cs	(revision 8916)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  [Content(typeof(SymbolicClassificationSolution), false)]
+  [View("SymbolicDiscriminantFunctionClassificationSolution View")]
+  public partial class SymbolicClassificationSolutionView : ClassificationSolutionView {
+    public SymbolicClassificationSolutionView() {
+      InitializeComponent();
+    }
+
+    protected new SymbolicClassificationSolution Content {
+      get { return (SymbolicClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
+      var view = new InteractiveSymbolicClassificationSolutionSimplifierView();
+      view.Content = (SymbolicClassificationSolution)this.Content.Clone();
+      view.Show();
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.Designer.cs	(revision 8916)
@@ -0,0 +1,92 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  partial class SymbolicDiscriminantFunctionClassificationSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SymbolicDiscriminantFunctionClassificationSolutionView));
+      this.btnSimplify = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.itemsGroupBox.SuspendLayout();
+      this.detailsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // splitContainer
+      // 
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.btnSimplify);
+      // 
+      // btnSimplify
+      // 
+      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.btnSimplify.Location = new System.Drawing.Point(172, 4);
+      this.btnSimplify.Name = "btnSimplify";
+      this.btnSimplify.Size = new System.Drawing.Size(75, 23);
+      this.btnSimplify.TabIndex = 6;
+      this.btnSimplify.Text = "Simplify";
+      this.btnSimplify.UseVisualStyleBackColor = true;
+      this.btnSimplify.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
+      // 
+      // SymbolicDiscriminantFunctionClassificationSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.Name = "SymbolicDiscriminantFunctionClassificationSolutionView";
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.itemsGroupBox.ResumeLayout(false);
+      this.detailsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+    #endregion
+
+    protected System.Windows.Forms.Button btnSimplify;
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs	(revision 8916)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
+  [Content(typeof(SymbolicDiscriminantFunctionClassificationSolution), false)]
+  [View("SymbolicDiscriminantFunctionClassificationSolution View")]
+  public partial class SymbolicDiscriminantFunctionClassificationSolutionView : DiscriminantFunctionClassificationSolutionView {
+    public SymbolicDiscriminantFunctionClassificationSolutionView() {
+      InitializeComponent();
+    }
+
+    protected new SymbolicDiscriminantFunctionClassificationSolution Content {
+      get { return (SymbolicDiscriminantFunctionClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
+      var view = new InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView();
+      view.Content = (SymbolicDiscriminantFunctionClassificationSolution)this.Content.Clone();
+      view.Show();
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj	(revision 8916)
@@ -126,4 +126,12 @@
       <Private>False</Private>
     </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
     <Reference Include="HeuristicLab.Operators-3.3">
       <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
@@ -149,4 +157,8 @@
       <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
       <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.Problems.Instances-3.3">
@@ -177,4 +189,5 @@
     <Compile Include="ModelCreators\NormalDistributedThresholdsModelCreator.cs" />
     <Compile Include="MultiObjective\SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs" />
+    <Compile Include="SymbolicDiscriminantFunctionClassificationSolutionImpactValuesCalculator.cs" />
     <Compile Include="SymbolicNearestNeighbourClassificationModel.cs" />
     <Compile Include="Plugin.cs" />
@@ -232,7 +245,6 @@
   <ItemGroup>
     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
-      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
-      <Private>False</Private>
     </ProjectReference>
   </ItemGroup>
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/AccuracyMaximizingThresholdsModelCreator.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/AccuracyMaximizingThresholdsModelCreator.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/AccuracyMaximizingThresholdsModelCreator.cs	(revision 8916)
@@ -0,0 +1,55 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
+  [StorableClass]
+  [Item("AccuracyMaximizingThresholdsModelCreator", "")]
+  public sealed class AccuracyMaximizingThresholdsModelCreator : Item, ISymbolicDiscriminantFunctionClassificationModelCreator {
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
+    }
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
+    }
+    [StorableConstructor]
+    private AccuracyMaximizingThresholdsModelCreator(bool deserializing) : base(deserializing) { }
+    private AccuracyMaximizingThresholdsModelCreator(AccuracyMaximizingThresholdsModelCreator original, Cloner cloner) : base(original, cloner) { }
+    public AccuracyMaximizingThresholdsModelCreator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) { return new AccuracyMaximizingThresholdsModelCreator(this, cloner); }
+
+
+    public ISymbolicClassificationModel CreateSymbolicClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue) {
+      return CreateSymbolicDiscriminantFunctionClassificationModel(tree, interpreter, lowerEstimationLimit, upperEstimationLimit);
+    }
+    public ISymbolicDiscriminantFunctionClassificationModel CreateSymbolicDiscriminantFunctionClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue) {
+      return new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter, new AccuracyMaximizationThresholdCalculator(), lowerEstimationLimit, upperEstimationLimit);
+    }
+
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NearestNeighborModelCreator.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NearestNeighborModelCreator.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NearestNeighborModelCreator.cs	(revision 8916)
@@ -0,0 +1,61 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
+  [StorableClass]
+  [Item("NearestNeighborModelCreator", "")]
+  public sealed class NearestNeighborModelCreator : ParameterizedNamedItem, ISymbolicClassificationModelCreator {
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
+    }
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
+    }
+
+    public IFixedValueParameter<IntValue> KParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["K"]; }
+    }
+
+    [StorableConstructor]
+    private NearestNeighborModelCreator(bool deserializing) : base(deserializing) { }
+    private NearestNeighborModelCreator(NearestNeighborModelCreator original, Cloner cloner) : base(original, cloner) { }
+    public NearestNeighborModelCreator()
+      : base() {
+      Parameters.Add(new FixedValueParameter<IntValue>("K", "The number of neighbours to use to determine the class.", new IntValue(3)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) { return new NearestNeighborModelCreator(this, cloner); }
+
+
+    public ISymbolicClassificationModel CreateSymbolicClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue) {
+      return new SymbolicNearestNeighbourClassificationModel(KParameter.Value.Value, tree, interpreter, lowerEstimationLimit, upperEstimationLimit);
+    }
+
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NormalDistributedThresholdsModelCreator.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NormalDistributedThresholdsModelCreator.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/ModelCreators/NormalDistributedThresholdsModelCreator.cs	(revision 8916)
@@ -0,0 +1,56 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
+  [StorableClass]
+  [Item("NormalDistributedThresholdsModelCreator", "")]
+  public sealed class NormalDistributedThresholdsModelCreator : Item, ISymbolicDiscriminantFunctionClassificationModelCreator {
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
+    }
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
+    }
+    [StorableConstructor]
+    private NormalDistributedThresholdsModelCreator(bool deserializing) : base(deserializing) { }
+    private NormalDistributedThresholdsModelCreator(NormalDistributedThresholdsModelCreator original, Cloner cloner) : base(original, cloner) { }
+    public NormalDistributedThresholdsModelCreator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) { return new NormalDistributedThresholdsModelCreator(this, cloner); }
+
+
+    public ISymbolicClassificationModel CreateSymbolicClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue) {
+      return CreateSymbolicDiscriminantFunctionClassificationModel(tree, interpreter, lowerEstimationLimit, upperEstimationLimit);
+    }
+    public ISymbolicDiscriminantFunctionClassificationModel CreateSymbolicDiscriminantFunctionClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue) {
+      return new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter, new NormalDistributionCutPointsThresholdCalculator(), lowerEstimationLimit, upperEstimationLimit);
+    }
+
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj	(revision 8916)
@@ -0,0 +1,240 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{20831A74-D18F-42D9-A667-1CE3AF53DF93}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3">
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Forms.DataVisualization" />
+    <Reference Include="System.Data" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="InteractiveSymbolicRegressionSolutionSimplifierView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs">
+      <DependentUpon>InteractiveSymbolicRegressionSolutionSimplifierView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="SymbolicRegressionSolutionResponseFunctionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicRegressionSolutionResponseFunctionView.Designer.cs">
+      <DependentUpon>SymbolicRegressionSolutionResponseFunctionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicRegressionSolutionErrorCharacteristicsCurveView.Designer.cs">
+      <DependentUpon>SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicRegressionSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicRegressionSolutionView.Designer.cs">
+      <DependentUpon>SymbolicRegressionSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="VariableTrackbar.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="VariableTrackbar.Designer.cs">
+      <DependentUpon>VariableTrackbar.cs</DependentUpon>
+    </Compile>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">
+      <Project>{5ac82412-911b-4fa2-a013-edc5e3f3fcc2}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj">
+      <Project>{7a2531ce-3f7c-4f13-bcca-ed6dc27a7086}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs	(revision 8916)
@@ -0,0 +1,61 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  partial class InteractiveSymbolicRegressionSolutionSimplifierView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.SuspendLayout();
+      // 
+      // InteractiveSymbolicRegressionSolutionSimplifierView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Name = "InteractiveSymbolicRegressionSolutionSimplifierView";
+      this.Size = new System.Drawing.Size(564, 348);
+      this.btnOptimizeConstants.Enabled = true;
+      this.ResumeLayout(false);
+    }
+
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 8916)
@@ -0,0 +1,64 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  public partial class InteractiveSymbolicRegressionSolutionSimplifierView : InteractiveSymbolicDataAnalysisSolutionSimplifierView {
+    private readonly SymbolicRegressionSolutionImpactValuesCalculator calculator;
+
+    public new SymbolicRegressionSolution Content {
+      get { return (SymbolicRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public InteractiveSymbolicRegressionSolutionSimplifierView()
+      : base() {
+      InitializeComponent();
+      this.Caption = "Interactive Regression Solution Simplifier";
+      calculator = new SymbolicRegressionSolutionImpactValuesCalculator();
+    }
+
+    protected override void UpdateModel(ISymbolicExpressionTree tree) {
+      var model = new SymbolicRegressionModel(tree, Content.Model.Interpreter, Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit);
+      SymbolicRegressionModel.Scale(model, Content.ProblemData, Content.ProblemData.TargetVariable);
+      Content.Model = model;
+    }
+
+    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree) {
+      return calculator.CalculateReplacementValues(tree, Content.Model.Interpreter, Content.ProblemData);
+    }
+
+    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree) {
+      return calculator.CalculateImpactValues(tree, Content.Model.Interpreter, Content.ProblemData, 0, 0);
+    }
+
+    protected override void btnOptimizeConstants_Click(object sender, EventArgs e) {
+      var model = Content.Model;
+      SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(model.Interpreter, model.SymbolicExpressionTree, Content.ProblemData, Content.ProblemData.TrainingIndices,
+        applyLinearScaling: true, maxIterations: 50, upperEstimationLimit: model.UpperEstimationLimit, lowerEstimationLimit: model.LowerEstimationLimit);
+      UpdateModel(Content.Model.SymbolicExpressionTree);
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Plugin.cs.frame
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Plugin.cs.frame	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Plugin.cs.frame	(revision 8916)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views", "Provides views for symbolic regression problem classes.", "3.4.3.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.dll",PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Data","3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization","3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Views", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")]
+  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]
+  public class HeuristicLabProblemsDataAnalysisSymbolicRegressionViewsPlugin : PluginBase {
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 8916)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views")]
+[assembly: AssemblyDescription("Provides views for symbolic regression problem classes.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("89DCAB86-78E1-4518-9F24-910FABD89B33")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.3.$WCREV$")]
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 8916)
@@ -0,0 +1,42 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  partial class SymbolicRegressionSolutionErrorCharacteristicsCurveView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
+      this.SuspendLayout();
+      //
+      // SymbolicRegressionSolutionErrorCharacteristicsCurveView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Name = "SymbolicRegressionSolutionErrorCharacteristicsCurveView";
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs	(revision 8916)
@@ -0,0 +1,92 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Algorithms.DataAnalysis;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  [View("Error Characteristics Curve")]
+  [Content(typeof(ISymbolicRegressionSolution))]
+  public partial class SymbolicRegressionSolutionErrorCharacteristicsCurveView : RegressionSolutionErrorCharacteristicsCurveView {
+    private IRegressionSolution linearRegressionSolution;
+    public SymbolicRegressionSolutionErrorCharacteristicsCurveView() {
+      InitializeComponent();
+    }
+
+    public new ISymbolicRegressionSolution Content {
+      get { return (ISymbolicRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      if (Content != null)
+        linearRegressionSolution = CreateLinearRegressionSolution();
+      else
+        linearRegressionSolution = null;
+
+      base.OnContentChanged();
+    }
+
+    protected override void UpdateChart() {
+      base.UpdateChart();
+      if (Content == null || linearRegressionSolution == null) return;
+      AddRegressionSolution(linearRegressionSolution);
+    }
+
+    private IRegressionSolution CreateLinearRegressionSolution() {
+      if (Content == null) throw new InvalidOperationException();
+      double rmse, cvRmsError;
+      var problemData = (IRegressionProblemData)ProblemData.Clone();
+
+      //clear checked inputVariables
+      foreach (var inputVariable in problemData.InputVariables.CheckedItems) {
+        problemData.InputVariables.SetItemCheckedState(inputVariable.Value, false);
+      }
+
+      //check inputVariables used in the symbolic regression model
+      var usedVariables =
+        Content.Model.SymbolicExpressionTree.IterateNodesPostfix().OfType<VariableTreeNode>().Select(
+          node => node.VariableName).Distinct();
+      foreach (var variable in usedVariables) {
+        problemData.InputVariables.SetItemCheckedState(
+          problemData.InputVariables.First(x => x.Value == variable), true);
+      }
+
+      var solution = LinearRegression.CreateLinearRegressionSolution(problemData, out rmse, out cvRmsError);
+      solution.Name = "Linear Model";
+      return solution;
+    }
+
+    protected override void Content_ModelChanged(object sender, EventArgs e) {
+      linearRegressionSolution = CreateLinearRegressionSolution();
+      base.Content_ModelChanged(sender, e);
+    }
+
+    protected override void Content_ProblemDataChanged(object sender, EventArgs e) {
+      linearRegressionSolution = CreateLinearRegressionSolution();
+      base.Content_ProblemDataChanged(sender, e);
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionResponseFunctionView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionResponseFunctionView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionResponseFunctionView.Designer.cs	(revision 8916)
@@ -0,0 +1,169 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  partial class SymbolicRegressionSolutionResponseFunctionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
+      this.responseChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+      this.comboBox = new System.Windows.Forms.ComboBox();
+      this.freeVariableLabel = new System.Windows.Forms.Label();
+      ((System.ComponentModel.ISupportInitialize)(this.responseChart)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // flowLayoutPanel
+      // 
+      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.flowLayoutPanel.AutoScroll = true;
+      this.flowLayoutPanel.Location = new System.Drawing.Point(3, 202);
+      this.flowLayoutPanel.Name = "flowLayoutPanel";
+      this.flowLayoutPanel.Size = new System.Drawing.Size(261, 268);
+      this.flowLayoutPanel.TabIndex = 2;
+      this.flowLayoutPanel.WrapContents = false;
+      // 
+      // responseChart
+      // 
+      this.responseChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      chartArea1.Name = "ChartArea";
+      this.responseChart.ChartAreas.Add(chartArea1);
+      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+      legend1.LegendStyle = System.Windows.Forms.DataVisualization.Charting.LegendStyle.Row;
+      legend1.Name = "Legend";
+      this.responseChart.Legends.Add(legend1);
+      this.responseChart.Location = new System.Drawing.Point(3, 30);
+      this.responseChart.Name = "responseChart";
+      series1.ChartArea = "ChartArea";
+      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastPoint;
+      series1.Legend = "Legend";
+      series1.MarkerColor = System.Drawing.Color.Gold;
+      series1.MarkerSize = 3;
+      series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Diamond;
+      series1.Name = "Training Data (edge)";
+      series2.ChartArea = "ChartArea";
+      series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastPoint;
+      series2.Legend = "Legend";
+      series2.MarkerColor = System.Drawing.Color.OrangeRed;
+      series2.MarkerSize = 3;
+      series2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Diamond;
+      series2.Name = "Test Data (edge)";
+      series3.ChartArea = "ChartArea";
+      series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastPoint;
+      series3.Legend = "Legend";
+      series3.MarkerColor = System.Drawing.Color.Gold;
+      series3.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Diamond;
+      series3.Name = "Training Data";
+      series4.ChartArea = "ChartArea";
+      series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastPoint;
+      series4.Legend = "Legend";
+      series4.MarkerColor = System.Drawing.Color.OrangeRed;
+      series4.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Diamond;
+      series4.Name = "Test Data";
+      series5.BorderWidth = 3;
+      series5.ChartArea = "ChartArea";
+      series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
+      series5.Color = System.Drawing.Color.DodgerBlue;
+      series5.Legend = "Legend";
+      series5.MarkerSize = 1;
+      series5.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Cross;
+      series5.Name = "Model Response";
+      series5.ShadowColor = System.Drawing.Color.DodgerBlue;
+      this.responseChart.Series.Add(series1);
+      this.responseChart.Series.Add(series2);
+      this.responseChart.Series.Add(series3);
+      this.responseChart.Series.Add(series4);
+      this.responseChart.Series.Add(series5);
+      this.responseChart.Size = new System.Drawing.Size(258, 166);
+      this.responseChart.TabIndex = 3;
+      // 
+      // comboBox
+      // 
+      this.comboBox.FormattingEnabled = true;
+      this.comboBox.Location = new System.Drawing.Point(80, 3);
+      this.comboBox.Name = "comboBox";
+      this.comboBox.Size = new System.Drawing.Size(166, 21);
+      this.comboBox.TabIndex = 4;
+      this.comboBox.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectedIndexChanged);
+      // 
+      // freeVariableLabel
+      // 
+      this.freeVariableLabel.AutoSize = true;
+      this.freeVariableLabel.Location = new System.Drawing.Point(3, 6);
+      this.freeVariableLabel.Name = "freeVariableLabel";
+      this.freeVariableLabel.Size = new System.Drawing.Size(71, 13);
+      this.freeVariableLabel.TabIndex = 5;
+      this.freeVariableLabel.Text = "Free variable:";
+      // 
+      // SymbolicDataAnalysisSolutionResponseFunctionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.freeVariableLabel);
+      this.Controls.Add(this.comboBox);
+      this.Controls.Add(this.responseChart);
+      this.Controls.Add(this.flowLayoutPanel);
+      this.Name = "SymbolicDataAnalysisSolutionResponseFunctionView";
+      this.Size = new System.Drawing.Size(264, 473);
+      ((System.ComponentModel.ISupportInitialize)(this.responseChart)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
+    private System.Windows.Forms.DataVisualization.Charting.Chart responseChart;
+    private System.Windows.Forms.ComboBox comboBox;
+    private System.Windows.Forms.Label freeVariableLabel;
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionResponseFunctionView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionResponseFunctionView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionResponseFunctionView.cs	(revision 8916)
@@ -0,0 +1,242 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  [View("Response Function View")]
+  [Content(typeof(ISymbolicRegressionSolution), false)]
+  public partial class SymbolicRegressionSolutionResponseFunctionView : ItemView {
+    private Dictionary<string, List<ISymbolicExpressionTreeNode>> variableNodes;
+    private ISymbolicExpressionTree clonedTree;
+    private Dictionary<string, double> medianValues;
+    public SymbolicRegressionSolutionResponseFunctionView() {
+      InitializeComponent();
+      variableNodes = new Dictionary<string, List<ISymbolicExpressionTreeNode>>();
+      medianValues = new Dictionary<string, double>();
+      Caption = "Response Function View";
+    }
+
+    public new ISymbolicRegressionSolution Content {
+      get { return (ISymbolicRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+    private void Content_ModelChanged(object sender, EventArgs e) {
+      OnModelChanged();
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      OnProblemDataChanged();
+    }
+
+    protected virtual void OnModelChanged() {
+      this.UpdateView();
+    }
+
+    protected virtual void OnProblemDataChanged() {
+      this.UpdateView();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      this.UpdateView();
+    }
+
+    private void UpdateView() {
+      if (Content != null && Content.Model != null && Content.ProblemData != null) {
+        var referencedVariables =
+       (from varNode in Content.Model.SymbolicExpressionTree.IterateNodesPrefix().OfType<VariableTreeNode>()
+        select varNode.VariableName)
+         .Distinct()
+         .OrderBy(x => x, new NaturalStringComparer())
+         .ToList();
+
+        medianValues.Clear();
+        foreach (var variableName in referencedVariables) {
+          medianValues.Add(variableName, Content.ProblemData.Dataset.GetDoubleValues(variableName).Median());
+        }
+
+        comboBox.Items.Clear();
+        comboBox.Items.AddRange(referencedVariables.ToArray());
+        comboBox.SelectedIndex = 0;
+      }
+    }
+
+    private void CreateSliders(IEnumerable<string> variableNames) {
+      flowLayoutPanel.Controls.Clear();
+
+      foreach (var variableName in variableNames) {
+        var variableTrackbar = new VariableTrackbar(variableName,
+                                                    Content.ProblemData.Dataset.GetDoubleValues(variableName));
+        variableTrackbar.Size = new Size(variableTrackbar.Size.Width, flowLayoutPanel.Size.Height - 23);
+        variableTrackbar.ValueChanged += TrackBarValueChanged;
+        flowLayoutPanel.Controls.Add(variableTrackbar);
+      }
+    }
+
+    private void TrackBarValueChanged(object sender, EventArgs e) {
+      var trackBar = (VariableTrackbar)sender;
+      string variableName = trackBar.VariableName;
+      ChangeVariableValue(variableName, trackBar.Value);
+    }
+
+    private void ChangeVariableValue(string variableName, double value) {
+      foreach (var constNode in variableNodes[variableName].Cast<ConstantTreeNode>())
+        constNode.Value = value;
+
+      UpdateResponseSeries();
+    }
+
+    private void UpdateScatterPlot() {
+      string freeVariable = (string)comboBox.SelectedItem;
+      IEnumerable<string> fixedVariables = comboBox.Items.OfType<string>()
+        .Except(new string[] { freeVariable });
+
+      // scatter plots for subset of samples that have values near the median values for all variables
+      Func<int, bool> NearMedianValue = (r) => {
+        foreach (var fixedVar in fixedVariables) {
+          double med = medianValues[fixedVar];
+          if (!(Content.ProblemData.Dataset.GetDoubleValue(fixedVar, r) < med + 0.1 * Math.Abs(med) &&
+            Content.ProblemData.Dataset.GetDoubleValue(fixedVar, r) > med - 0.1 * Math.Abs(med)))
+            return false;
+        }
+        return true;
+      };
+
+      var mainTrainingIndices = (from row in Content.ProblemData.TrainingIndices
+                                 where NearMedianValue(row)
+                                 select row)
+        .ToArray();
+      var mainTestIndices = (from row in Content.ProblemData.TestIndices
+                             where NearMedianValue(row)
+                             select row)
+        .ToArray();
+
+      var freeVariableValues = Content.ProblemData.Dataset.GetDoubleValues(freeVariable, mainTrainingIndices).ToArray();
+      var trainingValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable,
+                                                                     mainTrainingIndices).ToArray();
+      Array.Sort(freeVariableValues, trainingValues);
+      responseChart.Series["Training Data"].Points.DataBindXY(freeVariableValues, trainingValues);
+
+      freeVariableValues = Content.ProblemData.Dataset.GetDoubleValues(freeVariable, mainTestIndices).ToArray();
+      var testValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable,
+                                                                     mainTestIndices).ToArray();
+      Array.Sort(freeVariableValues, testValues);
+      responseChart.Series["Test Data"].Points.DataBindXY(freeVariableValues, testValues);
+
+      // draw scatter plots of remaining values
+      freeVariableValues = Content.ProblemData.Dataset.GetDoubleValues(freeVariable, Content.ProblemData.TrainingIndices).ToArray();
+      trainingValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable,
+                                                                     Content.ProblemData.TrainingIndices).ToArray();
+      Array.Sort(freeVariableValues, trainingValues);
+      responseChart.Series["Training Data (edge)"].Points.DataBindXY(freeVariableValues, trainingValues);
+
+      freeVariableValues = Content.ProblemData.Dataset.GetDoubleValues(freeVariable, Content.ProblemData.TestIndices).ToArray();
+      testValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable,
+                                                                     Content.ProblemData.TestIndices).ToArray();
+      Array.Sort(freeVariableValues, testValues);
+      responseChart.Series["Test Data (edge)"].Points.DataBindXY(freeVariableValues, testValues);
+
+
+
+      responseChart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(freeVariableValues.Max());
+      responseChart.ChartAreas[0].AxisX.Minimum = Math.Floor(freeVariableValues.Min());
+      responseChart.ChartAreas[0].AxisY.Maximum = Math.Ceiling(Math.Max(testValues.Max(), trainingValues.Max()));
+      responseChart.ChartAreas[0].AxisY.Minimum = Math.Floor(Math.Min(testValues.Min(), trainingValues.Min()));
+    }
+
+    private void UpdateResponseSeries() {
+      string freeVariable = (string)comboBox.SelectedItem;
+
+      var freeVariableValues = Content.ProblemData.Dataset.GetDoubleValues(freeVariable, Content.ProblemData.TrainingIndices).ToArray();
+      var responseValues = Content.Model.Interpreter.GetSymbolicExpressionTreeValues(clonedTree,
+                                                                              Content.ProblemData.Dataset,
+                                                                              Content.ProblemData.TrainingIndices)
+                                                                              .ToArray();
+      Array.Sort(freeVariableValues, responseValues);
+      responseChart.Series["Model Response"].Points.DataBindXY(freeVariableValues, responseValues);
+    }
+
+    private void ComboBoxSelectedIndexChanged(object sender, EventArgs e) {
+      string freeVariable = (string)comboBox.SelectedItem;
+      IEnumerable<string> fixedVariables = comboBox.Items.OfType<string>()
+        .Except(new string[] { freeVariable });
+
+      variableNodes.Clear();
+      clonedTree = (ISymbolicExpressionTree)Content.Model.SymbolicExpressionTree.Clone();
+
+      foreach (var varNode in clonedTree.IterateNodesPrefix().OfType<VariableTreeNode>()) {
+        if (fixedVariables.Contains(varNode.VariableName)) {
+          if (!variableNodes.ContainsKey(varNode.VariableName))
+            variableNodes.Add(varNode.VariableName, new List<ISymbolicExpressionTreeNode>());
+
+          int childIndex = varNode.Parent.IndexOfSubtree(varNode);
+          var replacementNode = MakeConstantTreeNode(medianValues[varNode.VariableName]);
+          var parent = varNode.Parent;
+          parent.RemoveSubtree(childIndex);
+          parent.InsertSubtree(childIndex, MakeProduct(replacementNode, varNode.Weight));
+          variableNodes[varNode.VariableName].Add(replacementNode);
+        }
+      }
+
+      CreateSliders(fixedVariables);
+      UpdateScatterPlot();
+      UpdateResponseSeries();
+    }
+
+    private ISymbolicExpressionTreeNode MakeProduct(ConstantTreeNode c, double weight) {
+      var mul = new Multiplication();
+      var prod = mul.CreateTreeNode();
+      prod.AddSubtree(MakeConstantTreeNode(weight));
+      prod.AddSubtree(c);
+      return prod;
+    }
+
+    private ConstantTreeNode MakeConstantTreeNode(double value) {
+      Constant constant = new Constant();
+      constant.MinValue = value - 1;
+      constant.MaxValue = value + 1;
+      ConstantTreeNode constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
+      constantTreeNode.Value = value;
+      return constantTreeNode;
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.Designer.cs	(revision 8916)
@@ -0,0 +1,97 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  partial class SymbolicRegressionSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.btnSimplify = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.itemsGroupBox.SuspendLayout();
+      this.detailsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // splitContainer
+      // 
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.btnSimplify);
+      this.splitContainer.Size = new System.Drawing.Size(480, 275);
+      this.splitContainer.SplitterDistance = 255;
+      // 
+      // itemsGroupBox
+      // 
+      this.itemsGroupBox.Size = new System.Drawing.Size(486, 294);
+      // 
+      // itemsListView
+      // 
+      this.itemsListView.Size = new System.Drawing.Size(249, 238);
+      // 
+      // detailsGroupBox
+      // 
+      this.detailsGroupBox.Size = new System.Drawing.Size(215, 246);
+      // 
+      // addButton
+      // 
+      this.toolTip.SetToolTip(this.addButton, "Add");
+      // 
+      // removeButton
+      // 
+      this.toolTip.SetToolTip(this.removeButton, "Remove");
+      // 
+      // viewHost
+      // 
+      this.viewHost.Size = new System.Drawing.Size(203, 221);
+      // 
+      // btnSimplify
+      // 
+      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.btnSimplify.Location = new System.Drawing.Point(177, 4);
+      this.btnSimplify.Name = "btnSimplify";
+      this.btnSimplify.Size = new System.Drawing.Size(75, 23);
+      this.btnSimplify.TabIndex = 6;
+      this.btnSimplify.Text = "Simplify";
+      this.btnSimplify.UseVisualStyleBackColor = true;
+      this.btnSimplify.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
+      // 
+      // SymbolicRegressionSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.Name = "SymbolicRegressionSolutionView";
+      this.Size = new System.Drawing.Size(486, 294);
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.itemsGroupBox.ResumeLayout(false);
+      this.detailsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+    private System.Windows.Forms.Button btnSimplify;
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs	(revision 8916)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  [Content(typeof(SymbolicRegressionSolution), false)]
+  [View("SymbolicRegressionSolution View")]
+  public partial class SymbolicRegressionSolutionView : RegressionSolutionView {
+    public SymbolicRegressionSolutionView() {
+      InitializeComponent();
+    }
+
+    protected new SymbolicRegressionSolution Content {
+      get { return (SymbolicRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
+      InteractiveSymbolicRegressionSolutionSimplifierView view = new InteractiveSymbolicRegressionSolutionSimplifierView();
+      view.Content = (SymbolicRegressionSolution)this.Content.Clone();
+      view.Show();
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.Designer.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.Designer.cs	(revision 8916)
@@ -0,0 +1,136 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  partial class VariableTrackbar {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      this.valueLabel = new System.Windows.Forms.Label();
+      this.valueTextBox = new System.Windows.Forms.TextBox();
+      this.trackBar = new System.Windows.Forms.TrackBar();
+      this.boxPlotChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+      this.groupBox = new System.Windows.Forms.GroupBox();
+      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
+      ((System.ComponentModel.ISupportInitialize)(this.boxPlotChart)).BeginInit();
+      this.groupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // valueLabel
+      // 
+      this.valueLabel.AutoSize = true;
+      this.valueLabel.Location = new System.Drawing.Point(6, 22);
+      this.valueLabel.Name = "valueLabel";
+      this.valueLabel.Size = new System.Drawing.Size(37, 13);
+      this.valueLabel.TabIndex = 0;
+      this.valueLabel.Text = "Value:";
+      // 
+      // valueTextBox
+      // 
+      this.valueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.valueTextBox.Location = new System.Drawing.Point(49, 19);
+      this.valueTextBox.Name = "valueTextBox";
+      this.valueTextBox.ReadOnly = true;
+      this.valueTextBox.Size = new System.Drawing.Size(56, 20);
+      this.valueTextBox.TabIndex = 1;
+      // 
+      // trackBar
+      // 
+      this.trackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)));
+      this.trackBar.Location = new System.Drawing.Point(6, 45);
+      this.trackBar.Name = "trackBar";
+      this.trackBar.Orientation = System.Windows.Forms.Orientation.Vertical;
+      this.trackBar.Size = new System.Drawing.Size(45, 277);
+      this.trackBar.TabIndex = 2;
+      this.trackBar.TickStyle = System.Windows.Forms.TickStyle.None;
+      this.trackBar.ValueChanged += new System.EventHandler(this.TrackBarValueChanged);
+      // 
+      // boxPlotChart
+      // 
+      this.boxPlotChart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)));
+      this.boxPlotChart.BackColor = System.Drawing.SystemColors.Control;
+      chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
+      chartArea1.AxisY.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
+      chartArea1.BackColor = System.Drawing.SystemColors.Control;
+      chartArea1.BackSecondaryColor = System.Drawing.Color.White;
+      chartArea1.Name = "ChartArea";
+      this.boxPlotChart.ChartAreas.Add(chartArea1);
+      this.boxPlotChart.Location = new System.Drawing.Point(39, 45);
+      this.boxPlotChart.Name = "boxPlotChart";
+      series1.ChartArea = "ChartArea";
+      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.BoxPlot;
+      series1.Name = "BoxPlot";
+      series1.YValuesPerPoint = 6;
+      series2.ChartArea = "ChartArea";
+      series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
+      series2.Enabled = false;
+      series2.Name = "DataSeries";
+      this.boxPlotChart.Series.Add(series1);
+      this.boxPlotChart.Series.Add(series2);
+      this.boxPlotChart.Size = new System.Drawing.Size(66, 277);
+      this.boxPlotChart.TabIndex = 3;
+      this.boxPlotChart.Text = "boxPlotChart";
+      // 
+      // groupBox
+      // 
+      this.groupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.groupBox.Controls.Add(this.valueLabel);
+      this.groupBox.Controls.Add(this.boxPlotChart);
+      this.groupBox.Controls.Add(this.valueTextBox);
+      this.groupBox.Controls.Add(this.trackBar);
+      this.groupBox.Location = new System.Drawing.Point(3, 3);
+      this.groupBox.Name = "groupBox";
+      this.groupBox.Size = new System.Drawing.Size(111, 328);
+      this.groupBox.TabIndex = 4;
+      this.groupBox.TabStop = false;
+      this.groupBox.Text = "groupBox";
+      // 
+      // VariableTrackbar
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.groupBox);
+      this.Name = "VariableTrackbar";
+      this.Size = new System.Drawing.Size(117, 334);
+      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit();
+      ((System.ComponentModel.ISupportInitialize)(this.boxPlotChart)).EndInit();
+      this.groupBox.ResumeLayout(false);
+      this.groupBox.PerformLayout();
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label valueLabel;
+    private System.Windows.Forms.TextBox valueTextBox;
+    private System.Windows.Forms.TrackBar trackBar;
+    private System.Windows.Forms.DataVisualization.Charting.Chart boxPlotChart;
+    private System.Windows.Forms.GroupBox groupBox;
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/VariableTrackbar.cs	(revision 8916)
@@ -0,0 +1,62 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
+  public partial class VariableTrackbar : UserControl {
+    private readonly string variableName;
+    private const double FACTOR = 1000;
+
+    public double Value {
+      get { return trackBar.Value / FACTOR; }
+    }
+
+    public string VariableName {
+      get { return variableName; }
+    }
+
+    public VariableTrackbar(string variableName, IEnumerable<double> values) {
+      InitializeComponent();
+      this.variableName = variableName;
+      groupBox.Text = variableName;
+      var valuesArr = values.ToArray();
+      this.valueTextBox.Text = string.Format("{0:0.000e+00}", valuesArr.Median());
+      boxPlotChart.Series["DataSeries"].Points.Clear();
+      boxPlotChart.Series["DataSeries"].Points.DataBindY(valuesArr);
+      boxPlotChart.Series["BoxPlot"].ChartType = SeriesChartType.BoxPlot;
+      boxPlotChart.Series["BoxPlot"]["BoxPlotSeries"] = "DataSeries";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotWhiskerPercentile"] = "5";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotPercentile"] = "30";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotShowAverage"] = "true";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotShowMedian"] = "true";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotShowUnusualValues"] = "true";
+      boxPlotChart.ChartAreas[0].AxisY.Minimum = valuesArr.Min() ;
+      boxPlotChart.ChartAreas[0].AxisY.Maximum = valuesArr.Max() ;
+      
+
+      trackBar.Minimum = (int)Math.Round(valuesArr.Min() * FACTOR);
+      trackBar.Maximum = (int)Math.Round(valuesArr.Max() * FACTOR);
+      trackBar.Value = (int)Math.Round(valuesArr.Median() * FACTOR);
+      trackBar.TickStyle = TickStyle.None;
+      trackBar.Tag = variableName;
+    }
+
+    private void TrackBarValueChanged(object sender, EventArgs e) {
+      valueTextBox.Text = string.Format("{0:0.000e+00}", trackBar.Value / FACTOR);
+      RaiseValueChanged(EventArgs.Empty);
+    }
+
+    public event EventHandler ValueChanged;
+    private void RaiseValueChanged(EventArgs e) {
+      var handler = ValueChanged;
+      if (handler != null) handler(this, e);
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj	(revision 8916)
@@ -196,4 +196,5 @@
     <Compile Include="SingleObjective\Evaluators\SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs" />
     <Compile Include="SymbolicRegressionSolution.cs" />
+    <Compile Include="SymbolicRegressionSolutionImpactValuesCalculator.cs" />
     <None Include="HeuristicLab.snk" />
     <None Include="Plugin.cs.frame" />
@@ -220,7 +221,6 @@
   <ItemGroup>
     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
-      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
-      <Private>False</Private>
     </ProjectReference>
   </ItemGroup>
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 8916)
@@ -273,12 +273,10 @@
   <ItemGroup>
     <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj">
-      <Project>{423BD94F-963A-438E-BA45-3BB3D61CD03B}</Project>
+      <Project>{423bd94f-963a-438e-ba45-3bb3d61cd03b}</Project>
       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4</Name>
-      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
-      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
-      <Private>False</Private>
     </ProjectReference>
   </ItemGroup>
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 8916)
@@ -45,4 +45,5 @@
     /// </summary>
     private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
@@ -50,7 +51,6 @@
       this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
       this.btnSimplify = new System.Windows.Forms.Button();
-      this.btnPrune = new System.Windows.Forms.Button();
       this.btnOptimizeConstants = new System.Windows.Forms.Button();
-      this.treeChart = new InteractiveSymbolicExpressionTreeChart();
+      this.treeChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.InteractiveSymbolicExpressionTreeChart();
       this.grpViewHost = new System.Windows.Forms.GroupBox();
       this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
@@ -66,6 +66,6 @@
       // viewHost
       // 
-      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
+      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
       this.viewHost.Caption = "View";
@@ -112,8 +112,7 @@
       // flowLayoutPanel
       // 
-      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
       this.flowLayoutPanel.Controls.Add(this.btnSimplify);
-      this.flowLayoutPanel.Controls.Add(this.btnPrune);
       this.flowLayoutPanel.Controls.Add(this.btnOptimizeConstants);
       this.flowLayoutPanel.Location = new System.Drawing.Point(6, 313);
@@ -133,19 +132,9 @@
       this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
       // 
-      // btnPrune
-      // 
-      this.btnPrune.Location = new System.Drawing.Point(104, 3);
-      this.btnPrune.Name = "btnPrune";
-      this.btnPrune.Size = new System.Drawing.Size(95, 23);
-      this.btnPrune.TabIndex = 3;
-      this.btnPrune.Text = "Prune";
-      this.btnPrune.UseVisualStyleBackColor = true;
-      this.btnPrune.Click += new System.EventHandler(this.btnPrune_Click);
-      // 
       // btnOptimizeConstants
       // 
       this.btnOptimizeConstants.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
       this.btnOptimizeConstants.Enabled = false;
-      this.btnOptimizeConstants.Location = new System.Drawing.Point(205, 3);
+      this.btnOptimizeConstants.Location = new System.Drawing.Point(104, 3);
       this.btnOptimizeConstants.Name = "btnOptimizeConstants";
       this.btnOptimizeConstants.Size = new System.Drawing.Size(97, 23);
@@ -157,6 +146,6 @@
       // treeChart
       // 
-      this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
+      this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
       this.treeChart.BackgroundColor = System.Drawing.Color.White;
@@ -221,5 +210,4 @@
     private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
     protected System.Windows.Forms.Button btnOptimizeConstants;
-    private System.Windows.Forms.Button btnPrune;
     private System.ComponentModel.BackgroundWorker backgroundWorker1;
   }
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 8916)
@@ -47,5 +47,6 @@
       originalValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
       originalVariableNames = new Dictionary<ISymbolicExpressionTreeNode, string>();
-      Caption = "Interactive Solution Simplifier";
+
+      this.Caption = "Interactive Solution Simplifier";
     }
 
@@ -218,6 +219,8 @@
       var dialog = (ValueChangeDialog)sender;
       bool flag1 = false, flag2 = false;
-      if (dialog.Content is VariableTreeNode) {
-        var variable = (VariableTreeNode)dialog.Content;
+      var node = dialog.Content;
+
+      if (node is VariableTreeNode) {
+        var variable = dialog.Content as VariableTreeNode;
         var weight = double.Parse(dialog.NewValueTextBox.Text);
         var name = (string)dialog.VariableNameComboBox.SelectedItem;
@@ -232,6 +235,6 @@
           variable.VariableName = name;
         }
-      } else if (dialog.Content is ConstantTreeNode) {
-        var constant = (ConstantTreeNode)dialog.Content;
+      } else if (node is ConstantTreeNode) {
+        var constant = dialog.Content as ConstantTreeNode;
         var value = double.Parse(dialog.NewValueTextBox.Text);
         if (!constant.Value.Equals(value)) {
@@ -239,5 +242,4 @@
           originalValues[constant] = constant.Value;
           constant.Value = value;
-
         }
       }
@@ -324,8 +326,8 @@
     protected abstract void btnOptimizeConstants_Click(object sender, EventArgs e);
 
-    private void btnPrune_Click(object sender, EventArgs e) {
-      btnPrune.Enabled = false;
-      backgroundWorker1.RunWorkerAsync();
-    }
+    //    private void btnPrune_Click(object sender, EventArgs e) {
+    //      btnPrune.Enabled = false;
+    //      backgroundWorker1.RunWorkerAsync();
+    //    }
 
     private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) {
@@ -360,5 +362,5 @@
         updateInProgress = false;
       }
-      btnPrune.Enabled = true;
+      //      btnPrune.Enabled = true;
     }
 
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs	(revision 8916)
@@ -305,11 +305,14 @@
               // copy subtree
               var clone = tempNode.Clone() as ISymbolicExpressionTreeNode;
-              clone.Parent = tempNode.Parent;
-              tempNode = clone;
+              if (clone != null) {
+                clone.Parent = tempNode.Parent;
+                tempNode = clone;
+              }
               break;
             }
         }
         node.AddSubtree(tempNode);
-        Tree = Tree; // hack in order to trigger the reinitialization of the dictionaries after new nodes appeared in the graph
+        Tree = Tree;
+        // hack in order to trigger the reinitialization of the dictionaries after new nodes appeared in the graph
         OnSymbolicExpressionTreeChanged(sender, e);
       } else {
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.cs	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeChangeValueDialog.cs	(revision 8916)
@@ -94,5 +94,7 @@
         variableNamesCombo.Visible = true;
         foreach (var name in variable.Symbol.VariableNames) variableNamesCombo.Items.Add(name);
-        variableNamesCombo.SelectedIndex = 0;
+        variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variable.VariableName);
+        //        variableNamesCombo.SelectedText = variable.VariableName;
+        //        variableNamesCombo.SelectedIndex = 0;
       } else if (Content is ConstantTreeNode) {
         Caption = "Change constant value";
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 8916)
@@ -94,6 +94,5 @@
   <ItemGroup>
     <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.6.0.dll</HintPath>
+      <HintPath>..\..\bin\ALGLIB-3.6.0.dll</HintPath>
       <Private>False</Private>
     </Reference>
@@ -205,4 +204,5 @@
     <Compile Include="Crossovers\SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs" />
     <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionCrossover.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisImpactValuesCalculator.cs" />
     <Compile Include="Interpreter\InterpreterState.cs" />
     <Compile Include="Interpreter\OpCodes.cs" />
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs	(revision 8916)
@@ -0,0 +1,14 @@
+﻿using System.Collections.Generic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator {
+    Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree,
+                                                                               ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                                                               IDataAnalysisProblemData problemData);
+    Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree,
+                                                                          ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                                                          IDataAnalysisProblemData problemData,
+                                                                          double lowerEstimationLimit, double upperEstimationLimit);
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs	(revision 8916)
@@ -0,0 +1,93 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 {
+  public class InterpreterState {
+    private readonly double[] argumentStack;
+    private int argumentStackPointer;
+    private readonly Instruction[] code;
+
+    public int ProgramCounter { get; set; }
+    public bool InLaggedContext { get; set; }
+
+    public InterpreterState(Instruction[] code, int argumentStackSize) {
+      this.code = code;
+      this.ProgramCounter = 0;
+      this.InLaggedContext = false;
+      if (argumentStackSize > 0) {
+        this.argumentStack = new double[argumentStackSize];
+      }
+      this.argumentStackPointer = 0;
+    }
+
+    public void Reset() {
+      this.ProgramCounter = 0;
+      this.argumentStackPointer = 0;
+      this.InLaggedContext = false;
+    }
+
+    public Instruction NextInstruction() {
+      return code[ProgramCounter++];
+    }
+    // skips a whole branch
+    public void SkipInstructions() {
+      int i = 1;
+      while (i > 0) {
+        i += NextInstruction().nArguments;
+        i--;
+      }
+    }
+
+    private void Push(double val) {
+      argumentStack[argumentStackPointer++] = val;
+    }
+    private double Pop() {
+      return argumentStack[--argumentStackPointer];
+    }
+
+    public void CreateStackFrame(double[] argValues) {
+      // push in reverse order to make indexing easier
+      for (int i = argValues.Length - 1; i >= 0; i--) {
+        argumentStack[argumentStackPointer++] = argValues[i];
+      }
+      Push(argValues.Length);
+    }
+
+    public void RemoveStackFrame() {
+      int size = (int)Pop();
+      argumentStackPointer -= size;
+    }
+
+    public double GetStackFrameValue(ushort index) {
+      // layout of stack:
+      // [0]   <- argumentStackPointer
+      // [StackFrameSize = N + 1]
+      // [Arg0] <- argumentStackPointer - 2 - 0
+      // [Arg1] <- argumentStackPointer - 2 - 1
+      // [...]
+      // [ArgN] <- argumentStackPointer - 2 - N
+      // <Begin of stack frame>
+      return argumentStack[argumentStackPointer - index - 2];
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 8916)
@@ -0,0 +1,139 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public static class OpCodes {
+    public const byte Add = 1;
+    public const byte Sub = 2;
+    public const byte Mul = 3;
+    public const byte Div = 4;
+
+    public const byte Sin = 5;
+    public const byte Cos = 6;
+    public const byte Tan = 7;
+
+    public const byte Log = 8;
+    public const byte Exp = 9;
+
+    public const byte IfThenElse = 10;
+
+    public const byte GT = 11;
+    public const byte LT = 12;
+
+    public const byte AND = 13;
+    public const byte OR = 14;
+    public const byte NOT = 15;
+
+
+    public const byte Average = 16;
+
+    public const byte Call = 17;
+
+    public const byte Variable = 18;
+    public const byte LagVariable = 19;
+    public const byte Constant = 20;
+    public const byte Arg = 21;
+
+    public const byte Power = 22;
+    public const byte Root = 23;
+    public const byte TimeLag = 24;
+    public const byte Integral = 25;
+    public const byte Derivative = 26;
+
+    public const byte VariableCondition = 27;
+
+    public const byte Square = 28;
+    public const byte SquareRoot = 29;
+    public const byte Gamma = 30;
+    public const byte Psi = 31;
+    public const byte Dawson = 32;
+    public const byte ExponentialIntegralEi = 33;
+    public const byte CosineIntegral = 34;
+    public const byte SineIntegral = 35;
+    public const byte HyperbolicCosineIntegral = 36;
+    public const byte HyperbolicSineIntegral = 37;
+    public const byte FresnelCosineIntegral = 38;
+    public const byte FresnelSineIntegral = 39;
+    public const byte AiryA = 40;
+    public const byte AiryB = 41;
+    public const byte Norm = 42;
+    public const byte Erf = 43;
+    public const byte Bessel = 44;
+
+    private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
+       { typeof(Addition), OpCodes.Add },
+      { typeof(Subtraction), OpCodes.Sub },
+      { typeof(Multiplication), OpCodes.Mul },
+      { typeof(Division), OpCodes.Div },
+      { typeof(Sine), OpCodes.Sin },
+      { typeof(Cosine), OpCodes.Cos },
+      { typeof(Tangent), OpCodes.Tan },
+      { typeof(Logarithm), OpCodes.Log },
+      { typeof(Exponential), OpCodes.Exp },
+      { typeof(IfThenElse), OpCodes.IfThenElse },
+      { typeof(GreaterThan), OpCodes.GT },
+      { typeof(LessThan), OpCodes.LT },
+      { typeof(And), OpCodes.AND },
+      { typeof(Or), OpCodes.OR },
+      { typeof(Not), OpCodes.NOT},
+      { typeof(Average), OpCodes.Average},
+      { typeof(InvokeFunction), OpCodes.Call },
+      { typeof(Variable), OpCodes.Variable },
+      { typeof(LaggedVariable), OpCodes.LagVariable },
+      { typeof(AutoregressiveTargetVariable),OpCodes.LagVariable},
+      { typeof(Constant), OpCodes.Constant },
+      { typeof(Argument), OpCodes.Arg },
+      { typeof(Power),OpCodes.Power},
+      { typeof(Root),OpCodes.Root},
+      { typeof(TimeLag), OpCodes.TimeLag}, 
+      { typeof(Integral), OpCodes.Integral},
+      { typeof(Derivative), OpCodes.Derivative},
+      { typeof(VariableCondition),OpCodes.VariableCondition},
+      { typeof(Square),OpCodes.Square},
+      { typeof(SquareRoot),OpCodes.SquareRoot},
+      { typeof(Gamma), OpCodes.Gamma },
+      { typeof(Psi), OpCodes.Psi },
+      { typeof(Dawson), OpCodes.Dawson},
+      { typeof(ExponentialIntegralEi), OpCodes.ExponentialIntegralEi },
+      { typeof(CosineIntegral), OpCodes.CosineIntegral },
+      { typeof(SineIntegral), OpCodes.SineIntegral },
+      { typeof(HyperbolicCosineIntegral), OpCodes.HyperbolicCosineIntegral },
+      { typeof(HyperbolicSineIntegral), OpCodes.HyperbolicSineIntegral },
+      { typeof(FresnelCosineIntegral), OpCodes.FresnelCosineIntegral },
+      { typeof(FresnelSineIntegral), OpCodes.FresnelSineIntegral },
+      { typeof(AiryA), OpCodes.AiryA },
+      { typeof(AiryB), OpCodes.AiryB },
+      { typeof(Norm), OpCodes.Norm},
+      { typeof(Erf), OpCodes.Erf},
+      { typeof(Bessel), OpCodes.Bessel}   
+    };
+
+    public static byte MapSymbolToOpCode(ISymbolicExpressionTreeNode treeNode) {
+      byte opCode;
+      if (symbolToOpcode.TryGetValue(treeNode.Symbol.GetType(), out opCode)) return opCode;
+      else throw new NotSupportedException("Symbol: " + treeNode.Symbol);
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 8916)
@@ -0,0 +1,734 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Reflection.Emit;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.")]
+  public sealed class SymbolicDataAnalysisExpressionTreeILEmittingInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
+    private static readonly Type thisType = typeof(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter);
+    internal delegate double CompiledFunction(int sampleIndex, IList<double>[] columns);
+
+    #region method infos
+    private static MethodInfo listGetValue = typeof(IList<double>).GetProperty("Item", new Type[] { typeof(int) }).GetGetMethod();
+
+    private static MethodInfo cos = typeof(Math).GetMethod("Cos", new Type[] { typeof(double) });
+    private static MethodInfo sin = typeof(Math).GetMethod("Sin", new Type[] { typeof(double) });
+    private static MethodInfo tan = typeof(Math).GetMethod("Tan", new Type[] { typeof(double) });
+    private static MethodInfo exp = typeof(Math).GetMethod("Exp", new Type[] { typeof(double) });
+    private static MethodInfo log = typeof(Math).GetMethod("Log", new Type[] { typeof(double) });
+    private static MethodInfo power = typeof(Math).GetMethod("Pow", new Type[] { typeof(double), typeof(double) });
+    private static MethodInfo round = typeof(Math).GetMethod("Round", new Type[] { typeof(double) });
+    private static MethodInfo sqrt = typeof(Math).GetMethod("Sqrt", new Type[] { typeof(double) });
+
+    private static MethodInfo airyA = thisType.GetMethod("AiryA", new Type[] { typeof(double) });
+    private static MethodInfo airyB = thisType.GetMethod("AiryB", new Type[] { typeof(double) });
+    private static MethodInfo gamma = thisType.GetMethod("Gamma", new Type[] { typeof(double) });
+    private static MethodInfo psi = thisType.GetMethod("Psi", new Type[] { typeof(double) });
+    private static MethodInfo dawson = thisType.GetMethod("Dawson", new Type[] { typeof(double) });
+    private static MethodInfo expIntegralEi = thisType.GetMethod("ExpIntegralEi", new Type[] { typeof(double) });
+    private static MethodInfo sinIntegral = thisType.GetMethod("SinIntegral", new Type[] { typeof(double) });
+    private static MethodInfo cosIntegral = thisType.GetMethod("CosIntegral", new Type[] { typeof(double) });
+    private static MethodInfo hypSinIntegral = thisType.GetMethod("HypSinIntegral", new Type[] { typeof(double) });
+    private static MethodInfo hypCosIntegral = thisType.GetMethod("HypCosIntegral", new Type[] { typeof(double) });
+    private static MethodInfo fresnelCosIntegral = thisType.GetMethod("FresnelCosIntegral", new Type[] { typeof(double) });
+    private static MethodInfo fresnelSinIntegral = thisType.GetMethod("FresnelSinIntegral", new Type[] { typeof(double) });
+    private static MethodInfo norm = thisType.GetMethod("Norm", new Type[] { typeof(double) });
+    private static MethodInfo erf = thisType.GetMethod("Erf", new Type[] { typeof(double) });
+    private static MethodInfo bessel = thisType.GetMethod("Bessel", new Type[] { typeof(double) });
+    #endregion
+
+    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    #region parameter properties
+
+    public IValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
+    }
+
+    public IValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+
+    #endregion
+
+    #region properties
+
+    public BoolValue CheckExpressionsWithIntervalArithmetic {
+      get { return CheckExpressionsWithIntervalArithmeticParameter.Value; }
+      set { CheckExpressionsWithIntervalArithmeticParameter.Value = value; }
+    }
+
+    public IntValue EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value; }
+      set { EvaluatedSolutionsParameter.Value = value; }
+    }
+
+    #endregion
+
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(bool deserializing) : base(deserializing) { }
+
+    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(this, cloner);
+    }
+
+    public SymbolicDataAnalysisExpressionTreeILEmittingInterpreter()
+      : base("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.") {
+      Parameters.Add(new ValueParameter<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 ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(EvaluatedSolutionsParameterName))
+        Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    #region IStatefulItem
+
+    public void InitializeState() {
+      EvaluatedSolutions.Value = 0;
+    }
+
+    public void ClearState() {
+      EvaluatedSolutions.Value = 0;
+    }
+
+    #endregion
+
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
+      if (CheckExpressionsWithIntervalArithmetic.Value)
+        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
+
+      EvaluatedSolutions.Value++; // increment the evaluated solutions counter
+      var state = PrepareInterpreterState(tree, dataset);
+
+      Type[] methodArgs = { typeof(int), typeof(IList<double>[]) };
+      DynamicMethod testFun = new DynamicMethod("TestFun", typeof(double), methodArgs, typeof(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter).Module);
+
+      ILGenerator il = testFun.GetILGenerator();
+      CompileInstructions(il, state, dataset);
+      il.Emit(System.Reflection.Emit.OpCodes.Conv_R8);
+      il.Emit(System.Reflection.Emit.OpCodes.Ret);
+      var function = (CompiledFunction)testFun.CreateDelegate(typeof(CompiledFunction));
+
+      IList<double>[] columns = dataset.DoubleVariables.Select(v => dataset.GetReadOnlyDoubleValues(v)).ToArray();
+
+      foreach (var row in rows) {
+        yield return function(row, columns);
+      }
+    }
+
+    private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {
+      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
+      Dictionary<string, int> doubleVariableNames = dataset.DoubleVariables.Select((x, i) => new { x, i }).ToDictionary(e => e.x, e => e.i);
+      int necessaryArgStackSize = 0;
+      foreach (Instruction instr in code) {
+        if (instr.opCode == OpCodes.Variable) {
+          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+          instr.iArg0 = doubleVariableNames[variableTreeNode.VariableName];
+        } else if (instr.opCode == OpCodes.LagVariable) {
+          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
+          instr.iArg0 = doubleVariableNames[laggedVariableTreeNode.VariableName];
+        } else if (instr.opCode == OpCodes.VariableCondition) {
+          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
+          instr.iArg0 = doubleVariableNames[variableConditionTreeNode.VariableName];
+        } else if (instr.opCode == OpCodes.Call) {
+          necessaryArgStackSize += instr.nArguments + 1;
+        }
+      }
+      return new InterpreterState(code, necessaryArgStackSize);
+    }
+
+    private void CompileInstructions(ILGenerator il, InterpreterState state, Dataset ds) {
+      Instruction currentInstr = state.NextInstruction();
+      int nArgs = currentInstr.nArguments;
+
+      switch (currentInstr.opCode) {
+        case OpCodes.Add: {
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+            }
+            return;
+          }
+        case OpCodes.Sub: {
+            if (nArgs == 1) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Neg);
+              return;
+            }
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            }
+            return;
+          }
+        case OpCodes.Mul: {
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            }
+            return;
+          }
+        case OpCodes.Div: {
+            if (nArgs == 1) {
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0);
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Div);
+              return;
+            }
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Div);
+            }
+            return;
+          }
+        case OpCodes.Average: {
+            CompileInstructions(il, state, ds);
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+            }
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, nArgs);
+            il.Emit(System.Reflection.Emit.OpCodes.Div);
+            return;
+          }
+        case OpCodes.Cos: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, cos);
+            return;
+          }
+        case OpCodes.Sin: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, sin);
+            return;
+          }
+        case OpCodes.Tan: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, tan);
+            return;
+          }
+        case OpCodes.Power: {
+            CompileInstructions(il, state, ds);
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, round);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
+            return;
+          }
+        case OpCodes.Root: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1 / round(...)
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, round);
+            il.Emit(System.Reflection.Emit.OpCodes.Div);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
+            return;
+          }
+        case OpCodes.Exp: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, exp);
+            return;
+          }
+        case OpCodes.Log: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, log);
+            return;
+          }
+        case OpCodes.Square: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
+            return;
+          }
+        case OpCodes.SquareRoot: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, sqrt);
+            return;
+          }
+        case OpCodes.AiryA: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, airyA);
+            return;
+          }
+        case OpCodes.AiryB: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, airyB);
+            return;
+          }
+        case OpCodes.Bessel: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, bessel);
+            return;
+          }
+        case OpCodes.CosineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, cosIntegral);
+            return;
+          }
+        case OpCodes.Dawson: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, dawson);
+            return;
+          }
+        case OpCodes.Erf: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, erf);
+            return;
+          }
+        case OpCodes.ExponentialIntegralEi: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, expIntegralEi);
+            return;
+          }
+        case OpCodes.FresnelCosineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelCosIntegral);
+            return;
+          }
+        case OpCodes.FresnelSineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelSinIntegral);
+            return;
+          }
+        case OpCodes.Gamma: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, gamma);
+            return;
+          }
+        case OpCodes.HyperbolicCosineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, hypCosIntegral);
+            return;
+          }
+        case OpCodes.HyperbolicSineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, hypSinIntegral);
+            return;
+          }
+        case OpCodes.Norm: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, norm);
+            return;
+          }
+        case OpCodes.Psi: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, psi);
+            return;
+          }
+        case OpCodes.SineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, sinIntegral);
+            return;
+          }
+        case OpCodes.IfThenElse: {
+            Label end = il.DefineLabel();
+            Label c1 = il.DefineLabel();
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, c1);
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
+            il.MarkLabel(c1);
+            CompileInstructions(il, state, ds);
+            il.MarkLabel(end);
+            return;
+          }
+        case OpCodes.AND: {
+            Label falseBranch = il.DefineLabel();
+            Label end = il.DefineLabel();
+            CompileInstructions(il, state, ds);
+            for (int i = 1; i < nArgs; i++) {
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+              il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+              il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
+              CompileInstructions(il, state, ds);
+            }
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1
+            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
+            il.MarkLabel(falseBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // -1
+            il.Emit(System.Reflection.Emit.OpCodes.Neg);
+            il.MarkLabel(end);
+            return;
+          }
+        case OpCodes.OR: {
+            Label trueBranch = il.DefineLabel();
+            Label end = il.DefineLabel();
+            Label resultBranch = il.DefineLabel();
+            CompileInstructions(il, state, ds);
+            for (int i = 1; i < nArgs; i++) {
+              Label nextArgBranch = il.DefineLabel();
+              // complex definition because of special properties of NaN  
+              il.Emit(System.Reflection.Emit.OpCodes.Dup);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // <= 0        
+              il.Emit(System.Reflection.Emit.OpCodes.Ble, nextArgBranch);
+              il.Emit(System.Reflection.Emit.OpCodes.Br, resultBranch);
+              il.MarkLabel(nextArgBranch);
+              il.Emit(System.Reflection.Emit.OpCodes.Pop);
+              CompileInstructions(il, state, ds);
+            }
+            il.MarkLabel(resultBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Brtrue, trueBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // -1
+            il.Emit(System.Reflection.Emit.OpCodes.Neg);
+            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
+            il.MarkLabel(trueBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1
+            il.MarkLabel(end);
+            return;
+          }
+        case OpCodes.NOT: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            il.Emit(System.Reflection.Emit.OpCodes.Neg); // * -1
+            return;
+          }
+        case OpCodes.GT: {
+            CompileInstructions(il, state, ds);
+            CompileInstructions(il, state, ds);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt); // 1 (>) / 0 (otherwise)
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            return;
+          }
+        case OpCodes.LT: {
+            CompileInstructions(il, state, ds);
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Clt);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            return;
+          }
+        case OpCodes.TimeLag: {
+            LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -= lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            var prevLaggedContext = state.InLaggedContext;
+            state.InLaggedContext = true;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row += lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.InLaggedContext = prevLaggedContext;
+            return;
+          }
+        case OpCodes.Integral: {
+            int savedPc = state.ProgramCounter;
+            LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -= lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            var prevLaggedContext = state.InLaggedContext;
+            state.InLaggedContext = true;
+            CompileInstructions(il, state, ds);
+            for (int l = laggedTreeNode.Lag; l < 0; l++) {
+              il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row += lag
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_1);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+              il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+              state.ProgramCounter = savedPc;
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+            }
+            state.InLaggedContext = prevLaggedContext;
+            return;
+          }
+
+        //mkommend: derivate calculation taken from: 
+        //http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
+        //one sided smooth differentiatior, N = 4
+        // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
+        case OpCodes.Derivative: {
+            int savedPc = state.ProgramCounter;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row --
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_M1);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.ProgramCounter = savedPc;
+            var prevLaggedContext = state.InLaggedContext;
+            state.InLaggedContext = true;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // f_0 + 2 * f_1
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -=2
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_2);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.ProgramCounter = savedPc;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // f_0 + 2 * f_1 - 2 * f_3
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row --
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_M1);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.ProgramCounter = savedPc;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub); // f_0 + 2 * f_1 - 2 * f_3 - f_4
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 8.0); // / 8
+            il.Emit(System.Reflection.Emit.OpCodes.Div);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row +=4
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_4);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.InLaggedContext = prevLaggedContext;
+            return;
+          }
+        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: {
+            throw new NotSupportedException(
+              "Automatically defined functions are not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter. Either turn of ADFs or change the interpeter.");
+          }
+        case OpCodes.Variable: {
+            VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.iArg0);
+            // load correct column of the current variable
+            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // rowIndex
+            if (!state.InLaggedContext) {
+              il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
+              il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            } else {
+              var nanResult = il.DefineLabel();
+              var normalResult = il.DefineLabel();
+              il.Emit(System.Reflection.Emit.OpCodes.Dup);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+              il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult);
+              il.Emit(System.Reflection.Emit.OpCodes.Dup);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows);
+              il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult);
+              il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
+              il.Emit(System.Reflection.Emit.OpCodes.Mul);
+              il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult);
+              il.MarkLabel(nanResult);
+              il.Emit(System.Reflection.Emit.OpCodes.Pop); // rowIndex
+              il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN);
+              il.MarkLabel(normalResult);
+            }
+            return;
+          }
+        case OpCodes.LagVariable: {
+            var nanResult = il.DefineLabel();
+            var normalResult = il.DefineLabel();
+            LaggedVariableTreeNode varNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.iArg0);
+            // load correct column of the current variable
+            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, varNode.Lag); // lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // rowIndex
+            il.Emit(System.Reflection.Emit.OpCodes.Add); // actualRowIndex = rowIndex + sampleOffset
+            il.Emit(System.Reflection.Emit.OpCodes.Dup);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+            il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult);
+            il.Emit(System.Reflection.Emit.OpCodes.Dup);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows);
+            il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult);
+            il.MarkLabel(nanResult);
+            il.Emit(System.Reflection.Emit.OpCodes.Pop); // sample index
+            il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN);
+            il.MarkLabel(normalResult);
+            return;
+          }
+        case OpCodes.Constant: {
+            ConstantTreeNode constNode = (ConstantTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, constNode.Value);
+            return;
+          }
+
+        //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: {
+            throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name +
+                                            " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
+          }
+        default:
+          throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name +
+                                          " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
+      }
+    }
+
+    public static double AiryA(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double ai, aip, bi, bip;
+      alglib.airy(x, out ai, out aip, out bi, out bip);
+      return ai;
+    }
+
+    public static double AiryB(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double ai, aip, bi, bip;
+      alglib.airy(x, out ai, out aip, out bi, out bip);
+      return bi;
+    }
+    public static double Dawson(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.dawsonintegral(x);
+    }
+
+    public static double Gamma(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.gammafunction(x);
+    }
+
+    public static double Psi(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
+      return alglib.psi(x);
+    }
+
+    public static double ExpIntegralEi(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.exponentialintegralei(x);
+    }
+
+    public static double SinIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double si, ci;
+      alglib.sinecosineintegrals(x, out si, out ci);
+      return si;
+    }
+
+    public static double CosIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double si, ci;
+      alglib.sinecosineintegrals(x, out si, out ci);
+      return ci;
+    }
+
+    public static double HypSinIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double shi, chi;
+      alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+      return shi;
+    }
+
+    public static double HypCosIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double shi, chi;
+      alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+      return chi;
+    }
+
+    public static double FresnelCosIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double c = 0, s = 0;
+      alglib.fresnelintegral(x, ref c, ref s);
+      return c;
+    }
+
+    public static double FresnelSinIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double c = 0, s = 0;
+      alglib.fresnelintegral(x, ref c, ref s);
+      return s;
+    }
+
+    public static double Norm(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.normaldistribution(x);
+    }
+
+    public static double Erf(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.errorfunction(x);
+    }
+
+    public static double Bessel(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.besseli0(x);
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 8916)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 8916)
@@ -0,0 +1,454 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.")]
+  public class SymbolicDataAnalysisExpressionTreeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
+    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    public override bool CanChangeName { get { return false; } }
+    public override bool CanChangeDescription { get { return false; } }
+
+    #region parameter properties
+    public IValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
+    }
+
+    public IValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public BoolValue CheckExpressionsWithIntervalArithmetic {
+      get { return CheckExpressionsWithIntervalArithmeticParameter.Value; }
+      set { CheckExpressionsWithIntervalArithmeticParameter.Value = value; }
+    }
+
+    public IntValue EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value; }
+      set { EvaluatedSolutionsParameter.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(SymbolicDataAnalysisExpressionTreeInterpreter original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionTreeInterpreter(this, cloner);
+    }
+
+    public SymbolicDataAnalysisExpressionTreeInterpreter()
+      : base("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.") {
+      Parameters.Add(new ValueParameter<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 ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(string name, string description)
+      : base(name, description) {
+      Parameters.Add(new ValueParameter<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 ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(EvaluatedSolutionsParameterName))
+        Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    #region IStatefulItem
+    public void InitializeState() {
+      EvaluatedSolutions.Value = 0;
+    }
+
+    public void ClearState() {
+    }
+    #endregion
+
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
+      if (CheckExpressionsWithIntervalArithmetic.Value)
+        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
+
+      EvaluatedSolutions.Value++; // increment the evaluated solutions counter
+      var state = PrepareInterpreterState(tree, dataset);
+
+      foreach (var rowEnum in rows) {
+        int row = rowEnum;
+        yield return Evaluate(dataset, ref row, state);
+        state.Reset();
+      }
+    }
+
+    private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {
+      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
+      int necessaryArgStackSize = 0;
+      foreach (Instruction instr in code) {
+        if (instr.opCode == OpCodes.Variable) {
+          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+          instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.LagVariable) {
+          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
+          instr.iArg0 = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.VariableCondition) {
+          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
+          instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.Call) {
+          necessaryArgStackSize += instr.nArguments + 1;
+        }
+      }
+      return new InterpreterState(code, necessaryArgStackSize);
+    }
+
+
+    protected virtual double Evaluate(Dataset dataset, ref int row, InterpreterState state) {
+      Instruction currentInstr = state.NextInstruction();
+      switch (currentInstr.opCode) {
+        case OpCodes.Add: {
+            double s = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              s += Evaluate(dataset, ref row, state);
+            }
+            return s;
+          }
+        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;
+            return s;
+          }
+        case OpCodes.Mul: {
+            double p = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              p *= Evaluate(dataset, ref row, state);
+            }
+            return p;
+          }
+        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;
+            return p;
+          }
+        case OpCodes.Average: {
+            double sum = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              sum += Evaluate(dataset, ref row, state);
+            }
+            return sum / currentInstr.nArguments;
+          }
+        case OpCodes.Cos: {
+            return Math.Cos(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Sin: {
+            return Math.Sin(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Tan: {
+            return Math.Tan(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Square: {
+            return Math.Pow(Evaluate(dataset, ref row, state), 2);
+          }
+        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: {
+            return Math.Sqrt(Evaluate(dataset, ref row, state));
+          }
+        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: {
+            return Math.Exp(Evaluate(dataset, ref row, state));
+          }
+        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: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
+            return alglib.psi(x);
+          }
+        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;
+            return alglib.exponentialintegralei(x);
+          }
+        case OpCodes.SineIntegral: {
+            double si, ci;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.sinecosineintegrals(x, out si, out ci);
+              return si;
+            }
+          }
+        case OpCodes.CosineIntegral: {
+            double si, ci;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.sinecosineintegrals(x, out si, out ci);
+              return ci;
+            }
+          }
+        case OpCodes.HyperbolicSineIntegral: {
+            double shi, chi;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+              return shi;
+            }
+          }
+        case OpCodes.HyperbolicCosineIntegral: {
+            double shi, chi;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+              return chi;
+            }
+          }
+        case OpCodes.FresnelCosineIntegral: {
+            double c = 0, s = 0;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.fresnelintegral(x, ref c, ref s);
+              return c;
+            }
+          }
+        case OpCodes.FresnelSineIntegral: {
+            double c = 0, s = 0;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.fresnelintegral(x, ref c, ref s);
+              return s;
+            }
+          }
+        case OpCodes.AiryA: {
+            double ai, aip, bi, bip;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.airy(x, out ai, out aip, out bi, out bip);
+              return ai;
+            }
+          }
+        case OpCodes.AiryB: {
+            double ai, aip, bi, bip;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.airy(x, out ai, out aip, out bi, out bip);
+              return bi;
+            }
+          }
+        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: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else return alglib.errorfunction(x);
+          }
+        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: {
+            double condition = Evaluate(dataset, ref row, state);
+            double result;
+            if (condition > 0.0) {
+              result = Evaluate(dataset, ref row, state); state.SkipInstructions();
+            } else {
+              state.SkipInstructions(); result = Evaluate(dataset, ref row, state);
+            }
+            return result;
+          }
+        case OpCodes.AND: {
+            double result = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result > 0.0) result = Evaluate(dataset, ref row, state);
+              else {
+                state.SkipInstructions();
+              }
+            }
+            return result > 0.0 ? 1.0 : -1.0;
+          }
+        case OpCodes.OR: {
+            double result = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result <= 0.0) result = Evaluate(dataset, ref row, state);
+              else {
+                state.SkipInstructions();
+              }
+            }
+            return result > 0.0 ? 1.0 : -1.0;
+          }
+        case OpCodes.NOT: {
+            return Evaluate(dataset, ref row, state) > 0.0 ? -1.0 : 1.0;
+          }
+        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: {
+            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: {
+            var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            row += timeLagTreeNode.Lag;
+            double result = Evaluate(dataset, ref row, state);
+            row -= timeLagTreeNode.Lag;
+            return result;
+          }
+        case OpCodes.Integral: {
+            int savedPc = state.ProgramCounter;
+            var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            double sum = 0.0;
+            for (int i = 0; i < Math.Abs(timeLagTreeNode.Lag); i++) {
+              row += Math.Sign(timeLagTreeNode.Lag);
+              sum += Evaluate(dataset, ref row, state);
+              state.ProgramCounter = savedPc;
+            }
+            row -= timeLagTreeNode.Lag;
+            sum += Evaluate(dataset, ref row, state);
+            return sum;
+          }
+
+        //mkommend: derivate calculation taken from: 
+        //http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
+        //one sided smooth differentiatior, N = 4
+        // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
+        case OpCodes.Derivative: {
+            int savedPc = state.ProgramCounter;
+            double f_0 = Evaluate(dataset, ref row, state); row--;
+            state.ProgramCounter = savedPc;
+            double f_1 = Evaluate(dataset, ref row, state); row -= 2;
+            state.ProgramCounter = savedPc;
+            double f_3 = Evaluate(dataset, ref row, state); row--;
+            state.ProgramCounter = savedPc;
+            double f_4 = Evaluate(dataset, ref row, state);
+            row += 4;
+
+            return (f_0 + 2 * f_1 - 2 * f_3 - f_4) / 8; // h = 1
+          }
+        case OpCodes.Call: {
+            // evaluate sub-trees
+            double[] argValues = new double[currentInstr.nArguments];
+            for (int i = 0; i < currentInstr.nArguments; i++) {
+              argValues[i] = Evaluate(dataset, ref row, state);
+            }
+            // push on argument values on stack 
+            state.CreateStackFrame(argValues);
+
+            // save the pc
+            int savedPc = state.ProgramCounter;
+            // set pc to start of function  
+            state.ProgramCounter = (ushort)currentInstr.iArg0;
+            // evaluate the function
+            double v = Evaluate(dataset, ref row, state);
+
+            // delete the stack frame
+            state.RemoveStackFrame();
+
+            // restore the pc => evaluation will continue at point after my subtrees  
+            state.ProgramCounter = savedPc;
+            return v;
+          }
+        case OpCodes.Arg: {
+            return state.GetStackFrameValue((ushort)currentInstr.iArg0);
+          }
+        case OpCodes.Variable: {
+            if (row < 0 || row >= dataset.Rows) return double.NaN;
+            var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode;
+            return ((IList<double>)currentInstr.iArg0)[row] * variableTreeNode.Weight;
+          }
+        case OpCodes.LagVariable: {
+            var laggedVariableTreeNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
+            int actualRow = row + laggedVariableTreeNode.Lag;
+            if (actualRow < 0 || actualRow >= dataset.Rows) return double.NaN;
+            return ((IList<double>)currentInstr.iArg0)[actualRow] * laggedVariableTreeNode.Weight;
+          }
+        case OpCodes.Constant: {
+            var constTreeNode = (ConstantTreeNode)currentInstr.dynamicNode;
+            return constTreeNode.Value;
+          }
+
+        //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: {
+            if (row < 0 || row >= dataset.Rows) return double.NaN;
+            var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode;
+            double variableValue = ((IList<double>)currentInstr.iArg0)[row];
+            double x = variableValue - variableConditionTreeNode.Threshold;
+            double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
+
+            double trueBranch = Evaluate(dataset, ref row, state);
+            double falseBranch = Evaluate(dataset, ref row, state);
+
+            return trueBranch * p + falseBranch * (1 - p);
+          }
+        default: throw new NotSupportedException();
+      }
+    }
+  }
+}
Index: anches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 8915)
+++ 	(revision )
@@ -1,907 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Reflection.Emit;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableClass]
-  [Item("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.")]
-  public sealed class SymbolicDataAnalysisExpressionTreeILEmittingInterpreter : ParameterizedNamedItem,
-                                                                                ISymbolicDataAnalysisExpressionTreeInterpreter {
-    private static MethodInfo listGetValue =
-      typeof(IList<double>).GetProperty("Item", new Type[] { typeof(int) }).GetGetMethod();
-
-    private static MethodInfo cos = typeof(Math).GetMethod("Cos", new Type[] { typeof(double) });
-    private static MethodInfo sin = typeof(Math).GetMethod("Sin", new Type[] { typeof(double) });
-    private static MethodInfo tan = typeof(Math).GetMethod("Tan", new Type[] { typeof(double) });
-    private static MethodInfo exp = typeof(Math).GetMethod("Exp", new Type[] { typeof(double) });
-    private static MethodInfo log = typeof(Math).GetMethod("Log", new Type[] { typeof(double) });
-    private static MethodInfo power = typeof(Math).GetMethod("Pow", new Type[] { typeof(double), typeof(double) });
-    private static MethodInfo round = typeof(Math).GetMethod("Round", new Type[] { typeof(double) });
-    private static MethodInfo sqrt = typeof(Math).GetMethod("Sqrt", new Type[] { typeof(double) });
-
-    private static Type thisType = typeof(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter);
-    private static MethodInfo airyA = thisType.GetMethod("AiryA", new Type[] { typeof(double) });
-    private static MethodInfo airyB = thisType.GetMethod("AiryB", new Type[] { typeof(double) });
-    private static MethodInfo gamma = thisType.GetMethod("Gamma", new Type[] { typeof(double) });
-    private static MethodInfo psi = thisType.GetMethod("Psi", new Type[] { typeof(double) });
-    private static MethodInfo dawson = thisType.GetMethod("Dawson", new Type[] { typeof(double) });
-    private static MethodInfo expIntegralEi = thisType.GetMethod("ExpIntegralEi", new Type[] { typeof(double) });
-    private static MethodInfo sinIntegral = thisType.GetMethod("SinIntegral", new Type[] { typeof(double) });
-    private static MethodInfo cosIntegral = thisType.GetMethod("CosIntegral", new Type[] { typeof(double) });
-    private static MethodInfo hypSinIntegral = thisType.GetMethod("HypSinIntegral", new Type[] { typeof(double) });
-    private static MethodInfo hypCosIntegral = thisType.GetMethod("HypCosIntegral", new Type[] { typeof(double) });
-    private static MethodInfo fresnelCosIntegral = thisType.GetMethod("FresnelCosIntegral", new Type[] { typeof(double) });
-    private static MethodInfo fresnelSinIntegral = thisType.GetMethod("FresnelSinIntegral", new Type[] { typeof(double) });
-    private static MethodInfo norm = thisType.GetMethod("Norm", new Type[] { typeof(double) });
-    private static MethodInfo erf = thisType.GetMethod("Erf", new Type[] { typeof(double) });
-    private static MethodInfo bessel = thisType.GetMethod("Bessel", new Type[] { typeof(double) });
-
-    internal delegate double CompiledFunction(int sampleIndex, IList<double>[] columns);
-
-    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
-    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
-
-    #region private classes
-
-    private class InterpreterState {
-      private Instruction[] code;
-      private int pc;
-
-      public int ProgramCounter {
-        get { return pc; }
-        set { pc = value; }
-      }
-
-      private bool inLaggedContext;
-
-      public bool InLaggedContext {
-        get { return inLaggedContext; }
-        set { inLaggedContext = value; }
-      }
-
-      internal InterpreterState(Instruction[] code) {
-        this.inLaggedContext = false;
-        this.code = code;
-        this.pc = 0;
-      }
-
-      internal Instruction NextInstruction() {
-        return code[pc++];
-      }
-    }
-
-    private class OpCodes {
-      public const byte Add = 1;
-      public const byte Sub = 2;
-      public const byte Mul = 3;
-      public const byte Div = 4;
-
-      public const byte Sin = 5;
-      public const byte Cos = 6;
-      public const byte Tan = 7;
-
-      public const byte Log = 8;
-      public const byte Exp = 9;
-
-      public const byte IfThenElse = 10;
-
-      public const byte GT = 11;
-      public const byte LT = 12;
-
-      public const byte AND = 13;
-      public const byte OR = 14;
-      public const byte NOT = 15;
-
-
-      public const byte Average = 16;
-
-      public const byte Call = 17;
-
-      public const byte Variable = 18;
-      public const byte LagVariable = 19;
-      public const byte Constant = 20;
-      public const byte Arg = 21;
-
-      public const byte Power = 22;
-      public const byte Root = 23;
-      public const byte TimeLag = 24;
-      public const byte Integral = 25;
-      public const byte Derivative = 26;
-
-      public const byte VariableCondition = 27;
-
-      public const byte Square = 28;
-      public const byte SquareRoot = 29;
-      public const byte Gamma = 30;
-      public const byte Psi = 31;
-      public const byte Dawson = 32;
-      public const byte ExponentialIntegralEi = 33;
-      public const byte CosineIntegral = 34;
-      public const byte SineIntegral = 35;
-      public const byte HyperbolicCosineIntegral = 36;
-      public const byte HyperbolicSineIntegral = 37;
-      public const byte FresnelCosineIntegral = 38;
-      public const byte FresnelSineIntegral = 39;
-      public const byte AiryA = 40;
-      public const byte AiryB = 41;
-      public const byte Norm = 42;
-      public const byte Erf = 43;
-      public const byte Bessel = 44;
-    }
-
-    #endregion
-
-    private Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>()
-                                                      {
-                                                        {typeof (Addition), OpCodes.Add},
-                                                        {typeof (Subtraction), OpCodes.Sub},
-                                                        {typeof (Multiplication), OpCodes.Mul},
-                                                        {typeof (Division), OpCodes.Div},
-                                                        {typeof (Sine), OpCodes.Sin},
-                                                        {typeof (Cosine), OpCodes.Cos},
-                                                        {typeof (Tangent), OpCodes.Tan},
-                                                        {typeof (Logarithm), OpCodes.Log},
-                                                        {typeof (Exponential), OpCodes.Exp},
-                                                        {typeof (IfThenElse), OpCodes.IfThenElse},
-                                                        {typeof (GreaterThan), OpCodes.GT},
-                                                        {typeof (LessThan), OpCodes.LT},
-                                                        {typeof (And), OpCodes.AND},
-                                                        {typeof (Or), OpCodes.OR},
-                                                        {typeof (Not), OpCodes.NOT},
-                                                        {typeof (Average), OpCodes.Average},
-                                                        {typeof (InvokeFunction), OpCodes.Call},
-                                                        {
-                                                          typeof (HeuristicLab.Problems.DataAnalysis.Symbolic.Variable),
-                                                          OpCodes.Variable
-                                                          },
-                                                        {typeof (LaggedVariable), OpCodes.LagVariable},
-                                                        {typeof (Constant), OpCodes.Constant},
-                                                        {typeof (Argument), OpCodes.Arg},
-                                                        {typeof (Power), OpCodes.Power},
-                                                        {typeof (Root), OpCodes.Root},
-                                                        {typeof (TimeLag), OpCodes.TimeLag},
-                                                        {typeof (Integral), OpCodes.Integral},
-                                                        {typeof (Derivative), OpCodes.Derivative},
-                                                        {typeof (VariableCondition), OpCodes.VariableCondition},
-                                                        {typeof (Square), OpCodes.Square},
-                                                        {typeof (SquareRoot), OpCodes.SquareRoot},
-                                                        {typeof (Gamma), OpCodes.Gamma},
-                                                        {typeof (Psi), OpCodes.Psi},
-                                                        {typeof (Dawson), OpCodes.Dawson},
-                                                        {typeof (ExponentialIntegralEi), OpCodes.ExponentialIntegralEi},
-                                                        {typeof (CosineIntegral), OpCodes.CosineIntegral},
-                                                        {typeof (SineIntegral), OpCodes.SineIntegral},
-                                                        {
-                                                          typeof (HyperbolicCosineIntegral),
-                                                          OpCodes.HyperbolicCosineIntegral
-                                                          },
-                                                        {
-                                                          typeof (HyperbolicSineIntegral), OpCodes.HyperbolicSineIntegral
-                                                          },
-                                                        {typeof (FresnelCosineIntegral), OpCodes.FresnelCosineIntegral},
-                                                        {typeof (FresnelSineIntegral), OpCodes.FresnelSineIntegral},
-                                                        {typeof (AiryA), OpCodes.AiryA},
-                                                        {typeof (AiryB), OpCodes.AiryB},
-                                                        {typeof (Norm), OpCodes.Norm},
-                                                        {typeof (Erf), OpCodes.Erf},
-                                                        {typeof (Bessel), OpCodes.Bessel}
-                                                      };
-
-    public override bool CanChangeName {
-      get { return false; }
-    }
-
-    public override bool CanChangeDescription {
-      get { return false; }
-    }
-
-    #region parameter properties
-
-    public IValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
-      get { return (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
-    }
-
-    public IValueParameter<IntValue> EvaluatedSolutionsParameter {
-      get { return (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
-    }
-
-    #endregion
-
-    #region properties
-
-    public BoolValue CheckExpressionsWithIntervalArithmetic {
-      get { return CheckExpressionsWithIntervalArithmeticParameter.Value; }
-      set { CheckExpressionsWithIntervalArithmeticParameter.Value = value; }
-    }
-
-    public IntValue EvaluatedSolutions {
-      get { return EvaluatedSolutionsParameter.Value; }
-      set { EvaluatedSolutionsParameter.Value = value; }
-    }
-
-    #endregion
-
-
-    [StorableConstructor]
-    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(bool deserializing)
-      : base(deserializing) {
-    }
-
-    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(
-      SymbolicDataAnalysisExpressionTreeILEmittingInterpreter original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(this, cloner);
-    }
-
-    public SymbolicDataAnalysisExpressionTreeILEmittingInterpreter()
-      : base("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.") {
-      Parameters.Add(new ValueParameter<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 ValueParameter<IntValue>(EvaluatedSolutionsParameterName,
-                                                  "A counter for the total number of solutions the interpreter has evaluated",
-                                                  new IntValue(0)));
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      if (!Parameters.ContainsKey(EvaluatedSolutionsParameterName))
-        Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName,
-                                                    "A counter for the total number of solutions the interpreter has evaluated",
-                                                    new IntValue(0)));
-    }
-
-    #region IStatefulItem
-
-    public void InitializeState() {
-      EvaluatedSolutions.Value = 0;
-    }
-
-    public void ClearState() {
-      EvaluatedSolutions.Value = 0;
-    }
-
-    #endregion
-
-    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset,
-                                                               IEnumerable<int> rows) {
-      if (CheckExpressionsWithIntervalArithmetic.Value)
-        throw new NotSupportedException(
-          "Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
-      EvaluatedSolutions.Value++; // increment the evaluated solutions counter
-      var compiler = new SymbolicExpressionTreeCompiler();
-      Instruction[] code = compiler.Compile(tree, MapSymbolToOpCode);
-      int necessaryArgStackSize = 0;
-
-      Dictionary<string, int> doubleVariableNames =
-        dataset.DoubleVariables.Select((x, i) => new { x, i }).ToDictionary(e => e.x, e => e.i);
-      IList<double>[] columns = (from v in doubleVariableNames.Keys
-                                 select dataset.GetReadOnlyDoubleValues(v))
-        .ToArray();
-
-      for (int i = 0; i < code.Length; i++) {
-        Instruction instr = code[i];
-        if (instr.opCode == OpCodes.Variable) {
-          var variableTreeNode = instr.dynamicNode as VariableTreeNode;
-          instr.iArg0 = doubleVariableNames[variableTreeNode.VariableName];
-          code[i] = instr;
-        } else if (instr.opCode == OpCodes.LagVariable) {
-          var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
-          instr.iArg0 = doubleVariableNames[variableTreeNode.VariableName];
-          code[i] = instr;
-        } else if (instr.opCode == OpCodes.VariableCondition) {
-          var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode;
-          instr.iArg0 = doubleVariableNames[variableConditionTreeNode.VariableName];
-        } else if (instr.opCode == OpCodes.Call) {
-          necessaryArgStackSize += instr.nArguments + 1;
-        }
-      }
-      var state = new InterpreterState(code);
-
-      Type[] methodArgs = { typeof(int), typeof(IList<double>[]) };
-      DynamicMethod testFun = new DynamicMethod("TestFun", typeof(double), methodArgs,
-                                                typeof(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter).Module);
-
-      ILGenerator il = testFun.GetILGenerator();
-      CompileInstructions(il, state, dataset);
-      il.Emit(System.Reflection.Emit.OpCodes.Conv_R8);
-      il.Emit(System.Reflection.Emit.OpCodes.Ret);
-      var function = (CompiledFunction)testFun.CreateDelegate(typeof(CompiledFunction));
-
-      foreach (var row in rows) {
-        yield return function(row, columns);
-      }
-    }
-
-    private void CompileInstructions(ILGenerator il, InterpreterState state, Dataset ds) {
-      Instruction currentInstr = state.NextInstruction();
-      int nArgs = currentInstr.nArguments;
-
-      switch (currentInstr.opCode) {
-        case OpCodes.Add: {
-            if (nArgs > 0) {
-              CompileInstructions(il, state, ds);
-            }
-            for (int i = 1; i < nArgs; i++) {
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Add);
-            }
-            return;
-          }
-        case OpCodes.Sub: {
-            if (nArgs == 1) {
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Neg);
-              return;
-            }
-            if (nArgs > 0) {
-              CompileInstructions(il, state, ds);
-            }
-            for (int i = 1; i < nArgs; i++) {
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Sub);
-            }
-            return;
-          }
-        case OpCodes.Mul: {
-            if (nArgs > 0) {
-              CompileInstructions(il, state, ds);
-            }
-            for (int i = 1; i < nArgs; i++) {
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            }
-            return;
-          }
-        case OpCodes.Div: {
-            if (nArgs == 1) {
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0);
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Div);
-              return;
-            }
-            if (nArgs > 0) {
-              CompileInstructions(il, state, ds);
-            }
-            for (int i = 1; i < nArgs; i++) {
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Div);
-            }
-            return;
-          }
-        case OpCodes.Average: {
-            CompileInstructions(il, state, ds);
-            for (int i = 1; i < nArgs; i++) {
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Add);
-            }
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, nArgs);
-            il.Emit(System.Reflection.Emit.OpCodes.Div);
-            return;
-          }
-        case OpCodes.Cos: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, cos);
-            return;
-          }
-        case OpCodes.Sin: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, sin);
-            return;
-          }
-        case OpCodes.Tan: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, tan);
-            return;
-          }
-        case OpCodes.Power: {
-            CompileInstructions(il, state, ds);
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, round);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
-            return;
-          }
-        case OpCodes.Root: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1 / round(...)
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, round);
-            il.Emit(System.Reflection.Emit.OpCodes.Div);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
-            return;
-          }
-        case OpCodes.Exp: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, exp);
-            return;
-          }
-        case OpCodes.Log: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, log);
-            return;
-          }
-        case OpCodes.Square: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
-            return;
-          }
-        case OpCodes.SquareRoot: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, sqrt);
-            return;
-          }
-        case OpCodes.AiryA: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, airyA);
-            return;
-          }
-        case OpCodes.AiryB: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, airyB);
-            return;
-          }
-        case OpCodes.Bessel: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, bessel);
-            return;
-          }
-        case OpCodes.CosineIntegral: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, cosIntegral);
-            return;
-          }
-        case OpCodes.Dawson: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, dawson);
-            return;
-          }
-        case OpCodes.Erf: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, erf);
-            return;
-          }
-        case OpCodes.ExponentialIntegralEi: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, expIntegralEi);
-            return;
-          }
-        case OpCodes.FresnelCosineIntegral: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelCosIntegral);
-            return;
-          }
-        case OpCodes.FresnelSineIntegral: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelSinIntegral);
-            return;
-          }
-        case OpCodes.Gamma: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, gamma);
-            return;
-          }
-        case OpCodes.HyperbolicCosineIntegral: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, hypCosIntegral);
-            return;
-          }
-        case OpCodes.HyperbolicSineIntegral: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, hypSinIntegral);
-            return;
-          }
-        case OpCodes.Norm: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, norm);
-            return;
-          }
-        case OpCodes.Psi: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, psi);
-            return;
-          }
-        case OpCodes.SineIntegral: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, sinIntegral);
-            return;
-          }
-        case OpCodes.IfThenElse: {
-            Label end = il.DefineLabel();
-            Label c1 = il.DefineLabel();
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
-            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
-            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, c1);
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
-            il.MarkLabel(c1);
-            CompileInstructions(il, state, ds);
-            il.MarkLabel(end);
-            return;
-          }
-        case OpCodes.AND: {
-            Label falseBranch = il.DefineLabel();
-            Label end = il.DefineLabel();
-            CompileInstructions(il, state, ds);
-            for (int i = 1; i < nArgs; i++) {
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
-              il.Emit(System.Reflection.Emit.OpCodes.Cgt);
-              il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
-              CompileInstructions(il, state, ds);
-            }
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
-            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
-            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1
-            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
-            il.MarkLabel(falseBranch);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // -1
-            il.Emit(System.Reflection.Emit.OpCodes.Neg);
-            il.MarkLabel(end);
-            return;
-          }
-        case OpCodes.OR: {
-            Label trueBranch = il.DefineLabel();
-            Label end = il.DefineLabel();
-            Label resultBranch = il.DefineLabel();
-            CompileInstructions(il, state, ds);
-            for (int i = 1; i < nArgs; i++) {
-              Label nextArgBranch = il.DefineLabel();
-              // complex definition because of special properties of NaN  
-              il.Emit(System.Reflection.Emit.OpCodes.Dup);
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // <= 0        
-              il.Emit(System.Reflection.Emit.OpCodes.Ble, nextArgBranch);
-              il.Emit(System.Reflection.Emit.OpCodes.Br, resultBranch);
-              il.MarkLabel(nextArgBranch);
-              il.Emit(System.Reflection.Emit.OpCodes.Pop);
-              CompileInstructions(il, state, ds);
-            }
-            il.MarkLabel(resultBranch);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
-            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
-            il.Emit(System.Reflection.Emit.OpCodes.Brtrue, trueBranch);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // -1
-            il.Emit(System.Reflection.Emit.OpCodes.Neg);
-            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
-            il.MarkLabel(trueBranch);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1
-            il.MarkLabel(end);
-            return;
-          }
-        case OpCodes.NOT: {
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
-            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
-            il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
-            il.Emit(System.Reflection.Emit.OpCodes.Sub);
-            il.Emit(System.Reflection.Emit.OpCodes.Neg); // * -1
-            return;
-          }
-        case OpCodes.GT: {
-            CompileInstructions(il, state, ds);
-            CompileInstructions(il, state, ds);
-
-            il.Emit(System.Reflection.Emit.OpCodes.Cgt); // 1 (>) / 0 (otherwise)
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
-            il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
-            il.Emit(System.Reflection.Emit.OpCodes.Sub);
-            return;
-          }
-        case OpCodes.LT: {
-            CompileInstructions(il, state, ds);
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Clt);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
-            il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
-            il.Emit(System.Reflection.Emit.OpCodes.Sub);
-            return;
-          }
-        case OpCodes.TimeLag: {
-            LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -= lag
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
-            il.Emit(System.Reflection.Emit.OpCodes.Add);
-            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-            var prevLaggedContext = state.InLaggedContext;
-            state.InLaggedContext = true;
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row += lag
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
-            il.Emit(System.Reflection.Emit.OpCodes.Sub);
-            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-            state.InLaggedContext = prevLaggedContext;
-            return;
-          }
-        case OpCodes.Integral: {
-            int savedPc = state.ProgramCounter;
-            LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -= lag
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
-            il.Emit(System.Reflection.Emit.OpCodes.Add);
-            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-            var prevLaggedContext = state.InLaggedContext;
-            state.InLaggedContext = true;
-            CompileInstructions(il, state, ds);
-            for (int l = laggedTreeNode.Lag; l < 0; l++) {
-              il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row += lag
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_1);
-              il.Emit(System.Reflection.Emit.OpCodes.Add);
-              il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-              state.ProgramCounter = savedPc;
-              CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Add);
-            }
-            state.InLaggedContext = prevLaggedContext;
-            return;
-          }
-
-        //mkommend: derivate calculation taken from: 
-        //http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
-        //one sided smooth differentiatior, N = 4
-        // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
-        case OpCodes.Derivative: {
-            int savedPc = state.ProgramCounter;
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row --
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_M1);
-            il.Emit(System.Reflection.Emit.OpCodes.Add);
-            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-            state.ProgramCounter = savedPc;
-            var prevLaggedContext = state.InLaggedContext;
-            state.InLaggedContext = true;
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // f_0 + 2 * f_1
-            il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            il.Emit(System.Reflection.Emit.OpCodes.Add);
-
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -=2
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_2);
-            il.Emit(System.Reflection.Emit.OpCodes.Sub);
-            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-            state.ProgramCounter = savedPc;
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // f_0 + 2 * f_1 - 2 * f_3
-            il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            il.Emit(System.Reflection.Emit.OpCodes.Sub);
-
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row --
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_M1);
-            il.Emit(System.Reflection.Emit.OpCodes.Add);
-            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-            state.ProgramCounter = savedPc;
-            CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Sub); // f_0 + 2 * f_1 - 2 * f_3 - f_4
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 8.0); // / 8
-            il.Emit(System.Reflection.Emit.OpCodes.Div);
-
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row +=4
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_4);
-            il.Emit(System.Reflection.Emit.OpCodes.Add);
-            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
-            state.InLaggedContext = prevLaggedContext;
-            return;
-          }
-        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: {
-            throw new NotSupportedException(
-              "Automatically defined functions are not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter. Either turn of ADFs or change the interpeter.");
-          }
-        case OpCodes.Variable: {
-            VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode;
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.iArg0);
-            // load correct column of the current variable
-            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // rowIndex
-            if (!state.InLaggedContext) {
-              il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
-              il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            } else {
-              var nanResult = il.DefineLabel();
-              var normalResult = il.DefineLabel();
-              il.Emit(System.Reflection.Emit.OpCodes.Dup);
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
-              il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult);
-              il.Emit(System.Reflection.Emit.OpCodes.Dup);
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows);
-              il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult);
-              il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
-              il.Emit(System.Reflection.Emit.OpCodes.Mul);
-              il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult);
-              il.MarkLabel(nanResult);
-              il.Emit(System.Reflection.Emit.OpCodes.Pop); // rowIndex
-              il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN);
-              il.MarkLabel(normalResult);
-            }
-            return;
-          }
-        case OpCodes.LagVariable: {
-            var nanResult = il.DefineLabel();
-            var normalResult = il.DefineLabel();
-            LaggedVariableTreeNode varNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.iArg0);
-            // load correct column of the current variable
-            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, varNode.Lag); // lag
-            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // rowIndex
-            il.Emit(System.Reflection.Emit.OpCodes.Add); // actualRowIndex = rowIndex + sampleOffset
-            il.Emit(System.Reflection.Emit.OpCodes.Dup);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
-            il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult);
-            il.Emit(System.Reflection.Emit.OpCodes.Dup);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows);
-            il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult);
-            il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
-            il.Emit(System.Reflection.Emit.OpCodes.Mul);
-            il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult);
-            il.MarkLabel(nanResult);
-            il.Emit(System.Reflection.Emit.OpCodes.Pop); // sample index
-            il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN);
-            il.MarkLabel(normalResult);
-            return;
-          }
-        case OpCodes.Constant: {
-            ConstantTreeNode constNode = (ConstantTreeNode)currentInstr.dynamicNode;
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, constNode.Value);
-            return;
-          }
-
-        //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: {
-            throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name +
-                                            " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
-          }
-        default:
-          throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name +
-                                          " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
-      }
-    }
-
-    private byte MapSymbolToOpCode(ISymbolicExpressionTreeNode treeNode) {
-      byte opCode;
-      if (!symbolToOpcode.TryGetValue(treeNode.Symbol.GetType(), out opCode))
-        throw new NotSupportedException("Symbol: " + treeNode.Symbol);
-      return opCode;
-    }
-
-
-    public static double AiryA(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double ai, aip, bi, bip;
-      alglib.airy(x, out ai, out aip, out bi, out bip);
-      return ai;
-    }
-
-    public static double AiryB(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double ai, aip, bi, bip;
-      alglib.airy(x, out ai, out aip, out bi, out bip);
-      return bi;
-    }
-    public static double Dawson(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      return alglib.dawsonintegral(x);
-    }
-
-    public static double Gamma(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      return alglib.gammafunction(x);
-    }
-
-    public static double Psi(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
-      return alglib.psi(x);
-    }
-
-    public static double ExpIntegralEi(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      return alglib.exponentialintegralei(x);
-    }
-
-    public static double SinIntegral(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double si, ci;
-      alglib.sinecosineintegrals(x, out si, out ci);
-      return si;
-    }
-
-    public static double CosIntegral(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double si, ci;
-      alglib.sinecosineintegrals(x, out si, out ci);
-      return ci;
-    }
-
-    public static double HypSinIntegral(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double shi, chi;
-      alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
-      return shi;
-    }
-
-    public static double HypCosIntegral(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double shi, chi;
-      alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
-      return chi;
-    }
-
-    public static double FresnelCosIntegral(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double c = 0, s = 0;
-      alglib.fresnelintegral(x, ref c, ref s);
-      return c;
-    }
-
-    public static double FresnelSinIntegral(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      double c = 0, s = 0;
-      alglib.fresnelintegral(x, ref c, ref s);
-      return s;
-    }
-
-    public static double Norm(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      return alglib.normaldistribution(x);
-    }
-
-    public static double Erf(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      return alglib.errorfunction(x);
-    }
-
-    public static double Bessel(double x) {
-      if (double.IsNaN(x)) return double.NaN;
-      return alglib.besseli0(x);
-    }
-
-  }
-}
Index: anches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 8915)
+++ 	(revision )
@@ -1,634 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableClass]
-  [Item("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.")]
-  public sealed class SymbolicDataAnalysisExpressionTreeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
-    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
-    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
-    #region private classes
-    private class InterpreterState {
-      private double[] argumentStack;
-      private int argumentStackPointer;
-      private Instruction[] code;
-      private int pc;
-      public int ProgramCounter {
-        get { return pc; }
-        set { pc = value; }
-      }
-      internal InterpreterState(Instruction[] code, int argumentStackSize) {
-        this.code = code;
-        this.pc = 0;
-        if (argumentStackSize > 0) {
-          this.argumentStack = new double[argumentStackSize];
-        }
-        this.argumentStackPointer = 0;
-      }
-
-      internal void Reset() {
-        this.pc = 0;
-        this.argumentStackPointer = 0;
-      }
-
-      internal Instruction NextInstruction() {
-        return code[pc++];
-      }
-      private void Push(double val) {
-        argumentStack[argumentStackPointer++] = val;
-      }
-      private double Pop() {
-        return argumentStack[--argumentStackPointer];
-      }
-
-      internal void CreateStackFrame(double[] argValues) {
-        // push in reverse order to make indexing easier
-        for (int i = argValues.Length - 1; i >= 0; i--) {
-          argumentStack[argumentStackPointer++] = argValues[i];
-        }
-        Push(argValues.Length);
-      }
-
-      internal void RemoveStackFrame() {
-        int size = (int)Pop();
-        argumentStackPointer -= size;
-      }
-
-      internal double GetStackFrameValue(ushort index) {
-        // layout of stack:
-        // [0]   <- argumentStackPointer
-        // [StackFrameSize = N + 1]
-        // [Arg0] <- argumentStackPointer - 2 - 0
-        // [Arg1] <- argumentStackPointer - 2 - 1
-        // [...]
-        // [ArgN] <- argumentStackPointer - 2 - N
-        // <Begin of stack frame>
-        return argumentStack[argumentStackPointer - index - 2];
-      }
-    }
-    private class OpCodes {
-      public const byte Add = 1;
-      public const byte Sub = 2;
-      public const byte Mul = 3;
-      public const byte Div = 4;
-
-      public const byte Sin = 5;
-      public const byte Cos = 6;
-      public const byte Tan = 7;
-
-      public const byte Log = 8;
-      public const byte Exp = 9;
-
-      public const byte IfThenElse = 10;
-
-      public const byte GT = 11;
-      public const byte LT = 12;
-
-      public const byte AND = 13;
-      public const byte OR = 14;
-      public const byte NOT = 15;
-
-
-      public const byte Average = 16;
-
-      public const byte Call = 17;
-
-      public const byte Variable = 18;
-      public const byte LagVariable = 19;
-      public const byte Constant = 20;
-      public const byte Arg = 21;
-
-      public const byte Power = 22;
-      public const byte Root = 23;
-      public const byte TimeLag = 24;
-      public const byte Integral = 25;
-      public const byte Derivative = 26;
-
-      public const byte VariableCondition = 27;
-
-      public const byte Square = 28;
-      public const byte SquareRoot = 29;
-      public const byte Gamma = 30;
-      public const byte Psi = 31;
-      public const byte Dawson = 32;
-      public const byte ExponentialIntegralEi = 33;
-      public const byte CosineIntegral = 34;
-      public const byte SineIntegral = 35;
-      public const byte HyperbolicCosineIntegral = 36;
-      public const byte HyperbolicSineIntegral = 37;
-      public const byte FresnelCosineIntegral = 38;
-      public const byte FresnelSineIntegral = 39;
-      public const byte AiryA = 40;
-      public const byte AiryB = 41;
-      public const byte Norm = 42;
-      public const byte Erf = 43;
-      public const byte Bessel = 44;
-    }
-    #endregion
-
-    private Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
-      { typeof(Addition), OpCodes.Add },
-      { typeof(Subtraction), OpCodes.Sub },
-      { typeof(Multiplication), OpCodes.Mul },
-      { typeof(Division), OpCodes.Div },
-      { typeof(Sine), OpCodes.Sin },
-      { typeof(Cosine), OpCodes.Cos },
-      { typeof(Tangent), OpCodes.Tan },
-      { typeof(Logarithm), OpCodes.Log },
-      { typeof(Exponential), OpCodes.Exp },
-      { typeof(IfThenElse), OpCodes.IfThenElse },
-      { typeof(GreaterThan), OpCodes.GT },
-      { typeof(LessThan), OpCodes.LT },
-      { typeof(And), OpCodes.AND },
-      { typeof(Or), OpCodes.OR },
-      { typeof(Not), OpCodes.NOT},
-      { typeof(Average), OpCodes.Average},
-      { typeof(InvokeFunction), OpCodes.Call },
-      { typeof(Variable), OpCodes.Variable },
-      { typeof(LaggedVariable), OpCodes.LagVariable },
-      { typeof(Constant), OpCodes.Constant },
-      { typeof(Argument), OpCodes.Arg },
-      { typeof(Power),OpCodes.Power},
-      { typeof(Root),OpCodes.Root},
-      { typeof(TimeLag), OpCodes.TimeLag}, 
-      { typeof(Integral), OpCodes.Integral},
-      { typeof(Derivative), OpCodes.Derivative},
-      { typeof(VariableCondition),OpCodes.VariableCondition},
-      { typeof(Square),OpCodes.Square},
-      { typeof(SquareRoot),OpCodes.SquareRoot},
-      { typeof(Gamma), OpCodes.Gamma },
-      { typeof(Psi), OpCodes.Psi },
-      { typeof(Dawson), OpCodes.Dawson},
-      { typeof(ExponentialIntegralEi), OpCodes.ExponentialIntegralEi },
-      { typeof(CosineIntegral), OpCodes.CosineIntegral },
-      { typeof(SineIntegral), OpCodes.SineIntegral },
-      { typeof(HyperbolicCosineIntegral), OpCodes.HyperbolicCosineIntegral },
-      { typeof(HyperbolicSineIntegral), OpCodes.HyperbolicSineIntegral },
-      { typeof(FresnelCosineIntegral), OpCodes.FresnelCosineIntegral },
-      { typeof(FresnelSineIntegral), OpCodes.FresnelSineIntegral },
-      { typeof(AiryA), OpCodes.AiryA },
-      { typeof(AiryB), OpCodes.AiryB },
-      { typeof(Norm), OpCodes.Norm},
-      { typeof(Erf), OpCodes.Erf},
-      { typeof(Bessel), OpCodes.Bessel}
-    };
-
-    public override bool CanChangeName {
-      get { return false; }
-    }
-    public override bool CanChangeDescription {
-      get { return false; }
-    }
-
-    #region parameter properties
-    public IValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
-      get { return (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
-    }
-
-    public IValueParameter<IntValue> EvaluatedSolutionsParameter {
-      get { return (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
-    }
-    #endregion
-
-    #region properties
-    public BoolValue CheckExpressionsWithIntervalArithmetic {
-      get { return CheckExpressionsWithIntervalArithmeticParameter.Value; }
-      set { CheckExpressionsWithIntervalArithmeticParameter.Value = value; }
-    }
-
-    public IntValue EvaluatedSolutions {
-      get { return EvaluatedSolutionsParameter.Value; }
-      set { EvaluatedSolutionsParameter.Value = value; }
-    }
-    #endregion
-
-    [StorableConstructor]
-    private SymbolicDataAnalysisExpressionTreeInterpreter(bool deserializing) : base(deserializing) { }
-    private SymbolicDataAnalysisExpressionTreeInterpreter(SymbolicDataAnalysisExpressionTreeInterpreter original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new SymbolicDataAnalysisExpressionTreeInterpreter(this, cloner);
-    }
-
-    public SymbolicDataAnalysisExpressionTreeInterpreter()
-      : base("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.") {
-      Parameters.Add(new ValueParameter<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 ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      if (!Parameters.ContainsKey(EvaluatedSolutionsParameterName))
-        Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
-    }
-
-    #region IStatefulItem
-    public void InitializeState() {
-      EvaluatedSolutions.Value = 0;
-    }
-
-    public void ClearState() {
-    }
-    #endregion
-
-    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
-      if (CheckExpressionsWithIntervalArithmetic.Value)
-        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
-      EvaluatedSolutions.Value++; // increment the evaluated solutions counter
-      var compiler = new SymbolicExpressionTreeCompiler();
-      Instruction[] code = compiler.Compile(tree, MapSymbolToOpCode);
-      int necessaryArgStackSize = 0;
-      for (int i = 0; i < code.Length; i++) {
-        Instruction instr = code[i];
-        if (instr.opCode == OpCodes.Variable) {
-          var variableTreeNode = instr.dynamicNode as VariableTreeNode;
-          instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
-          code[i] = instr;
-        } else if (instr.opCode == OpCodes.LagVariable) {
-          var laggedVariableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
-          instr.iArg0 = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
-          code[i] = instr;
-        } else if (instr.opCode == OpCodes.VariableCondition) {
-          var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode;
-          instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
-        } else if (instr.opCode == OpCodes.Call) {
-          necessaryArgStackSize += instr.nArguments + 1;
-        }
-      }
-      var state = new InterpreterState(code, necessaryArgStackSize);
-
-      foreach (var rowEnum in rows) {
-        int row = rowEnum;
-        state.Reset();
-        yield return Evaluate(dataset, ref row, state);
-      }
-    }
-
-    private double Evaluate(Dataset dataset, ref int row, InterpreterState state) {
-      Instruction currentInstr = state.NextInstruction();
-      switch (currentInstr.opCode) {
-        case OpCodes.Add: {
-            double s = Evaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s += Evaluate(dataset, ref row, state);
-            }
-            return s;
-          }
-        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;
-            return s;
-          }
-        case OpCodes.Mul: {
-            double p = Evaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              p *= Evaluate(dataset, ref row, state);
-            }
-            return p;
-          }
-        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;
-            return p;
-          }
-        case OpCodes.Average: {
-            double sum = Evaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              sum += Evaluate(dataset, ref row, state);
-            }
-            return sum / currentInstr.nArguments;
-          }
-        case OpCodes.Cos: {
-            return Math.Cos(Evaluate(dataset, ref row, state));
-          }
-        case OpCodes.Sin: {
-            return Math.Sin(Evaluate(dataset, ref row, state));
-          }
-        case OpCodes.Tan: {
-            return Math.Tan(Evaluate(dataset, ref row, state));
-          }
-        case OpCodes.Square: {
-            return Math.Pow(Evaluate(dataset, ref row, state), 2);
-          }
-        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: {
-            return Math.Sqrt(Evaluate(dataset, ref row, state));
-          }
-        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: {
-            return Math.Exp(Evaluate(dataset, ref row, state));
-          }
-        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: {
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
-            return alglib.psi(x);
-          }
-        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;
-            return alglib.exponentialintegralei(x);
-          }
-        case OpCodes.SineIntegral: {
-            double si, ci;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.sinecosineintegrals(x, out si, out ci);
-              return si;
-            }
-          }
-        case OpCodes.CosineIntegral: {
-            double si, ci;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.sinecosineintegrals(x, out si, out ci);
-              return ci;
-            }
-          }
-        case OpCodes.HyperbolicSineIntegral: {
-            double shi, chi;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
-              return shi;
-            }
-          }
-        case OpCodes.HyperbolicCosineIntegral: {
-            double shi, chi;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
-              return chi;
-            }
-          }
-        case OpCodes.FresnelCosineIntegral: {
-            double c = 0, s = 0;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.fresnelintegral(x, ref c, ref s);
-              return c;
-            }
-          }
-        case OpCodes.FresnelSineIntegral: {
-            double c = 0, s = 0;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.fresnelintegral(x, ref c, ref s);
-              return s;
-            }
-          }
-        case OpCodes.AiryA: {
-            double ai, aip, bi, bip;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.airy(x, out ai, out aip, out bi, out bip);
-              return ai;
-            }
-          }
-        case OpCodes.AiryB: {
-            double ai, aip, bi, bip;
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else {
-              alglib.airy(x, out ai, out aip, out bi, out bip);
-              return bi;
-            }
-          }
-        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: {
-            var x = Evaluate(dataset, ref row, state);
-            if (double.IsNaN(x)) return double.NaN;
-            else return alglib.errorfunction(x);
-          }
-        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: {
-            double condition = Evaluate(dataset, ref row, state);
-            double result;
-            if (condition > 0.0) {
-              result = Evaluate(dataset, ref row, state); SkipInstructions(state);
-            } else {
-              SkipInstructions(state); result = Evaluate(dataset, ref row, state);
-            }
-            return result;
-          }
-        case OpCodes.AND: {
-            double result = Evaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              if (result > 0.0) result = Evaluate(dataset, ref row, state);
-              else {
-                SkipInstructions(state);
-              }
-            }
-            return result > 0.0 ? 1.0 : -1.0;
-          }
-        case OpCodes.OR: {
-            double result = Evaluate(dataset, ref row, state);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              if (result <= 0.0) result = Evaluate(dataset, ref row, state);
-              else {
-                SkipInstructions(state);
-              }
-            }
-            return result > 0.0 ? 1.0 : -1.0;
-          }
-        case OpCodes.NOT: {
-            return Evaluate(dataset, ref row, state) > 0.0 ? -1.0 : 1.0;
-          }
-        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: {
-            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: {
-            var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
-            row += timeLagTreeNode.Lag;
-            double result = Evaluate(dataset, ref row, state);
-            row -= timeLagTreeNode.Lag;
-            return result;
-          }
-        case OpCodes.Integral: {
-            int savedPc = state.ProgramCounter;
-            var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
-            double sum = 0.0;
-            for (int i = 0; i < Math.Abs(timeLagTreeNode.Lag); i++) {
-              row += Math.Sign(timeLagTreeNode.Lag);
-              sum += Evaluate(dataset, ref row, state);
-              state.ProgramCounter = savedPc;
-            }
-            row -= timeLagTreeNode.Lag;
-            sum += Evaluate(dataset, ref row, state);
-            return sum;
-          }
-
-        //mkommend: derivate calculation taken from: 
-        //http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
-        //one sided smooth differentiatior, N = 4
-        // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
-        case OpCodes.Derivative: {
-            int savedPc = state.ProgramCounter;
-            double f_0 = Evaluate(dataset, ref row, state); row--;
-            state.ProgramCounter = savedPc;
-            double f_1 = Evaluate(dataset, ref row, state); row -= 2;
-            state.ProgramCounter = savedPc;
-            double f_3 = Evaluate(dataset, ref row, state); row--;
-            state.ProgramCounter = savedPc;
-            double f_4 = Evaluate(dataset, ref row, state);
-            row += 4;
-
-            return (f_0 + 2 * f_1 - 2 * f_3 - f_4) / 8; // h = 1
-          }
-        case OpCodes.Call: {
-            // evaluate sub-trees
-            double[] argValues = new double[currentInstr.nArguments];
-            for (int i = 0; i < currentInstr.nArguments; i++) {
-              argValues[i] = Evaluate(dataset, ref row, state);
-            }
-            // push on argument values on stack 
-            state.CreateStackFrame(argValues);
-
-            // save the pc
-            int savedPc = state.ProgramCounter;
-            // set pc to start of function  
-            state.ProgramCounter = (ushort)currentInstr.iArg0;
-            // evaluate the function
-            double v = Evaluate(dataset, ref row, state);
-
-            // delete the stack frame
-            state.RemoveStackFrame();
-
-            // restore the pc => evaluation will continue at point after my subtrees  
-            state.ProgramCounter = savedPc;
-            return v;
-          }
-        case OpCodes.Arg: {
-            return state.GetStackFrameValue((ushort)currentInstr.iArg0);
-          }
-        case OpCodes.Variable: {
-            if (row < 0 || row >= dataset.Rows)
-              return double.NaN;
-            var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode;
-            return ((IList<double>)currentInstr.iArg0)[row] * variableTreeNode.Weight;
-          }
-        case OpCodes.LagVariable: {
-            var laggedVariableTreeNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
-            int actualRow = row + laggedVariableTreeNode.Lag;
-            if (actualRow < 0 || actualRow >= dataset.Rows)
-              return double.NaN;
-            return ((IList<double>)currentInstr.iArg0)[actualRow] * laggedVariableTreeNode.Weight;
-          }
-        case OpCodes.Constant: {
-            var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode;
-            return constTreeNode.Value;
-          }
-
-        //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: {
-            if (row < 0 || row >= dataset.Rows)
-              return double.NaN;
-            var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode;
-            double variableValue = ((IList<double>)currentInstr.iArg0)[row];
-            double x = variableValue - variableConditionTreeNode.Threshold;
-            double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
-
-            double trueBranch = Evaluate(dataset, ref row, state);
-            double falseBranch = Evaluate(dataset, ref row, state);
-
-            return trueBranch * p + falseBranch * (1 - p);
-          }
-        default: throw new NotSupportedException();
-      }
-    }
-
-    private byte MapSymbolToOpCode(ISymbolicExpressionTreeNode treeNode) {
-      byte opCode;
-      if (!symbolToOpcode.TryGetValue(treeNode.Symbol.GetType(), out opCode))
-        throw new NotSupportedException("Symbol: " + treeNode.Symbol);
-      return opCode;
-    }
-
-    // skips a whole branch
-    private void SkipInstructions(InterpreterState state) {
-      int i = 1;
-      while (i > 0) {
-        i += state.NextInstruction().nArguments;
-        i--;
-      }
-    }
-  }
-}
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 8916)
@@ -25,6 +25,5 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator {
-    // should be moved to an interface, then un-abstract the class
+  public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator : ISymbolicDataAnalysisSolutionImpactValuesCalculator {
     public abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData);
     public abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit);
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.TreeSimplifier.sln
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.TreeSimplifier.sln	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.TreeSimplifier.sln	(revision 8916)
@@ -1,5 +1,5 @@
 ﻿
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4", "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj", "{423BD94F-963A-438E-BA45-3BB3D61CD03B}"
 EndProject
@@ -16,4 +16,8 @@
 		PreBuildEvent.cmd = PreBuildEvent.cmd
 	EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj", "{20831A74-D18F-42D9-A667-1CE3AF53DF93}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj", "{BF1E4DF4-A4CC-451F-9D50-303F405E265E}"
 EndProject
 Global
@@ -87,4 +91,28 @@
 		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x86.ActiveCfg = Release|x86
 		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x86.Build.0 = Release|x86
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Debug|x64.ActiveCfg = Debug|x64
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Debug|x64.Build.0 = Debug|x64
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Debug|x86.ActiveCfg = Debug|x86
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Debug|x86.Build.0 = Debug|x86
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Release|Any CPU.Build.0 = Release|Any CPU
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Release|x64.ActiveCfg = Release|x64
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Release|x64.Build.0 = Release|x64
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Release|x86.ActiveCfg = Release|x86
+		{20831A74-D18F-42D9-A667-1CE3AF53DF93}.Release|x86.Build.0 = Release|x86
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Debug|x64.ActiveCfg = Debug|x64
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Debug|x64.Build.0 = Debug|x64
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Debug|x86.ActiveCfg = Debug|x86
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Debug|x86.Build.0 = Debug|x86
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Release|x64.ActiveCfg = Release|x64
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Release|x64.Build.0 = Release|x64
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Release|x86.ActiveCfg = Release|x86
+		{BF1E4DF4-A4CC-451F-9D50-303F405E265E}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /branches/HeuristicLab.TreeSimplifier/HeuristicLab.TreeSimplifier.sln.DotSettings.user
===================================================================
--- /branches/HeuristicLab.TreeSimplifier/HeuristicLab.TreeSimplifier.sln.DotSettings.user	(revision 8915)
+++ /branches/HeuristicLab.TreeSimplifier/HeuristicLab.TreeSimplifier.sln.DotSettings.user	(revision 8916)
@@ -1,2 +1,3 @@
 ﻿<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
+	<s:Boolean x:Key="/Default/Environment/SearchAndNavigation/MergeOccurences/@EntryValue">False</s:Boolean>
 	<s:Boolean x:Key="/Default/Housekeeping/SolutionSettingsUpgraded/IsUpgraded/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>
