/// <summary> (Constructor). /// Solve the current system with the given hypotheses. /// </summary> /// /// <param name="hypotheses">Hypotheses used to solve the system.</param> /// /// <returns>The system after the algorithm.</returns> public Systeme <T> SolveWithHypotheses(Hypotheses <T> hypotheses) { Hypotheses <T> oldHypotheses; List <Element <T> > hypothesesList = hypotheses.ListeHypotheses.ToList(); do { oldHypotheses = new Hypotheses <T>(hypotheses.ListeHypotheses.ToList()); foreach (Element <T> hypothese in hypothesesList) { if (hypothese.State != ElementStateEnum.Absent) { foreach (Equation <T> equation in Equations) { ElementEquation <T> premisse = equation.DoesPremissesContainsElement(hypothese); if (premisse != null) { premisse.AlwaysTrue = true; } if (equation.ArePremissesTrue() && !hypotheses.Contains(equation.Conclusion)) { hypotheses.AddHypothese(equation.Conclusion); } } } } hypothesesList = hypotheses.ListeHypotheses.ToList(); } while (!hypotheses.Equals(oldHypotheses)); return(this); }