I wrote a program which can generate DFAs. But the DFAs are slightly incorrect. That is, sometimes they can't accept the correct strings.

My question is: is there any algorithm can correct the DFAs, so that they can accept the given correct strings?

More formally,

Suppose DFA D doesn't accept string str.

Need an algorithm A, s.t. D' = A( D, str) and D' accepts str

有帮助吗?

解决方案

You could represent the additional string(s) you want to accept as chain automata and then simply take the union of these chains with the DFA D. Afterwards you may also need to determinize the unioned machine.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top