GithubHelp home page GithubHelp logo

arka816 / fsm Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 128 KB

common algorithms in automata theory - minimization algorithms, regex compilers etc.

Python 100.00%
theory-of-computation computer-science automata-theory finite-state-machine

fsm's Introduction

FINITE STATE MACHINE MINIMIZATION

We present minimization algorithms for reducing Moore Machines, Mealy Machines and deterministic finite automata using equivalence classes. The project also aims to produce verilog code for said minimal automata.

Execution and test files

For deterministic finite automata

The file can be executed in the terminal as: python file_name.py test_filename.fsm A sample finite state machine file namely demo.fsm has been provided and would be parsed as default if test_filename.fsm is not provided in the terminal. It is advised to provide the complete address of the task file in the terminal during execution.

Format of input in demo.fsm

8 2
1 5
6 2
0 2
2 6
7 5
2 6
6 4
6 2
0
2
  • the first line signifies the number of states and the size of the alphabet: 8 and 2 respectively
  • the next 8 lines outline the state transition table where the rows represent the states and the columns represent the letter of the alphabet
  • the next line contains the initial state, state 0 in our case
  • the last line contains a list of acceptable states, only state 2 in our case

For Moore Machines

The file execution method is same as above.

Format of input in mealy.fsm

6 2
4 3
5 3
4 1
5 1
2 5
1 2
0 1
0 0
0 1
0 0
0 1
0 0
  • the first line signifies the number of states and the size of the alphabet: 6 and 2 respectively
  • the next 6 lines outline the state transition table similar as above
  • the next 6 lines outline the output associated with each transition as described in the state transition table above

For incompletely specified Moore machines

The file execution method is same as above

Format of input as in incomplete_mealy.fsm

6 2
4 1
5 0
4 2
5 3
2 2
3 1
0 0
0 0
X 0
1 0
1 0
X 0
  • the first line signifies the number of states and the size of the alphabet: 6 and 2 respectively
  • the next 6 lines outline the state transition table similar as above
  • the next 6 lines outline the output associated with each transition as described in the state transition table above
  • X marks unspecified values for both states and outputs

fsm's People

Contributors

arka816 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

soumitradas1999

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.