Ejemplo n.º 1
0
        private static void GenerateRowRules(int k)
        {
            //loop over all rows
            for (int i = 0; i < 4; i++)
            {
                List <CNFify.Term> AllEqualities = new List <CNFify.Term>();

                //loop over the number of columns
                for (int j = 0; j < 3; j++)
                {
                    var thisSquare      = board[i, j, k];
                    var neighbourSquare = board[i, j + 1, k];

                    //these two should not be equal,
                    //the not is added at the upper level, here
                    //we just spec the equality
                    var Equal = CNFify.equal(thisSquare, neighbourSquare);
                    AllEqualities.Add(Equal);
                }

                AllPropositions.Add(NotAllEqual(AllEqualities));
            }
        }