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)
- Q = finite set of states the automata can operate on.
- Σ = Finte set of input aphabet symbols
- δ = transition functions ( )
- q0 = initial state
- F = finite set of final states
one can create an object of type finite_automata
like this :
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);
learn more about the API in the docs.
- Go to src/ diectory.
- Run
make install
to build the static library in./binaries
. - for any query/bug report, feel free to open an issue regarding the same.
check out this example which demonstrates the use of fa::convert_to_dfa ()
to convert an NFA to corresponding DFA.
[WIP]
MIT License Copyright 2022 © Ankur Saini