Пример #1
0
        public static void testDfaOperation()
        {
            Console.WriteLine("--------------DFA AND--------------\nMerging 2 DFA's\n--------------DFA AND--------------");
            GraphViz.PrintDFA(dfa1.and(dfa2), "dfa-and");

            Console.WriteLine("--------------DFA OR-------------\nMerging 2 DFA's\n--------------DFA OR--------------");
            GraphViz.PrintDFA(dfa1.or(dfa2), "dfa-or");

            Console.WriteLine("--------------DFA NEGATIVE-------------\nNegative of a DFA\n--------------DFA NEGATIVE--------------");
            GraphViz.PrintDFA(dfa1.negative(), "dfa-negative");
        }
Пример #2
0
        public static void TestDFA()
        {
            Console.WriteLine("--------------DFA--------------\nBegint met abb of eindigt op baab\n--------------DFA--------------");
            // Begint met abb of eindigt op baab
            string test = "abbabaab";

            tester(test, dfa.accept(test.ToCharArray()));
            test = "abbaaaaaa";
            tester(test, dfa.accept(test.ToCharArray()));
            test = "abaaaaaabbbbbbabaab";
            tester(test, dfa.accept(test.ToCharArray()));
            test = "abbaab";
            tester(test, dfa.accept(test.ToCharArray()));
            test = "abaa";
            tester(test, dfa.accept(test.ToCharArray()));
            test = "aaaaaaabbbbbb";
            tester(test, dfa.accept(test.ToCharArray()));
            GraphViz.PrintDFA(dfa, "dfa");
        }
Пример #3
0
 public static void testSquashDFA()
 {
     Console.WriteLine("--------------SQUASH DFA--------------\nsquash dfa\n--------------SQUASH DFA--------------");
     GraphViz.PrintDFA(dfa.squash(), "dfaSquash");
 }
Пример #4
0
 public static void testMinimiseDFA()
 {
     Console.WriteLine("--------------MINIMISE DFA--------------\nminimise dfa\n--------------MINIMISE DFA--------------");
     GraphViz.PrintDFA(ndfa2.toDFA().minimise(), "dfaMinimise");
 }
Пример #5
0
 public static void testNDFAtoDFA()
 {
     Console.WriteLine("--------------NDFA TO DFA--------------\nNDFA to DFA\n--------------NDFA TO DFA--------------");
     GraphViz.PrintDFA(ndfa2.toDFA(), "ndfaToDfa");
     //GraphViz.PrintNDFA(ndfa2, "ndfa");
 }