简体   繁体   中英

how can i prove that this grammar is ambiguous?

S -> bA|aB
A -> a|aS|bAA
B -> b|bS|aBB

Any easy method other than trying to find a string that would generate two parse trees ?

Can someone please give me a string that can prove this.

There is a string though: bbaaba

S -> bA -> bbAA -> bbaA -> bbaaS -> bbaabA -> bbaaba
S -> bA -> bbAA -> bbaSA -> bbaaBA -> bbaabA -> bbaaba

没有简单的方法来证明无上下文语法模糊不清 - 实际上,通过简化Post对应问题这个问题是不可判定的

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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