Using Finite Automaton (FA) check if some input string is accepted by FA (meaning you could generate that string by traversing FA).
Accepted string:
String was not accepted:
The task is implemented in 'DFA.py' file.
Write program which converts nondeterministic finite automato (NFA) to deterministic finite automato (DFA).
Where 1, 2 and 3 are terminal symbols. I wasn't able to implement the self-loops, because it was impossible for me to install pygraphviz package. But this visualisation is possible for every grammar included in the text file.
New transitions and all the rules obtained from transforming an NFA to DFA are stored in a dictionary.
The task is implemented in 'NFAtoDFA.py' file.
Tasks:
-
Eliminate ε productions.
-
Eliminate any renaming.
-
Eliminate inaccessible symbols.
-
Eliminate the non productive symbols.
-
Obtain the Chomsky Normal Form
Variant No. 26:
The output of the program:
This laboratory work consist of implementing the LL1 parser. Symbol 'e' stays for empty string. The code is implemented in file 'LL1' and the grammar for this work (variant 26) is in the file 'grammar.txt'
