public Solver(string target) { Target = target; try { tree = new SolverLanguageTree(target); } catch (FormatException e) { Console.WriteLine($"Format error:{e.Message}\n"); } }
internal Binding FindFixPoint(SolverLanguageTree tree, Binding binding) { int count = 0; const double win = 0.0000001; while (Math.Abs(tree.Eval(binding) - binding.GetBind(binding.GetMagic())) > win) { binding.SetBind(binding.GetMagic(), tree.Eval(binding)); count++; if (count > MaxIteration) { return(null); } } return(binding); }