C# CSP solver