计算理论|COMP 330 Assignment 4

联系我们: 手动添加方式: 微信>添加朋友>企业微信联系人>13262280223 或者 QQ: 1483266981
这是一篇加拿大作业是一个计算理论的assignment
Question 1[15 points] Consider the grammar
S ! aSjaSbSj”:
Show that this grammar is ambiguous by giving two different parse trees for the string aab.
Question 2[30 points] Show that the grammar of the last question defines all strings, and only
those strings, in which every prefix contains at least as many as as bs. Note that this requires two
proofs. First, you must show that every string produced by the grammar has this property. Second,
you must show that every string that has this property can be produced by this grammar.
Question 3[15 points] Give an unambiguous grammar for the language defined by the grammar
in question 1.
Question 4[20 points] Give an unambiguous context-free grammar to define the following lan
guage:

Question 5[20 points] Construct a PDA that accepts the following language
{a3ibij} ≥ 0g:
Your answer should be a drawing of the states and transitions.

发表评论

了解 KJESSAY历史案例 的更多信息

立即订阅以继续阅读并访问完整档案。

继续阅读