Пример #1
0
 public static void TestDFAPumpbar() {
     var dfas = KnownAutomat.GetDFAModels();
     foreach (var dfa in dfas) {
         for (int i = 0; i < 10; i++) {
             var rnd = Serpen.Uni.Utils.RND.Next(1, 20);
             var pb = PumpingLemma.TestPumpbar(dfa, rnd);
             if (pb != PumpResult.Pumpable) {
                 System.Console.WriteLine($"Not {rnd}-pumpbar {pb} {dfa}");
             }
         }
     }
 }
Пример #2
0
        public static void TestMinimizedDeaIsMHCount() {
            var dfas = KnownAutomat.GetDFAModels();
            foreach (var dfa in dfas) {
                DFA dmin = ((DFA)dfa.PurgeStates()).Minimize();
                var mheqs = dfa.FindMNEqClasses();
                if (dmin.StatesCount != mheqs.Count) {
                    dmin.SaveAutomatImageToTemp();
                    Utils.DebugMessage($"DFA min {dmin.StatesCount} != MH {mheqs.Count}", dfa, Uni.Utils.eDebugLogLevel.Always);
                    dmin = null;
                }

            }
        }