Code Monkey home page Code Monkey logo

nfa-nondeterministic-finite-automaton's Introduction

Nondeterministic finite automaton simulator

NFA (nondeterministic finite automaton) simulator using C++. This project was used as the Computer Theory's class final project at the Federal University of Paraiba (UFPB), at the request of the professor Bruno Petrato Bruck, from the Scientific Computer Departament (DCC) of the Informatics Center (CI), UFPB.

  • How to create an automaton:

  • Save an NFA in a txt file with the following format:

    • Alphabet (default label is "alfabeto")
    • States (default label is "estados")
    • Initial State (default label is "inicial")
    • End States (default label is "final")
    • Transitions (default label is "transicoes")

Example:

alfabeto=0,1
estados=q0,q1,q2,q3
inicial=q0
final=q3
transicoes
q0,q0,0
q0,q0,1
q0,q1,1
q1,q2,epsilon

Example without any final state:

alfabeto=a,b
estados=q0,q1,q2
inicial=q0
final=
transicoes
q0,q1,a
q0,q1,epsilon
q1,q1,b
q1,q2,b

(Note: all the default labels can be changed at the source file "NFA_FileReader.hpp").

  • How to build the program:

    • Make sure your computer has g++ compiler (g++ version 6.3.0 or above)

    • Open the project directory on cmd

    • Run the following command to compile the program:

        g++ src/Exceptions/*.cpp src/Utils/*.cpp src/*.cpp -o program
      
  • How to run the program:

    • Use this on terminal to run the program on linux and mac:

        ./program
      
    • Use this on terminal to run the program on windows:

        program
      
    • Type the input file name. Example:

         4b.txt
      
    • Type the chain to process. Example:

         11011
      

(Note: if you want to process an empty chain, you just need to press enter when the chain is requested).

Authors

nfa-nondeterministic-finite-automaton's People

Contributors

diegolrs avatar eduarda-donato 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.