Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为以下语言找到一个简单的语法(又名 s-grammar):
L={(ab) 2m b :m>=0}
[我这样做了,但这是错误的]
S->aASBB|b
一个->一个
B->b
那这个呢?
S -> aA | T A -> bB B -> aC C -> bS T -> b
这是一个常规语法——所有形式为X -> sYor的产生式X -> t,通过产生式到事务和非终结符号到状态的直接映射,对应于所讨论语言的最小 DFA。
X -> sY
X -> t