Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arsenic-atg/finite-automata

A simple C++ library to simulate Finite Automata.
https://github.com/arsenic-atg/finite-automata

cplusplus cpp cpp-library finite-automata finite-state-machine hacktoberfest library

Last synced: 25 days ago
JSON representation

A simple C++ library to simulate Finite Automata.

Awesome Lists containing this project

README

        

* Finite Automata
:PROPERTIES:
:CUSTOM_ID: finite-automata
:END:

A simple C++ library to simulate finite automata.

The library mostly operates upon a object of class =finite_automata= which is by definition a 5 tuple (Q, Σ, δ, q0, F)

1. Q = finite set of states the automata can operate on.
2. Σ = Finte set of input aphabet symbols
3. δ = transition functions ( )
4. q0 = initial state
5. F = finite set of final states

one can create an object of type =finite_automata= like this :

#+begin_src cpp

auto nfa_transitions = (fa::transition_table) { {{1,'a'},{1}} ,
{{1,'b'},{2}} ,
{{2,'a'},{2,1}} ,
{{2,'b'},{3}} ,
{{3,'a'},{3}} ,
{{3,'b'},{3}}};

auto nfa = fa::finite_automata ({1,2,3},
{'a','b'},
{3},
1,
nfa_transitions);

#+end_src

learn more about the API in the docs.

** Prerequisites ( to build from source )

- [[https://gcc.gnu.org][standard C++ compiler]]
- [[https://www.gnu.org/software/make/][GNU Make]]

** How to use it ?

1. Go to src/ diectory.

2. Run =make install= to build the static library in =./binaries=.

3. for any query/bug report, feel free to open an [[https://github.com/Arsenic-ATG/Finite-Automata/issues][issue]] regarding the same.

** Examples

check out [[file:testsuite/fa-basic.tests/convertor.cpp][this example]] which demonstrates the use of =fa::convert_to_dfa ()= to convert an NFA to corresponding DFA.

* For the Devs

[WIP]

* License

[[file:LICENSE][MIT License]]
Copyright 2022 © [[https://github.com/Arsenic-ATG][Ankur Saini]]