Drawback - when passing a big parameter by value, it incurs a performance hit.
2. Returning pure rvalue is optimized in Modern C++
Whenever possible, "return pure rvalue"
3. Use std::forward, std::move (including move semantic judiciously)
4. Use std::move_iterator()
5. Use the correct C++ Standard Container classes and Algorithms
6. Make Good Use of Your "Mathematical Instinct!"
05 - Minimization of DFA, Table Filling Method or Myhill-Nerode Theorem in C++ 2/4
How to merge the equivalent state pairs into a single state set.
{ {A, B}, {C, D}, {D, E}, {E, C}}
--- { {A, B}, {C, D, E} }
Minimization of DFA - Table Filling Method (Myhill-Nerode Theorem)
04 - Minimization of DFA, Table Filling Method or Myhill-Nerode Theorem in C++ 1/4
03 - C++ Library for Deterministic Finite Automata (DFA), Nondeterministic Finite Automata (NFA)
Minimization of DFA - Table Filling Method (Myhill-Nerode Theorem)
STEP 1. Draw a table for all pairs of states (P, Q)
STEP 1-1. Collect all states
STEP 1-2. Build state pairs
STEP 2. Mark all pairs where P is in F and Q is NOT in F
STEP 3. If there are any Unmarked pairs (P, Q)
such that [delta(P,x), delta(Q, x)] is Marked,
then mark[P, Q], where 'x' an input symbol.
Repeat this until no more markings can be made.
STEP 4. Combine all the Unmarked pairs
and make them a single state in the minimized DFA
STEP 5. Create new states for Minimized DFA
STEP 6. Create Minimized DFA with new states
004 - Subset Construction in C/C++, How to Enumerate Subsets
How to Enumerate Combinations or Construct Subsets in C++
Minimization of DFA - Table Filling Method (Example)
Minimization of DFA (When there are the Unreachable States)
Minimization of DFA - Examples (Part 1)
Minimization of DFA - Examples (Part 2)
Download Source Code:
0 Comments