Example #1
0
        public void Test_0001_DPLLAlgorithmConstructor()
        {
            IEnumerable<IClause> clauses = new []
            {
                new Clause(new [] { 2, 3, 6 }, new [] { 1, 4 }),
                new Clause(new [] { 1, 5, 6 }, new [] { 2, 3, 7 })
            };
            Formula formula = new Formula(clauses);
            Assert.IsNotNull(formula);

            DpllAlgorithm algorithm = new DpllAlgorithm(formula);
            Assert.IsNotNull(algorithm);
        }
Example #2
0
        public void Test_0002_DPLLAlgorithmSolve()
        {
            IEnumerable<IClause> clauses = new []
            {
                new Clause(new [] { 2, 3, 6 }, new [] { 1, 4 }),
                new Clause(new [] { 1, 5, 6 }, new [] { 2, 3, 7 })
            };
            Formula formula = new Formula(clauses);
            Assert.IsNotNull(formula);

            DpllAlgorithm algorithm = new DpllAlgorithm(formula);
            Assert.IsNotNull(algorithm);

            Dictionary<int, bool> solution = new Dictionary<int, bool>(algorithm.Solve());
            Assert.IsNotNull(solution);
        }
Example #3
0
        public void Test_0001_DPLLAlgorithmConstructor()
        {
            // Arrange
            IEnumerable <IClause> clauses = new []
            {
                new Clause(new [] { 2, 3, 6 }, new [] { 1, 4 }),
                new Clause(new [] { 1, 5, 6 }, new [] { 2, 3, 7 })
            };

            Formula formula = new Formula(clauses);

            Assert.IsNotNull(formula);

            // Act
            DpllAlgorithm algorithm = new DpllAlgorithm(formula);

            // Assert
            Assert.IsNotNull(algorithm);
        }
Example #4
0
        //[TestMethod]
        public void Test_0002_DPLLAlgorithmSolve()
        {
            // Arrange
            IEnumerable <IClause> clauses = new []
            {
                new Clause(new [] { 2, 3, 6 }, new [] { 1, 4 }),
                new Clause(new [] { 1, 5, 6 }, new [] { 2, 3, 7 })
            };
            Formula formula = new Formula(clauses);

            Assert.IsNotNull(formula);

            DpllAlgorithm algorithm = new DpllAlgorithm(formula);

            Assert.IsNotNull(algorithm);

            // Act
            Dictionary <int, bool> solution = new Dictionary <int, bool>(algorithm.Solve());

            // Act
            Assert.IsNotNull(solution);
            // ToDo: Additional Asserts
        }