How to find the intersection of two NFA

后端 未结 5 1500
萌比男神i
萌比男神i 2021-01-06 09:54

In DFA we can do the intersection of two automata by doing the cross product of the states of the two automata and accepting those states that are accepting in both the init

5条回答
  •  春和景丽
    2021-01-06 10:28

    You can use the cross-product construction on NFAs just as you would DFAs. The only changes are how you'd handle ε-transitions. Specifically, for each state (qi, rj) in the cross-product automaton, you add an ε-transition from that state to each pair of states (qk, rj) where there's an ε-transition in the first machine from qi to qk and to each pair of states (qi, rk) where there's an ε-transition in the second machine from rj to rk.

    Alternatively, you can always convert the NFAs into DFAs and then compute the cross product of those DFAs.

    Hope this helps!

提交回复
热议问题