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.
私はこの言語を持っています:
{a n b m | m+nは偶数}
これに適した文法は何ですか?
S -> aaS | aB | bbC | ε B -> bbB | b C -> bbC | ε
ほら、それは正規の言語です。「S」は「偶数の a を構築し、さらに a が続く可能性がある」を表し、「B」は「奇数の a を構築し、奇数の b が続く」を表します。「C」は「偶数の a を構築し、偶数の b が続く。
ε は "" を表し、空の文字列