Skip to content

viniciusfinger/deterministic-finite-automaton-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deterministic Finite Automaton in Python 🐍

Deterministic finite automaton simulator built in Python for the Formal Languages and Automaton course at La Salle University.

Running locally:

Clone the project:

  git clone git@github.com:viniciusfinger/afd-python.git

Access the project folder:

  cd afd-python

Run the main file:

  python3 main.py

Running on browser:

Access the link bellow and click "Run":

https://replit.com/@FelipeRonzani/AFD-Linguagens-Formais-e-Automatos

How to use:

After running, just fill in the information requested by the console

You must insert the automaton states into this pattern, according to the number of states you need, following the pattern s{number of state}:

  s0 s1 s2 s3

Then, insert the alphabet characters into this pattern, however you want:

  a b c d

When asked to complete the sentence with the next state, you must enter next state for that value or a period (.) when there is no next state.

The number above the arrow is the value read by the tape, the state on the left is the current state and the state on the right (which you must fill in) is where it will go.

    0
s0 ---> (coloque o estado que irá quando estiver em s0 e a fita ler 0, ou ponto (.) caso não haja transição)

At the end, the program will request a word to be validated in the automaton.

Se for válida, printará "Palavra aceita pelo autômato". Caso contrário, printará "Palavra rejeitada pelo autômato".

About

Deterministic finite automaton built in python

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages