Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 16591)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 16592)
@@ -70,5 +70,5 @@
         if (!constraint.IsDerivation) {
           var res = intervalInterpreter.GetSymbolicExressionTreeInterval(solution, variableRanges);
-          if (!IntervalInBoundaries(constraint.Interval, res, constraint.InclusiveLowerBound,
+          if (!constraint.Interval.Contains(res, constraint.InclusiveLowerBound,
             constraint.InclusiveUpperBound)) {
             return 0;
@@ -80,5 +80,5 @@
           }
           var res = intervalInterpreter.GetSymbolicExressionTreeInterval(tree, variableRanges);
-          if (!IntervalInBoundaries(constraint.Interval, res, constraint.InclusiveLowerBound,
+          if (!constraint.Interval.Contains(res, constraint.InclusiveLowerBound,
             constraint.InclusiveUpperBound)) {
             return 0;
@@ -86,4 +86,15 @@
         }
       }
+      // TODO
+      // m = new SymbolicRegressionModel(...)
+      // m.Scale();
+
+      // var e = m.GetEstimatedValues (TRAINING)
+      // OnlinePearsonCalc.Calculate(e, TARGET_TRAIING)
+      
+      // scaledTree = model.Tree;
+
+      // constraints mit scaledTree berechnen (auch die Ableitungen)
+
 
 
@@ -102,10 +113,13 @@
     }
 
-    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IRegressionProblemData problemData, IEnumerable<int> rows) {
+    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree,
+      IRegressionProblemData problemData, IEnumerable<int> rows) {
       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
       EstimationLimitsParameter.ExecutionContext = context;
       ApplyLinearScalingParameter.ExecutionContext = context;
 
-      double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows, ApplyLinearScalingParameter.ActualValue.Value);
+      double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree,
+        EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows,
+        ApplyLinearScalingParameter.ActualValue.Value);
 
       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
@@ -115,38 +129,4 @@
       return r2;
     }
-
-    private static bool IntervalInBoundaries(Interval i1, Interval i2, bool inclusiveLower, bool inclusiveUpper) {
-      if (double.IsNegativeInfinity(i1.LowerBound) && double.IsPositiveInfinity(i1.UpperBound))
-        return true;
-      //Left-unbounded and right-bounded:
-      if (double.IsNegativeInfinity(i1.LowerBound)) {
-        if (inclusiveUpper)
-          return i2.LowerBound <= i1.UpperBound && i2.UpperBound <= i1.UpperBound;
-        return i2.LowerBound < i1.UpperBound && i2.UpperBound < i1.UpperBound;
-      }
-
-      //Left-bounded and right-unbounded:
-      if (double.IsPositiveInfinity(i1.UpperBound)) {
-        if (inclusiveLower)
-          return i2.LowerBound >= i1.LowerBound && i2.UpperBound >= i1.LowerBound;
-        return i2.LowerBound > i1.LowerBound && i2.UpperBound > i1.LowerBound;
-      }
-
-      //Proper and bounded:
-      //Closed:
-      if (inclusiveLower && inclusiveUpper) { 
-        return i1.LowerBound <= i2.LowerBound && i2.UpperBound <= i1.UpperBound;
-      }
-      //Open:
-      if (!inclusiveLower && !inclusiveUpper) {
-        return i1.LowerBound < i2.LowerBound && i2.UpperBound < i1.UpperBound;
-      }
-      //Left-closed, right-open:
-      if (inclusiveLower) {
-        return i1.LowerBound <= i2.LowerBound && i2.UpperBound < i1.UpperBound;
-      }
-      //Left-open, right-closed:
-      return i1.LowerBound < i2.LowerBound && i2.UpperBound <= i1.UpperBound;
-    }
   }
 }
Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionConstraintAnalyzer.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionConstraintAnalyzer.cs	(revision 16591)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionConstraintAnalyzer.cs	(revision 16592)
@@ -23,4 +23,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using HeuristicLab.Analysis;
@@ -36,13 +37,28 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
   [StorableClass]
-  public class SymbolicRegressionConstraintAnalyzer : SingleSuccessorOperator, IAnalyzer {
-    private const string ResultCollectionParameterName = "Results";
-    private const string RegressionSolutionQualitiesResultName = "Constraint Violations";
+  public class SymbolicRegressionConstraintAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisInterpreterOperator, ISymbolicExpressionTreeAnalyzer {
+    private const string ConstraintViolationsResultName = "Constraint Violations";
 
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
 
-    public ILookupParameter<ResultCollection> ResultCollectionParameter {
-      get { return (ILookupParameter<ResultCollection>)Parameters[ResultCollectionParameterName]; }
+    #region parameter properties
+    public ILookupParameter<RegressionProblemData> RegressionProblemDataParameter {
+      get { return (ILookupParameter<RegressionProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    #endregion
+    #region properties
+
+    public RegressionProblemData RegressionProblemData {
+      get { return RegressionProblemDataParameter.ActualValue; }
     }
 
+    public ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter {
+      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
+    }
+    #endregion
 
     public virtual bool EnabledByDefault {
@@ -63,12 +79,10 @@
 
     public SymbolicRegressionConstraintAnalyzer() {
-      Parameters.Add(new LookupParameter<ResultCollection>(ResultCollectionParameterName,
-        "The result collection to store the analysis results."));
-
+      Parameters.Add(new LookupParameter<RegressionProblemData>(ProblemDataParameterName, "The problem data of the symbolic data analysis problem."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter for symbolic data analysis expression trees."));
     }
 
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      // BackwardsCompatibility3.3
     }
 
@@ -77,27 +91,32 @@
       IntervalConstraintsParser parser = new IntervalConstraintsParser();
       var intervalInterpreter = new IntervalInterpreter();
-      if (!results.ContainsKey(RegressionSolutionQualitiesResultName)) {
-        var newDataTable = new DataTable(RegressionSolutionQualitiesResultName);
-        results.Add(new Result(RegressionSolutionQualitiesResultName, "Chart displaying the constraint violatoins.",
+      if (!results.ContainsKey(ConstraintViolationsResultName)) {
+        var newDataTable = new DataTable(ConstraintViolationsResultName);
+        results.Add(new Result(ConstraintViolationsResultName, "Chart displaying the constraint violations.",
           newDataTable));
       }
 
-      var dataTable = (DataTable)results[RegressionSolutionQualitiesResultName].Value;
+      var dataTable = (DataTable)results[ConstraintViolationsResultName].Value;
+      var problemData = RegressionProblemData;
 
-      foreach (var result in results.Where(r => r.Value is IRegressionSolution)) {
-        var solution = (ISymbolicRegressionSolution)result.Value;
-        var constraints =
-          parser.Parse(((RegressionProblemData)solution.ProblemData).IntervalConstraintsParameter.Value.Value);
-        var variableRanges = ((RegressionProblemData)solution.ProblemData).VariableRangesParameter.Value
-          .VariableIntervals;
+      var constraintViolations = new Dictionary<string, int>();
 
-        if (dataTable.Rows.Count == 0) {
-          foreach (var constraint in constraints) {
-            if (!dataTable.Rows.ContainsKey(constraint.Derivaiton)) {
-              dataTable.Rows.Add(new DataRow(constraint.Derivaiton));
-            }
+      var constraints =
+        parser.Parse(problemData.IntervalConstraints.Value);
+      var variableRanges = problemData.VariableRanges.VariableIntervals;
+
+      if (dataTable.Rows.Count == 0) {
+        foreach (var constraint in constraints) {
+          if (!dataTable.Rows.ContainsKey(constraint.Expression)) {
+            dataTable.Rows.Add(new DataRow(constraint.Expression));
           }
         }
+      }
 
+      foreach (var constraint in constraints) {
+        constraintViolations.Add(constraint.Expression, 0);
+      }
+
+      foreach (var tree in this.SymbolicExpressionTree) {
         foreach (var constraint in constraints) {
           if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
@@ -105,73 +124,32 @@
               $"The given variable {constraint.Variable} in the constraint does not exists in the model.",
               nameof(IntervalConstraintsParser));
-          var numberOfViolations = dataTable.Rows[constraint.Derivaiton].Values.Count > 0
-            ? dataTable.Rows[constraint.Derivaiton].Values.Last()
-            : 0;
           if (!constraint.IsDerivation) {
-            var res = intervalInterpreter.GetSymbolicExressionTreeInterval(solution.Model.SymbolicExpressionTree,
+            var res = intervalInterpreter.GetSymbolicExressionTreeInterval(tree,
               variableRanges);
-            if (!IntervalInBoundaries(constraint.Interval, res, constraint.InclusiveLowerBound,
+            if (!constraint.Interval.Contains(res, constraint.InclusiveLowerBound,
               constraint.InclusiveUpperBound)) {
-              dataTable.Rows[constraint.Derivaiton].Values.Add(numberOfViolations + 1);
-            } else {
-              dataTable.Rows[constraint.Derivaiton].Values.Add(numberOfViolations);
+              constraintViolations[constraint.Expression]++;
             }
           } else {
-            var tree = solution.Model.SymbolicExpressionTree;
+            var dTree = tree;
             for (var i = 0; i < constraint.NumberOfDerivation; ++i) {
-              tree = DerivativeCalculator.Derive(tree, constraint.Variable);
+              dTree = DerivativeCalculator.Derive(dTree, constraint.Variable);
             }
 
-            var res = intervalInterpreter.GetSymbolicExressionTreeInterval(solution.Model.SymbolicExpressionTree,
+            var res = intervalInterpreter.GetSymbolicExressionTreeInterval(dTree,
               variableRanges);
-            if (!IntervalInBoundaries(constraint.Interval, res, constraint.InclusiveLowerBound,
+            if (!constraint.Interval.Contains(res, constraint.InclusiveLowerBound,
               constraint.InclusiveUpperBound)) {
-              dataTable.Rows[constraint.Derivaiton].Values.Add(numberOfViolations + 1);
-            } else {
-              dataTable.Rows[constraint.Derivaiton].Values.Add(numberOfViolations);
+              constraintViolations[constraint.Expression]++;
             }
           }
         }
+      }
 
+      foreach (var kvp in constraintViolations) {
+        dataTable.Rows[kvp.Key].Values.Add(kvp.Value);
       }
       return base.Apply();
     }
-
-    private static bool IntervalInBoundaries(Interval i1, Interval i2, bool inclusiveLower, bool inclusiveUpper) {
-      if (double.IsNegativeInfinity(i1.LowerBound) && double.IsPositiveInfinity(i1.UpperBound))
-        return true;
-      //Left-unbounded and right-bounded:
-      if (double.IsNegativeInfinity(i1.LowerBound)) {
-        if (inclusiveUpper)
-          return i2.LowerBound <= i1.UpperBound && i2.UpperBound <= i1.UpperBound;
-        return i2.LowerBound < i1.UpperBound && i2.UpperBound < i1.UpperBound;
-      }
-
-      //Left-bounded and right-unbounded:
-      if (double.IsPositiveInfinity(i1.UpperBound)) {
-        if (inclusiveLower)
-          return i2.LowerBound >= i1.LowerBound && i2.UpperBound >= i1.LowerBound;
-        return i2.LowerBound > i1.LowerBound && i2.UpperBound > i1.LowerBound;
-      }
-
-      //Proper and bounded:
-      //Closed:
-      if (inclusiveLower && inclusiveUpper) {
-        return i1.LowerBound <= i2.LowerBound && i2.UpperBound <= i1.UpperBound;
-      }
-
-      //Open:
-      if (!inclusiveLower && !inclusiveUpper) {
-        return i1.LowerBound < i2.LowerBound && i2.UpperBound < i1.UpperBound;
-      }
-
-      //Left-closed, right-open:
-      if (inclusiveLower) {
-        return i1.LowerBound <= i2.LowerBound && i2.UpperBound < i1.UpperBound;
-      }
-
-      //Left-open, right-closed:
-      return i1.LowerBound < i2.LowerBound && i2.UpperBound <= i1.UpperBound;
-    }
   }
 }
Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 16591)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 16592)
@@ -113,4 +113,5 @@
       Operators.Add(new SymbolicRegressionSolutionsAnalyzer());
       Operators.Add(new SymbolicExpressionTreePhenotypicSimilarityCalculator());
+      Operators.Add(new SymbolicRegressionConstraintAnalyzer());
       Operators.Add(new SymbolicRegressionPhenotypicDiversityAnalyzer(Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>()) { DiversityResultName = "Phenotypic Diversity" });
       ParameterizeOperators();
Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs	(revision 16591)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs	(revision 16592)
@@ -43,4 +43,41 @@
     public bool Contains(double value) {
       return LowerBound <= value && value <= UpperBound;
+    }
+
+    public bool Contains(Interval other, bool lowerBoundInclusive = true, bool upperBoundInclusive = false) {
+      if (double.IsNegativeInfinity(this.LowerBound) && double.IsPositiveInfinity(this.UpperBound))
+        return true;
+      //Left-unbounded and right-bounded:
+      if (double.IsNegativeInfinity(this.LowerBound)) {
+        if (upperBoundInclusive)
+          return other.LowerBound <= this.UpperBound && other.UpperBound <= this.UpperBound;
+        return other.LowerBound < this.UpperBound && other.UpperBound < this.UpperBound;
+      }
+
+      //Left-bounded and right-unbounded:
+      if (double.IsPositiveInfinity(this.UpperBound)) {
+        if (lowerBoundInclusive)
+          return other.LowerBound >= this.LowerBound && other.UpperBound >= this.LowerBound;
+        return other.LowerBound > this.LowerBound && other.UpperBound > this.LowerBound;
+      }
+
+      //Proper and bounded:
+      //Closed:
+      if (lowerBoundInclusive && upperBoundInclusive) {
+        return this.LowerBound <= other.LowerBound && other.UpperBound <= this.UpperBound;
+      }
+
+      //Open:
+      if (!lowerBoundInclusive && !upperBoundInclusive) {
+        return this.LowerBound < other.LowerBound && other.UpperBound < this.UpperBound;
+      }
+
+      //Left-closed, right-open:
+      if (lowerBoundInclusive) {
+        return this.LowerBound <= other.LowerBound && other.UpperBound < this.UpperBound;
+      }
+
+      //Left-open, right-closed:
+      return this.LowerBound < other.LowerBound && other.UpperBound <= this.UpperBound;
     }
 
Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs	(revision 16591)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs	(revision 16592)
@@ -7,5 +7,5 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   public class IntervalConstraint {
-    public string Derivaiton { get; set; }
+    public string Expression { get; set; }
     public string Definition { get; set; }
     public Interval Interval { get; set; }
Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraintsParser.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraintsParser.cs	(revision 16591)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraintsParser.cs	(revision 16592)
@@ -40,5 +40,5 @@
             intervalConstraint.IsDerivation = false;
           }
-          intervalConstraint.Derivaiton = matches[i].Groups[0].Value;
+          intervalConstraint.Expression = matches[i].Groups[0].Value;
           intervalConstraint.InclusiveLowerBound = (matches[i].Groups[2].Value == "[");
           intervalConstraint.InclusiveUpperBound = (matches[i].Groups[6].Value == "]");
Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs	(revision 16591)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs	(revision 16592)
@@ -105,9 +105,10 @@
     }
 
-    public IFixedValueParameter<NamedIntervals> VariableRangesParameter {
-      get { return (IFixedValueParameter<NamedIntervals>)Parameters[VariableRangesParameterName]; }
-    }
+    public IFixedValueParameter<NamedIntervals> VariableRangesParameter => (IFixedValueParameter<NamedIntervals>)Parameters[VariableRangesParameterName];
+
+    public NamedIntervals VariableRanges => VariableRangesParameter.Value;
 
     public IFixedValueParameter<TextValue> IntervalConstraintsParameter => (IFixedValueParameter<TextValue>) Parameters[IntervalConstraintsParameterName];
+    public TextValue IntervalConstraints => IntervalConstraintsParameter.Value;
 
     public string TargetVariable {
