问题 单项选择题

文法G=(E,+,*,(,),a,P,E),其中P由下列产生式组成E->E+E|E*E| (E)|a。它生成由a,+,*,(,)组成的算术表达式,该文法在乔姆斯基分层中属于 (33) 型文法,其对应的自动机是 (34) ,如产生句子a*a+a,它的派生树是 (35) ,且最左派生由 (36) 种,该文法是 (37)

37()

A.非二义性

B.二义性

C.单一性

D.多义性

答案

参考答案:B

解析:

乔姆斯基定义了4种文法类型,他们之间的差别是按文法G= (VN,VT,P,S)的P所允许的产生式的形式加以区分的。如果P中的每个产生式形式如A->P,其中A为非终结符,P为P*,则称此文法为2型文法或上下文无关文法。对应的语言称为上下文无关语言,对应的自动机称为下推自动机。题中的文法属于1型对应的下推自动机。

[*]

产生句子a*a+a的派生树有两棵,如图3所示:

这是三叉树,最左派生有两种,它们是

E= >E+E= >E*E+E= >a*E+E= >a*a+E= >a*a+a

E= >E*E= >a*E= >a*E+E= >a*a+E= >a*a+a

因此,该文法是二义的。

填空题

[A] Dr Daniel Stanley, an oceanographer, has found volcanic shards in Egypt that he believes are linked to the explosion. Computer simulations by Mike Rampino, a climate modeler from New York University, show that the resulting ash cloud could have plunged the area into darkness, as well as generating lightning and hail, two of the 10 plagues.

[B] The cloud could have also reduced the rainfall, causing a drought. If the Nile had then been poisoned by the effects of the eruption, pollution could have turned it red, as happened in a recent environmental disaster in America. The same pollution, could have driven millions of frogs on to the land, the second plague. On land the frogs would die, removing the only obstacle to an explosion of flies and lice-the third and fourth plagues. The flies could have transmitted fatal diseases to cattle (the fifth plague) and boils and blisters to humans (the sixth plague).

[C] Moses, which will be broadcast in December 2002, will suggest that much of the Bible story can be explained by a single natural disaster, a huge volcanic eruption on the Greek island of Santorini in the 16th century BC.

[D] The hour-long documentary argues that even the story of the parting of the Red Sea, which allowed Moses to lead the Hebrews to safety while the pursuing Egyptian army was drowned, may have its origins in the eruption. It repeats the theory that "Red Sea" is a mistranslation of the Sea of Reeds, a much shallower swamp.

[E] The programme tells the story of how Moses led the Hebrews out of Egypt after a series of plagues had devastated the country. But it also uses new scientific research to argue that many of the events surrounding the exodus could have been triggered by the eruption, which would have been a thousand times more powerful than a nuclear bomb.

[F] Computer simulations show that the Santorini eruption could have triggered a 600ft-high tidal wave, traveling at about 400 miles an hour, which would have been 6ft high and a hundred miles long when it reached the Egyptian delta. Such an event would have been remembered for generations, and may have provided the inspiration for the story.

[G] Fresh evidence that the Biblical plagues and the parting of the Red Sea were natural events rather than myths or miracles is to be presented in a new BBC documentary.

Order:

42()

填空题