[英]Can any finite state automata be translated into a regular expression?
Let's assume that we have a fsa as follows: 假设我们有如下的fsa:
fsa = {0:{'a': 1, else: 2},1:{'b': 1, else: 2},2:{else: 2}}
This means: at state 0, if input is 'a', it goes to state 1, otherwise it goes to state 2; 这意味着:在状态0,如果输入为'a',则进入状态1,否则进入状态2;否则,进入状态2。 at state 1, if input is 'b', it goes to state 1, otherwise it goes to state 2;
在状态1,如果输入为'b',则进入状态1,否则进入状态2; at state 2, for any input, it goes to state 2.
在状态2,对于任何输入,它都会进入状态2。
Assume, state 0 is a starting state, state 1 is an accepting state and state 2 is the failure state. 假设状态0是开始状态,状态1是接受状态,状态2是失败状态。 Then this fsa can be translated as regex "ab*".
然后,可以将此fsa转换为正则表达式“ ab *”。 In fact, there are a few algorithms that translate fsa to regex, such as Brzozowski algebraic method.
实际上,有几种算法可以将fsa转换为正则表达式,例如Brzozowski代数方法。
My question: can any fsa defined in the above form be translated into a regex? 我的问题:以上形式中定义的任何fsa都可以翻译成正则表达式吗? Is there any limitation?
有什么限制吗?
Yes, they are mathematically equivalent. 是的,它们在数学上是等效的。 ' The equivalence of regular expressions and finite automata is known as Kleene's theorem.
正则表达式和有限自动机的等价性称为Kleene定理。 '
“
没有限制-所有有限状态自动机都等效于某些正则表达式,并且所有正则表达式都等效于某些有限状态自动机。
Yes, they are equivalent. 是的,它们是等效的。 From the wikipedia page on regular languages , these are all equivalent definitions of regular languages.
从Wikipedia页面上的常规语言来看,这些都是常规语言的等效定义。
Yes. 是。 A every finite automaton will have a corresponding regular expression.
每个有限的自动机都会有一个对应的正则表达式。 Kleene's theorem proves this result.
克莱因定理证明了这一结果。 The theorem is proved by using the principle of mathematical induction by partitioning the Finite Automata into the union of a number of smaller Finite Automatas.
通过将有限自动机划分为多个较小的有限自动机的并集,使用数学归纳原理证明了该定理。 The proof can be found here .
证明可以在这里找到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.