Index: /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
===================================================================
--- /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj	(revision 17610)
+++ /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj	(revision 17611)
@@ -174,4 +174,5 @@
     <Compile Include="SingleObjective\Evaluators\SymbolicRegressionMeanRelativeErrorEvaluator.cs" />
     <Compile Include="SingleObjective\SymbolicRegressionSolutionsAnalyzer.cs" />
+    <Compile Include="SymbolicRegressionConstraintAnalyzer.cs" />
     <Compile Include="SymbolicRegressionPhenotypicDiversityAnalyzer.cs" />
     <Compile Include="SymbolicRegressionPruningAnalyzer.cs" />
Index: /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
===================================================================
--- /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 17610)
+++ /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 17611)
@@ -91,4 +91,9 @@
         changed = true;
       }
+
+      if (!Operators.OfType<SymbolicRegressionConstraintAnalyzer>().Any()) {
+        Operators.Add(new SymbolicRegressionConstraintAnalyzer());
+        changed = true;
+      }
       if (changed) {
         ParameterizeOperators();
@@ -113,4 +118,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/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs
===================================================================
--- /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs	(revision 17611)
+++ /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs	(revision 17611)
@@ -0,0 +1,128 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using HEAL.Attic;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
+  [StorableType("4318C6BD-E0A1-45FE-AC30-96E7F73B51FB")]
+  public class SymbolicRegressionConstraintAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicExpressionTreeAnalyzer {
+    private const string ConstraintViolationsResultName   = "Constraint Violations";
+    private const string ProblemDataParameterName         = "ProblemData";
+    private const string ConstraintViolationParameterName = "ConstraintViolations";
+
+    #region parameter properties
+
+    public ILookupParameter<IRegressionProblemData> RegressionProblemDataParameter =>
+      (ILookupParameter<IRegressionProblemData>) Parameters[ProblemDataParameterName];
+
+    public IResultParameter<DataTable> ConstraintViolationParameter =>
+      (IResultParameter<DataTable>) Parameters[ConstraintViolationParameterName];
+
+    #endregion
+
+    public override bool EnabledByDefault => false;
+
+    [StorableConstructor]
+    protected SymbolicRegressionConstraintAnalyzer(StorableConstructorFlag _) : base(_) { }
+
+    protected SymbolicRegressionConstraintAnalyzer(SymbolicRegressionConstraintAnalyzer original, Cloner cloner) :
+      base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionConstraintAnalyzer(this, cloner);
+    }
+
+    public SymbolicRegressionConstraintAnalyzer() {
+      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName,
+                                                                 "The problem data of the symbolic data analysis problem."));
+      Parameters.Add(new ResultParameter<DataTable>(ConstraintViolationParameterName,
+                                                    "Shows the number of constraint violations!"));
+      ConstraintViolationParameter.DefaultValue = new DataTable(ConstraintViolationParameterName) {
+                                                                                                    VisualProperties = {
+                                                                                                                         XAxisTitle
+                                                                                                                           = "Generations",
+                                                                                                                         YAxisTitle
+                                                                                                                           = "Constraint Violations"
+                                                                                                                       }
+                                                                                                  };
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() { }
+
+    public override IOperation Apply() {
+      var problemData = RegressionProblemDataParameter.ActualValue;
+      var trees       = SymbolicExpressionTreeParameter.ActualValue;
+
+      var results        = ResultCollectionParameter.ActualValue;
+      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
+      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
+      var newDataTable   = ConstraintViolationParameter.ActualValue;
+
+      if (newDataTable.Rows.Count == 0)
+        foreach (var constraint in constraints)
+          newDataTable.Rows.Add(new DataRow(constraint.Expression));
+
+      var interpreter = new IntervalInterpreter();
+      foreach (var constraint in constraints) {
+        var violations = trees.Select(tree => ConstraintSatisfied(constraint, interpreter, variableRanges, tree))
+                              .Count(satisfied => !satisfied);
+        newDataTable.Rows[constraint.Expression].Values.Add(violations);
+      }
+
+      return base.Apply();
+    }
+
+    public static bool ConstraintSatisfied(IntervalConstraint            constraint,
+                                           IntervalInterpreter           intervalInterpreter,
+                                           IReadOnlyDictionary<string, Interval> variableRanges,
+                                           ISymbolicExpressionTree       solution) {
+      if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
+        throw new
+          ArgumentException($"The given variable {constraint.Variable} in the constraint does not exists in the model.",
+                            nameof(IntervalConstraintsParser));
+
+      Interval resultInterval;
+
+      if (!constraint.IsDerivative) {
+        resultInterval = intervalInterpreter.GetSymbolicExpressionTreeInterval(solution, variableRanges);
+      }
+      else {
+        var tree = solution;
+        for (var i = 0; i < constraint.NumberOfDerivations; ++i) {
+          if (!IntervalInterpreter.IsCompatible(tree) || !DerivativeCalculator.IsCompatible(tree))
+            throw new ArgumentException("Cube, Root, Power Symbols are not supported.");
+          tree = DerivativeCalculator.Derive(tree, constraint.Variable);
+        }
+
+        resultInterval = intervalInterpreter.GetSymbolicExpressionTreeInterval(tree, variableRanges);
+      }
+
+      var satisfied = constraint.Interval.Contains(resultInterval);
+      return satisfied;
+    }
+
+    public static bool ConstraintsSatisfied(IEnumerable<IntervalConstraint> constraints,
+                                            IReadOnlyDictionary<string, Interval>   variableRanges,
+                                            ISymbolicExpressionTree         solution) {
+      var intervalInterpreter = new IntervalInterpreter();
+      foreach (var constraint in constraints) {
+        if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
+          throw new
+            ArgumentException($"The given variable {constraint.Variable} in the constraint does not exists in the model.",
+                              nameof(IntervalConstraintsParser));
+
+        var satisfied = ConstraintSatisfied(constraint, intervalInterpreter, variableRanges, solution);
+        if (!satisfied) return false;
+      }
+
+      return true;
+    }
+  }
+}
