Project Milestone Presentation Week7 Presentation
Project Milestone Presentation Week7 Presentation
Project Milestone Presentation Week7 Presentation
By Shravan
NFA
Introduction
DFA
Related work
1. A-DFA: A Time- and Space-Efficient DFA Compression Algorithm for Fast Regular Expression Evaluation (re
searchgate.net)
2. A technique for converting NFA's and DFA's to regular expressions in Lex (rowan.edu)
3. jan_2020_dfa_submatches_extraction.pdf (nitely.github.io)
Implementation#1
nfa = {}
o = int(input("State number for NFA "))
Implementation#2 #input the overall State number for NFA. Ex: If you want to create state a,b, and c put in 3.
p = int(input("Number of transitions in NFA ")) #Input Number of transitions in NFA eg: if you
want to create a and b for transition type 2.
for i in range(o):
state = input("The name of the state: ") #This is where you name the state. eg:
A,b,c,1,2,3,4,etc....
Here is the code progress I have in store thus far. So far I have nfa[state] = {}
implemented the NFA table in the code as well as the tokens for NFA. for j in range(p):
Likewise, I will further improvise on creating a dfa table and create a path = input("What are the paths ") #create the path on top of the transition. Eg: path 0
token for it as well as showing the end result of DFA solution. in transition one and path 1 in transition two.
print("What are the final states from first state {} that will travel throught the path {}
: ".format(state, path))
reaching_state = [x for x in input().split()] #the end state for NFA Table.
nfa[state][path] = reaching_state #This is to make sure that the end state is displayed in
the paths
print("\nNFA :- \n")
print(nfa)
print("\nThe NFA Table :- ") #Display the NFA table
nfa_table = pd.DataFrame(nfa)
print(nfa_table.transpose())
Overall, the code still need to be improved to solve the problem. Improvement such as additional features of DFA tables, tokens, as well as showing the end
result of DFA being coveted from the series of input in the NFA.
References
1. Srinivasan32/CompilationTechniqueProject (github.com)