有限自动机示意图
视频锁定
{$ currentTime | date:'mm:ss' $}
{$ timeLeft | date:'mm:ss' $}
上图是一个简易有限自动机,接受 a 及 a 结尾的任意长度的串。其脚本定义如下:
digraph automata_0 {
size ="8.5, 11";
fontname = "Microsoft YaHei";
fontsize = 10;
node [shape = circle, fontname = "Microsoft YaHei", fontsize = 10];
edge [fontname = "Microsoft YaHei", fontsize = 10];
0 [ style = filled, color=lightgrey ];
2 [ shape = doublecircle ];
0 -> 2 [ label = "a " ];
0 -> 1 [ label = "other " ];
1 -> 2 [ label = "a " ];
1 -> 1 [ label = "other " ];
2 -> 2 [ label = "a " ];
2 -> 1 [ label = "other " ];
"Machine: a" [ shape = plaintext ];
}
形状值为 plaintext 的表示不用绘制边框,仅展示纯文本内容,这个在绘图中,绘制指示性的 文本时很有用,如上图中的”Machine: a”。
在线练习
{$ activeFileHint $}