Esempio n. 1
0
        private void checkButton_Click(object sender, EventArgs e)
        {
            FileInterpreter fi                 = new FileInterpreter();
            Analyzer        analyzer           = new Analyzer();
            var             generatedAutomaton = fi.generateAutomaton();

            resultLabel.Text = analyzer.isLegalWord(generatedAutomaton, inputWordBox.Text).ToString();
        }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();
            FileInterpreter    fi                 = new FileInterpreter();
            Analyzer           analyzer           = new Analyzer();
            var                generatedAutomaton = fi.generateAutomaton();
            AutomatonGenerator ag                 = new AutomatonGenerator(generatedAutomaton);
            Automaton          PowerSetAutomaton  = ag.GenerateDfa();
            dotFileWriter      dw                 = new dotFileWriter();

            dw.writeToDotFile(PowerSetAutomaton);
            generateGraph(true);
            dw.writeToDotFile(generatedAutomaton);
            generateGraph(false);
            isDetLbl.Text = analyzer.isDfa(PowerSetAutomaton).ToString();
            Console.WriteLine(analyzer.isLegalWord(generatedAutomaton, "r").ToString());
            FiniteLanguageAnalyzer finiteLanguageAnalyzer = new FiniteLanguageAnalyzer(PowerSetAutomaton);
            bool isFinite = finiteLanguageAnalyzer.isFiniteLanguage();

            isFiniteLabel.Text = isFinite.ToString();
        }