示例#1
0
        public static Testcase createTestcase11()
        {
            PDLPred xInA     = new PDLBelongs(new PDLPosVar("x"), new PDLSetVar("A"));
            PDLPred xInB     = new PDLBelongs(new PDLPosVar("x"), new PDLSetVar("B"));
            PDLPred xInC     = new PDLBelongs(new PDLPosVar("x"), new PDLSetVar("C"));
            PDLPred yInA     = new PDLBelongs(new PDLPosVar("y"), new PDLSetVar("A"));
            PDLPred yInB     = new PDLBelongs(new PDLPosVar("y"), new PDLSetVar("B"));
            PDLPred yInC     = new PDLBelongs(new PDLPosVar("y"), new PDLSetVar("C"));
            PDLPred zInA     = new PDLBelongs(new PDLPosVar("z"), new PDLSetVar("A"));
            PDLPred zInB     = new PDLBelongs(new PDLPosVar("z"), new PDLSetVar("B"));
            PDLPred zInC     = new PDLBelongs(new PDLPosVar("z"), new PDLSetVar("C"));
            PDLPred xOnlyInA = new PDLAnd(xInA, new PDLAnd(new PDLNot(xInB), new PDLNot(xInC)));
            PDLPred xOnlyInB = new PDLAnd(new PDLNot(xInA), new PDLAnd(xInB, new PDLNot(xInC)));
            PDLPred xOnlyInC = new PDLAnd(new PDLNot(xInA), new PDLAnd(new PDLNot(xInB), xInC));

            PDLPred problem = new PDLForallSO("A", new PDLForallSO("B", new PDLForallSO("C",
                                                                                        new PDLIf(
                                                                                            new PDLForallFO("x",
                                                                                                            new PDLAnd(
                                                                                                                new PDLIf(new PDLAtPos('a', new PDLPosVar("x")), xOnlyInA),
                                                                                                                new PDLAnd(
                                                                                                                    new PDLIf(new PDLAtPos('b', new PDLPosVar("x")), xOnlyInB),
                                                                                                                    new PDLIf(new PDLAtPos('c', new PDLPosVar("x")), xOnlyInC)
                                                                                                                    ))
                                                                                                            ),
                                                                                            new PDLForallFO("x", new PDLForallFO("y",
                                                                                                                                 new PDLAnd(
                                                                                                                                     new PDLIf(new PDLAnd(xInA, yInB), new PDLPosLe(new PDLPosVar("x"), new PDLPosVar("y"))),
                                                                                                                                     new PDLIf(new PDLAnd(xInB, yInC), new PDLPosLe(new PDLPosVar("x"), new PDLPosVar("y")))
                                                                                                                                     )
                                                                                                                                 ))
                                                                                            )
                                                                                        )));

            return(new Testcase(11, new char[] { 'a', 'b', 'c' }, problem));
        }
        public static Testcase createTestFormula12()
        {
            PDLPred xInA = new PDLBelongs(new PDLPosVar("x"), new PDLSetVar("A"));
            PDLPred xInB = new PDLBelongs(new PDLPosVar("x"), new PDLSetVar("B"));
            PDLPred xInC = new PDLBelongs(new PDLPosVar("x"), new PDLSetVar("C"));
            PDLPred yInA = new PDLBelongs(new PDLPosVar("y"), new PDLSetVar("A"));
            PDLPred yInB = new PDLBelongs(new PDLPosVar("y"), new PDLSetVar("B"));
            PDLPred yInC = new PDLBelongs(new PDLPosVar("y"), new PDLSetVar("C"));
            PDLPred zInA = new PDLBelongs(new PDLPosVar("z"), new PDLSetVar("A"));
            PDLPred zInB = new PDLBelongs(new PDLPosVar("z"), new PDLSetVar("B"));
            PDLPred zInC = new PDLBelongs(new PDLPosVar("z"), new PDLSetVar("C"));
            PDLPred xOnlyInA = new PDLAnd(xInA, new PDLAnd(new PDLNot(xInB), new PDLNot(xInC)));
            PDLPred xOnlyInB = new PDLAnd(new PDLNot(xInA), new PDLAnd(xInB, new PDLNot(xInC)));
            PDLPred xOnlyInC = new PDLAnd(new PDLNot(xInA), new PDLAnd(new PDLNot(xInB), xInC));

            PDLPred problem = new PDLForallSO("A", new PDLForallSO("B", new PDLForallSO("C",
                new PDLIf(
                    new PDLForallFO("x",
                        new PDLAnd(
                            new PDLIf(new PDLAtPos('a', new PDLPosVar("x")), xOnlyInA),
                        new PDLAnd(
                            new PDLIf(new PDLAtPos('b', new PDLPosVar("x")), xOnlyInB),
                            new PDLIf(new PDLAtPos('c', new PDLPosVar("x")), xOnlyInC)
                        ) )
                    ),
                    new PDLForallFO("x", new PDLForallFO("y", 
                        new PDLAnd(
                            new PDLIf(new PDLAnd(xInA, yInB), new PDLPosLe(new PDLPosVar("x"), new PDLPosVar("y"))),
                            new PDLIf(new PDLAnd(xInB, yInC), new PDLPosLe(new PDLPosVar("x"), new PDLPosVar("y")))
                        )
                    ) )
                )
            ) ) );
            return new Testcase(12,new char[] { 'a','b','c' }, problem);
        }