Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

A simple program written for "Theory of computation" class ,that reads a txt file which describes the DFA model from desktop (dfa.txt) and constructs the DFA model so a user can input any word and see if it gets accepted or not from the model.

License

Notifications You must be signed in to change notification settings

GeorgeGerontakis/DFA-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

DFA-creator

Example of dfa.txt (SAVED IN DESKTOP!!)

3
0 1
0
0 1
0 1 1
0 0 0
1 1 2
1 0 0
2 1 2
2 0 2

Explanation

3 => DFA has 3 states

0 1 => DFA has 2 symbols, 0 and 1

0 => Starting state is q0

0 1 => Final states are q0 and q1

0 1 1 => In q0 state: if 1 go to state q1

0 0 0 => In q0 state: if 0  go to state q0

1 1 2 => In q1 state: if 1 go to state q2

1 0 0 => In q1 state: if 0 go to state q0

2 1 2 => In q2 state: με 1 go to state q2

2 0 2 => In q2 state: με 0 go to state q2

So, basically the dfa.txt file we have as an example describes this dfa model:

Executing the program

We export it as a jar with entry point: MainClass and then we run it with the following command:

java -jar name_of_file.jar

About

A simple program written for "Theory of computation" class ,that reads a txt file which describes the DFA model from desktop (dfa.txt) and constructs the DFA model so a user can input any word and see if it gets accepted or not from the model.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages