Git Product home page Git Product logo

automaton-app's Introduction


Final Formal Languages and Automata Work

An application that converts a finite non-deterministic automaton into a finite deterministic automaton and process a given word

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage

About The Project

1. Objectives

Create a program that, given an finite deterministic automaton M, defined in a text file, execute the following operations:

  • Convert a non-deterministic automaton into an equivalent finite deterministic automaton;
  • Allow the user to give a word to be recognized by the deterministic automaton;
  • The program should determinate if the word received is accepted by the automaton;

2. Description

  • The program from item 1 should be implemented using any programming language;
  • The entry file format containing the non-deterministic automaton definition must follow the following pattern (including spaces between words):

<M>=({<q0>,...,<qn>},{<s1>,...,<sn>},<ini>,{ <f0>,...,<fn>})

Prog

(<q0>,<s1>)=<q1> ... (<qn>,<sn>)=<q0>

Where: <M> is the automaton name; <qi> represents one state of the automaton for 0 ≤ i ≤ n, com n ∈ N e n ≥ 0; <si> represents one symbol of the alphabet of the language recognized by the automaton for 1 ≤ i ≤ n, com n ∈ N e n ≥1; <ini> indicates the initial state of the automaton, where ini is a state of the automaton; <fi> represents one final state of the automaton where ini is a state of the automaton and 0 ≤ i ≤ n, com n ∈ N e n ≥ 0; (<qi>,<si>)=<qj> describes the function applied to a state <qi> and a <si> entry symbol that leads to the computation to a state <qj>.

Example: AUTÔMATO=({q0,q1,q3,q4,q5,q7,q8},{L,S,I,P,C,E},q0,{q7})

Prog

(q0,S)=q4 (q0,L)=q1 (q0,L)=q3 (q1,I)=q7 (q3,P)=q5 (q4,E)=q7 (q8,I)=q7 (q5,I)=q7 (q3,C)=q8

alt text

Built With

Getting Started

Install python 3 and download the project files.

Prerequisites

The initial requisites is to have Python installed in your machine. Here's where you can get it:

Installation

We strongly recommend using linux or macOs.

  1. Clone the repo

    git clone https://github.com/jvzmarmentini/automaton-app.git
  2. Install NetworkX package

    pip install networkx
  3. Install PyGraphviz package

Usage

Before executing the application, be sure that the automato.txt file has a state machine and it is formated.

To run, use:

python3 main.py automaton-file word

Then, the generated state machine will be drawn in a png file and the result (if the word is accepted) will be printed.

automaton-app's People

Contributors

jvzmarmentini avatar grpanho avatar

Watchers

 avatar

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.