public void ForcePreSettingVariablesTest()
        {
            var p      = new Problem("Force Extension hook test");
            var preset = true;

            void MaybeSetVarX(Problem _)
            {
                // ReSharper disable once AccessToModifiedClosure
                if (preset)
                {
                    p.SetPredeterminedValue("x", true, SATVariable.DeterminationState.Preinitialized);
                }
            }

            p.AddClause("x", "y");
            p.AddClause("x", "z");
            p.AddClause(Not("x"), "z");
            p.AddClause(Not("x"), "y");
            p.InitializeTruthAssignment += MaybeSetVarX;

            int numTrue  = 0;
            int numTests = 1000;

            for (int i = 0; i < numTests; i++)
            {
                var m = p.Solve();
                if (m.IsTrue("x"))
                {
                    numTrue++;
                }
            }
            Console.WriteLine(numTrue);
            Assert.IsTrue(numTrue == numTests);

            preset = false;

            numTrue  = 0;
            numTests = 1000;
            for (int i = 0; i < numTests; i++)
            {
                var m = p.Solve();
                if (m.IsTrue("x"))
                {
                    numTrue++;
                }
            }
            Console.WriteLine(numTrue);
            Assert.IsTrue(numTrue != numTests);
        }
 public void SetVarX(Problem p)
 {
     p.SetPredeterminedValue("x", true, SATVariable.DeterminationState.Preinitialized);
 }