Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IShapeConstrainedRegressionProblem.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IShapeConstrainedRegressionProblem.cs	(revision 17958)
+++ 	(revision )
@@ -1,28 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HEAL.Attic;
-
-namespace HeuristicLab.Problems.DataAnalysis {
-  [StorableType("C6E9D32A-7727-487E-859C-DF24EDCC5922")]
-  public interface  IShapeConstrainedRegressionProblem : IDataAnalysisProblem<IShapeConstrainedRegressionProblemData> {
-  }
-}
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IShapeConstrainedRegressionProblemData.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IShapeConstrainedRegressionProblemData.cs	(revision 17958)
+++ 	(revision )
@@ -1,29 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HEAL.Attic;
-
-namespace HeuristicLab.Problems.DataAnalysis{
-  [StorableType("1E3329B1-E67A-4C4A-BAC3-251DC571B4F1")]
-  public interface IShapeConstrainedRegressionProblemData : IRegressionProblemData {
-    ShapeConstraints ShapeConstraints { get; }
-  }
-}
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstrainedRegressionProblem.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstrainedRegressionProblem.cs	(revision 17958)
+++ 	(revision )
@@ -1,37 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HEAL.Attic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-
-namespace HeuristicLab.Problems.DataAnalysis{
-  [StorableType("B53C4C71-3715-4BB1-9A95-4E969D8135C6")]
-  [Item("Shape-constrained Regression Problem", "A regression problem with shape constraints.")]
-  public class ShapeConstrainedRegressionProblem : DataAnalysisProblem<IShapeConstrainedRegressionProblemData>, IShapeConstrainedRegressionProblem {
-    [StorableConstructor]
-    protected ShapeConstrainedRegressionProblem(StorableConstructorFlag _) : base(_) { }
-    protected ShapeConstrainedRegressionProblem(ShapeConstrainedRegressionProblem original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) { return new ShapeConstrainedRegressionProblem(this, cloner); }
-
-    public ShapeConstrainedRegressionProblem() : base(new ShapeConstrainedRegressionProblemData()) { }
-  }
-}
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstrainedRegressionProblemData.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstrainedRegressionProblemData.cs	(revision 17958)
+++ 	(revision )
@@ -1,152 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 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 HEAL.Attic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-
-namespace HeuristicLab.Problems.DataAnalysis {
-  [StorableType("8D44EABE-2D52-4501-B62D-5E28FB4CFEAE")]
-  [Item("ShapeConstrainedProblemData", "Represents an item containing all data defining a regression problem with shape constraints.")]
-  public class ShapeConstrainedRegressionProblemData : RegressionProblemData, IShapeConstrainedRegressionProblemData {
-    protected const string ShapeConstraintsParameterName = "ShapeConstraints";
-
-    private static double[,] kozaF1 = new double[,] {
-          {2.017885919, -1.449165046},
-          {1.30060506,  -1.344523885},
-          {1.147134798, -1.317989331},
-          {0.877182504, -1.266142284},
-          {0.852562452, -1.261020794},
-          {0.431095788, -1.158793317},
-          {0.112586002, -1.050908405},
-          {0.04594507,  -1.021989402},
-          {0.042572879, -1.020438113},
-          {-0.074027291,  -0.959859562},
-          {-0.109178553,  -0.938094706},
-          {-0.259721109,  -0.803635355},
-          {-0.272991057,  -0.387519561},
-          {-0.161978191,  -0.193611001},
-          {-0.102489983,  -0.114215349},
-          {-0.01469968, -0.014918985},
-          {-0.008863365,  -0.008942626},
-          {0.026751057, 0.026054094},
-          {0.166922436, 0.14309643},
-          {0.176953808, 0.1504144},
-          {0.190233418, 0.159916534},
-          {0.199800708, 0.166635331},
-          {0.261502822, 0.207600348},
-          {0.30182879,  0.232370249},
-          {0.83763905,  0.468046718}
-    };
-
-    private static readonly Dataset defaultDataset;
-    private static readonly IEnumerable<string> defaultAllowedInputVariables;
-    private static readonly string defaultTargetVariable;
-
-    private static readonly ShapeConstrainedRegressionProblemData emptyProblemData;
-    public new static ShapeConstrainedRegressionProblemData EmptyProblemData {
-      get { return emptyProblemData; }
-    }
-
-    static ShapeConstrainedRegressionProblemData() {
-      defaultDataset = new Dataset(new string[] { "y", "x" }, kozaF1);
-      defaultDataset.Name = "Fourth-order Polynomial Function Benchmark Dataset";
-      defaultDataset.Description = "f(x) = x^4 + x^3 + x^2 + x^1";
-      defaultAllowedInputVariables = new List<string>() { "x" };
-      defaultTargetVariable = "y";
-      var problemData = new ShapeConstrainedRegressionProblemData();
-      problemData.Parameters.Clear(); // parameters are cleared and added below because we cannot set / change parameters of ProblemData
-      problemData.Name = "Empty Regression ProblemData";
-      problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
-      problemData.isEmpty = true;
-
-      problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset()));
-      problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, ""));
-      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
-      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
-      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
-      problemData.Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, "", new IntervalCollection()));
-      problemData.Parameters.Add(new FixedValueParameter<ShapeConstraints>(ShapeConstraintsParameterName, "", new ShapeConstraints()));
-      emptyProblemData = problemData;
-    }
-
-    public IFixedValueParameter<ShapeConstraints> ShapeConstraintsParameter => (IFixedValueParameter<ShapeConstraints>)Parameters[ShapeConstraintsParameterName];
-    public ShapeConstraints ShapeConstraints => ShapeConstraintsParameter.Value;
-
-    [StorableConstructor]
-    protected ShapeConstrainedRegressionProblemData(StorableConstructorFlag _) : base(_) { }
-
-    protected ShapeConstrainedRegressionProblemData(ShapeConstrainedRegressionProblemData original, Cloner cloner) : base(original, cloner) {
-      RegisterEventHandlers();
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEventHandlers();
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      if (this == emptyProblemData) return emptyProblemData;
-      return new ShapeConstrainedRegressionProblemData(this, cloner);
-    }
-
-    public ShapeConstrainedRegressionProblemData() : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable,
-                                                          trainingPartition: new IntRange(0, defaultDataset.Rows),
-                                                          testPartition: new IntRange(0, 0)) { } // no test partition for the demo problem
-
-    public ShapeConstrainedRegressionProblemData(IRegressionProblemData regressionProblemData)
-      : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable,
-          regressionProblemData.TrainingPartition, regressionProblemData.TestPartition) {
-    }
-
-    public ShapeConstrainedRegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable,
-                                                 IntRange trainingPartition, IntRange testPartition,
-                                                 IEnumerable<ITransformation> transformations = null, ShapeConstraints sc = null)
-    : base(dataset, allowedInputVariables, targetVariable, transformations ?? Enumerable.Empty<ITransformation>()) {
-      TrainingPartition.Start = trainingPartition.Start;
-      TrainingPartition.End = trainingPartition.End;
-      TestPartition.Start = testPartition.Start;
-      TestPartition.End = testPartition.End;
-      if (sc == null) sc = new ShapeConstraints();
-      Parameters.Add(new FixedValueParameter<ShapeConstraints>(ShapeConstraintsParameterName, "Specifies the shape constraints for the regression problem.", (ShapeConstraints)sc.Clone()));
-
-      RegisterEventHandlers();
-    }
-
-    private void RegisterEventHandlers() {
-      ShapeConstraints.Changed += ShapeConstraints_Changed;
-      ShapeConstraints.CheckedItemsChanged += ShapeConstraints_Changed;
-      ShapeConstraints.CollectionReset += ShapeConstraints_Changed;
-      ShapeConstraints.ItemsAdded += ShapeConstraints_Changed;
-      ShapeConstraints.ItemsRemoved += ShapeConstraints_Changed;
-      ShapeConstraints.ItemsMoved += ShapeConstraints_Changed;
-      ShapeConstraints.ItemsReplaced += ShapeConstraints_Changed;
-    }
-
-    private void ShapeConstraints_Changed(object sender, EventArgs e) {
-      OnChanged();
-    }
-  }
-}
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstraint.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstraint.cs	(revision 17958)
+++ 	(revision )
@@ -1,208 +1,0 @@
-﻿#region License Information
-
-/* HeuristicLab
- * Copyright (C) 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 HEAL.Attic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-
-namespace HeuristicLab.Problems.DataAnalysis {
-  [StorableType("8109BE58-CCFB-4462-A2F4-EEE5DFADAFF7")]
-  [Item("ShapeConstraint", "Constraint on the shape of a function e.g. monotonicity.")]
-  public sealed class ShapeConstraint : Item {
-    [Storable]
-    private string variable;
-
-    public string Variable {
-      get => variable;
-      set {
-        if (variable == value)
-          return;
-        variable = value;
-        OnToStringChanged();
-        OnChanged();
-      }
-    }
-
-    public bool IsDerivative => NumberOfDerivations > 0;
-
-    [Storable]
-    private int numberOfDerivations;
-
-    public int NumberOfDerivations {
-      get => numberOfDerivations;
-      set {
-        if (value < 0 || value > 3)
-          throw new ArgumentException("Number of derivation has to be between 0 - 3.");
-        if (numberOfDerivations == value)
-          return;
-        numberOfDerivations = value;
-        OnToStringChanged();
-        OnChanged();
-      }
-    }
-
-    [Storable]
-    private Interval interval;
-
-    public Interval Interval {
-      get => interval;
-      set {
-        if (interval == value)
-          return;
-        interval = value;
-        OnToStringChanged();
-        OnChanged();
-      }
-    }
-
-    [Storable]
-    private IntervalCollection regions;
-    public IntervalCollection Regions {
-      get => regions;
-      set {
-        if (regions != value) {
-          if (regions != null) regions.Changed -= regions_Changed;
-          regions = value;
-          if (regions != null) regions.Changed += regions_Changed;
-          OnToStringChanged();
-          OnChanged();
-        }
-      }
-    }
-
-
-    [Storable]
-    private double weight = 1.0;
-    public double Weight {
-      get => weight;
-      set {
-        if (weight <= 0.0) throw new ArgumentOutOfRangeException("Weight must be larger than zero.");
-        if (weight != value) {
-          weight = value;
-          OnToStringChanged();
-          OnChanged();
-        }
-      }
-    }
-
-    [StorableConstructor]
-    private ShapeConstraint(StorableConstructorFlag _) : base(_) { }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      if (regions != null) regions.Changed += regions_Changed;
-    }
-
-    // without derivation
-    public ShapeConstraint(Interval interval, double weight)
-      : this(string.Empty, 0,
-         interval, new IntervalCollection(), weight) { }
-
-    public ShapeConstraint(Interval interval, IntervalCollection regions, double weight)
-      : this(string.Empty, 0,
-         interval, regions, weight) { }
-
-    public ShapeConstraint(string variable, int numberOfDerivations,
-                              Interval interval, double weight)
-      : this(variable, numberOfDerivations,
-             interval, new IntervalCollection(), weight) { }
-
-    public ShapeConstraint(string variable, int numberOfDerivations,
-                              Interval interval, IntervalCollection regions, double weight) {
-      Variable = variable;
-      NumberOfDerivations = numberOfDerivations;
-      Interval = interval;
-      Regions = regions;
-      Weight = weight;
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new ShapeConstraint(this, cloner);
-    }
-
-    private ShapeConstraint(ShapeConstraint original, Cloner cloner)
-      : base(original, cloner) {
-      Variable = original.Variable;
-      NumberOfDerivations = original.NumberOfDerivations;
-      Interval = original.Interval;
-      Regions = cloner.Clone(original.Regions);
-      Weight = original.weight;
-    }
-
-
-    public event EventHandler Changed;
-
-    private void OnChanged() {
-      var handlers = Changed;
-      if (handlers != null)
-        handlers(this, EventArgs.Empty);
-    }
-
-
-    private void regions_Changed(object sender, EventArgs e) {
-      OnToStringChanged();
-      OnChanged();
-    }
-
-    public override string ToString() {
-      return GenerateExpressionString();
-    }
-
-
-    private string GenerateExpressionString() {
-      string expression;
-      string write(double val) => double.IsPositiveInfinity(val) ? "inf." : double.IsNegativeInfinity(val) ? "-inf." : $"{val}";
-      if (!IsDerivative) {
-        expression = string.Format($"f in [{write(Interval.LowerBound)} .. {write(Interval.UpperBound)}]");
-        if (Regions != null) {
-          foreach (var region in Regions.GetReadonlyDictionary())
-            expression += $", {region.Key} in [{write(region.Value.LowerBound)} .. {write(region.Value.UpperBound)}]";
-        }
-        if (Weight != 1.0) {
-          expression += $" weight: {weight}";
-        }
-
-        return expression;
-      }
-
-      var derivationString = string.Empty;
-      switch (numberOfDerivations) {
-        case 1:
-          derivationString = ""; break;
-        case 2:
-          derivationString = "²"; break;
-        case 3:
-          derivationString = "³"; break;
-      }
-      expression = string.Format($"∂{derivationString}f/∂{Variable}{derivationString} in [{write(Interval.LowerBound)} .. {write(Interval.UpperBound)}]");
-      if (Regions != null) {
-        foreach (var region in Regions.GetReadonlyDictionary())
-          expression += $", {region.Key} in [{write(region.Value.LowerBound)} .. {write(region.Value.UpperBound)}]";
-      }
-      if (Weight != 1.0) {
-        expression += $" weight: {weight}";
-      }
-      return expression;
-    }
-  }
-}
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstraintsParser.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstraintsParser.cs	(revision 17958)
+++ 	(revision )
@@ -1,242 +1,0 @@
-﻿#region License Information
-
-/* HeuristicLab
- * Copyright (C) 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.Text.RegularExpressions;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.Problems.DataAnalysis {
-  public static class ShapeConstraintsParser {
-    public static ShapeConstraints ParseConstraints(string text) {
-      if (string.IsNullOrEmpty(text)) throw new ArgumentNullException(nameof(text));
-
-      var lines = text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
-
-      var sc = new ShapeConstraints();
-      foreach (var line in lines) {
-        var trimmedLine = line.Trim();
-        if (trimmedLine == "") continue; // If it is a comment just continue without saving anything
-        if (trimmedLine.StartsWith("#")) {
-          // disabled constraints are commented
-          var constraint = ParseConstaint(trimmedLine.TrimStart('#', ' '));
-          sc.Add(constraint);
-          sc.SetItemCheckedState(constraint, false);
-        } else {
-          var constraint = ParseConstaint(trimmedLine);
-          sc.Add(constraint);
-          sc.SetItemCheckedState(constraint, true);
-        }
-      }
-      return sc;
-    }
-
-    public static ShapeConstraint ParseConstaint(string expr) {
-      var trimmedLine = expr.TrimStart();
-      if (trimmedLine.StartsWith("f")) {
-        return ParseFunctionRangeConstraint(expr);
-      } else if (trimmedLine.StartsWith("d") || trimmedLine.StartsWith("∂")) {
-        return ParseDerivationConstraint(expr);
-      } else {
-        throw new
-          ArgumentException($"Error at in definition {expr}. Constraints have to start with (f | d | ∂ | #)",
-                            nameof(expr));
-      }
-    }
-
-    // [124 .. 145]
-    private const string intervalRegex = @"\s*[\[]" +
-                                         @"\s*(?<lowerBound>[^\s;]*)" +
-                                         @"\s*(\.{2}|\s+|;)" +
-                                         @"\s*(?<upperBound>[^\s\]]*)" +
-                                         @"\s*[\]]";
-
-    private const string variableRegex = @"(['](?<varName>.*)[']|(?<varName>[^\s²³]+))\s*";
-    private const string weightRegex = @"\s*(weight:\s*(?<weight>\S*))?";
-    public static ShapeConstraint ParseFunctionRangeConstraint(string expr) {
-      if (!expr.StartsWith("f")) throw new ArgumentException($"Invalid function range constraint {expr} (e.g. f in [1..2])");
-      var start = "f".Length;
-      var end = expr.Length;
-      var targetConstraint = expr.Substring(start, end - start);
-
-
-      // # Example for a target variable constraint:
-      // f in [0 .. 100]
-      // # Example for constraints on model parameters: 
-      // df/d'x' in [0 .. 10]
-      // ∂²f/∂'x'² in [-1 .. inf.]
-      // df/d'x' in [0 .. 10] weight: 2.0
-      // df / d'x' in [0..10], 'x' in [1 .. 3]
-      // df / d'x' in [0..10], 'x' in [1 .. 3], y in [10..30] weight: 1.2
-
-      var match = Regex.Match(targetConstraint,
-                    @"\s*\bin\b" +
-                    intervalRegex +
-                    @"(" +
-                      @"\s*,\s*" + variableRegex +
-                      @"\s *\bin\b" +
-                      intervalRegex +
-                    @")*" +
-                    weightRegex
-                    );
-
-
-      if (match.Success) {
-        // if (match.Groups.Count < 19) throw new ArgumentException("The target-constraint is not complete.", nameof(expr));
-
-        var lowerBound = ParseIntervalBounds(match.Groups["lowerBound"].Captures[0].Value);
-        var upperBound = ParseIntervalBounds(match.Groups["upperBound"].Captures[0].Value);
-        var interval = new Interval(lowerBound, upperBound);
-        var weight = 1.0;
-
-        if (match.Groups["weight"].Success && !string.IsNullOrWhiteSpace(match.Groups["weight"].Value))
-          weight = ParseAndValidateDouble(match.Groups["weight"].Value);
-
-        if (match.Groups["varName"].Success) {
-          IntervalCollection regions = new IntervalCollection();
-          // option variables found
-          for (int idx = 0; idx < match.Groups["varName"].Captures.Count; ++idx) {
-            KeyValuePair<string, Interval> region = ParseRegion(
-              variable: match.Groups["varName"].Captures[idx].Value,
-              lb: match.Groups["lowerBound"].Captures[idx + 1].Value,
-              ub: match.Groups["upperBound"].Captures[idx + 1].Value);
-            if (regions.GetReadonlyDictionary().All(r => r.Key != region.Key))
-              regions.AddInterval(region.Key, region.Value);
-            else
-              throw new ArgumentException($"The constraint {expr} has multiple regions of the same variable.");
-          }
-          return new ShapeConstraint(interval, regions, weight);
-        } else
-          return new ShapeConstraint(interval, weight);
-      } else
-        throw new ArgumentException($"The target constraint {expr} is not valid.");
-    }
-    public static ShapeConstraint ParseDerivationConstraint(string expr) {
-      var match = Regex.Match(expr,
-                                @"([d∂])" +
-                                @"(?<numDerivations>[²³]?)\s*" +
-                                @"f\s*" +
-                                @"(\/)\s*" +
-                                @"([d∂])\s*" +
-                                variableRegex +
-                                @"(?<numDerivations>[²³]?)\s*\bin\b\s*" +
-                                intervalRegex +
-                                @"(" +
-                                  @"\s*,\s*" + variableRegex +
-                                  @"\s *\bin\b" +
-                                  intervalRegex +
-                                  @")*" +
-                                weightRegex
-                                );
-
-      if (match.Success) {
-        // if (match.Groups.Count < 26)
-        //   throw new ArgumentException("The given derivation-constraint is not complete.", nameof(expr));
-
-        var derivationVariable = match.Groups["varName"].Captures[0].Value.Trim();
-
-        var enumeratorNumDeriv = match.Groups["numDerivations"].Captures[0].Value.Trim();
-        var denominatorNumDeriv = match.Groups["numDerivations"].Captures[1].Value.Trim();
-        if (enumeratorNumDeriv != "" || denominatorNumDeriv != "") {
-          if (enumeratorNumDeriv == "" || denominatorNumDeriv == "")
-            throw new ArgumentException($"Number of derivation has to be written on both sides in {expr}.");
-          if (enumeratorNumDeriv != denominatorNumDeriv)
-            throw new ArgumentException($"Derivation number is not equal on both sides in {expr}.");
-        }
-
-        var lowerBound = ParseIntervalBounds(match.Groups["lowerBound"].Captures[0].Value);
-        var upperBound = ParseIntervalBounds(match.Groups["upperBound"].Captures[0].Value);
-        var variable = derivationVariable;
-        var numberOfDerivation = ParseDerivationCount(enumeratorNumDeriv);
-        var interval = new Interval(lowerBound, upperBound);
-        var weight = 1.0;
-
-        if (match.Groups["weight"].Success && !string.IsNullOrWhiteSpace(match.Groups["weight"].Value))
-          weight = ParseAndValidateDouble(match.Groups["weight"].Value);
-
-        if (match.Groups["varName"].Captures.Count > 1) {
-          IntervalCollection regions = new IntervalCollection();
-          // option variables found
-          for (int idx = 0; idx < match.Groups["varName"].Captures.Count - 1; ++idx) {
-            KeyValuePair<string, Interval> region = ParseRegion(
-              variable: match.Groups["varName"].Captures[idx + 1].Value,
-              lb: match.Groups["lowerBound"].Captures[idx + 1].Value,
-              ub: match.Groups["upperBound"].Captures[idx + 1].Value);
-            if (regions.GetReadonlyDictionary().All(r => r.Key != region.Key))
-              regions.AddInterval(region.Key, region.Value);
-            else
-              throw new ArgumentException($"The constraint {expr} has multiple regions of the same variable.");
-          }
-          return new ShapeConstraint(variable, numberOfDerivation, interval, regions, weight);
-        } else
-          return new ShapeConstraint(variable, numberOfDerivation, interval, weight);
-      } else
-        throw new ArgumentException($"The derivation constraint {expr} is not valid.");
-    }
-
-
-    private static KeyValuePair<string, Interval> ParseRegion(string variable, string lb, string ub) {
-      var regionLb = ParseIntervalBounds(lb);
-      var regionUb = ParseIntervalBounds(ub);
-      return new KeyValuePair<string, Interval>(variable, new Interval(regionLb, regionUb));
-    }
-
-    private static double ParseIntervalBounds(string input) {
-      input = input.ToLower();
-      switch (input) {
-        case "+inf.":
-        case "inf.":
-          return double.PositiveInfinity;
-        case "-inf.":
-          return double.NegativeInfinity;
-        default: {
-            return ParseAndValidateDouble(input);
-          }
-      }
-    }
-
-    private static double ParseAndValidateDouble(string input) {
-      var valid = double.TryParse(input, out var value);
-      if (!valid) {
-        throw new ArgumentException($"Invalid value {input} (valid value format: \"" + "+inf. | inf. | -inf. | " + FormatPatterns.GetDoubleFormatPattern() + "\")");
-      }
-
-      return value;
-    }
-
-    private static int ParseDerivationCount(string input) {
-      switch (input) {
-        case "":
-          return 1;
-        case "²":
-          return 2;
-        case "³":
-          return 3;
-        default:
-          int.TryParse(input, out var value);
-          return value;
-      }
-    }
-  }
-}
