that is of even length and have maximum of two 0s} So words like L={11, 10, 0011...} I am trying with the following attempt S -> E

问题描述 投票:1回答:1

我正在为构建一个好的CFG而努力。L={xE{0,1}* | 偶数长度,最多两个0}。

所以像 L={11, 10, 0011...}

我正在用下面的尝试进行尝试。

S -> E | E0A | A0E | E0E0E | 00EA | EA00

E-> 1A | e

A -> 1E

我正在运行不同的推导,它们似乎很有意义,但我仍然不确定我的语法是否正确,或者是否有更好的方法来改进它?非常感谢你,我一直在努力学习CFG,我试图多练习以帮助我理解。

context-free-grammar automata computation-theory context-free-language
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.