简体   繁体   English

确定性有限自动机的正则表达式

[英]Regular Expression to Deterministic Finite Automata

How would you convert this RE to a DFA? 您如何将该RE转换为DFA?

(a+aab)*b

I'm having trouble drawing the state diagram for this one. 我在为此绘制状态图时遇到了麻烦。 I'm not sure where to start, especially with the arbitrary number of a's involved. 我不确定从哪里开始,尤其是涉及到任意数量的a时。

it does not respect exactly the proper format for DFA but you can use the following (very bad) drawing as a starting point. 它不完全遵循DFA的正确格式,但是您可以使用以下(非常糟糕)的图形作为起点。

In order to respect the standard format, you can move each letter to the curves/lines pointing to the rectangle containing it and replace the letters in the rectangles by the state numbers q1, q2, q3, etc. (this should be straightforwards) 为了遵守标准格式,您可以将每个字母移动到指向包含矩形的曲线/线,并用状态编号q1, q2, q3,等替换矩形中的字母(这应该很简单)

在此处输入图片说明 Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM