For Programmers: Free Programming Magazines  


Home > Archive > Compilers > December 2004 > Examples of Ambiguous CFG's and Languages









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Examples of Ambiguous CFG's and Languages
Seyyed Jalal Kazemitabar

2004-12-02, 3:57 am

Hi,
Can anybody show me a sorce for some ambiguous Context Free Grammars
and Languages ( other than the famous one or two available in all the
books)?
Thanks
jalal++
Djamé Seddah

2004-12-11, 3:59 pm

Seyyed Jalal Kazemitabar a écrit :
> Hi,
> Can anybody show me a sorce for some ambiguous Context Free Grammars
> and Languages ( other than the famous one or two available in all the
> books)?
> Thanks
> jalal++


have a look to

np -> np gadj
np -> det n
np -> n
np -> np gp
gp -> prep np
gadj -> adj
adj -> [americain] (american)
det -> [le] (the)
n -> [joueur] (player)
n -> football (football)

so "le joueur de football américan"
can be analysed as [NP1 [Np2 [det le] [n joueur] NP2] [GP [prep de ]
[np3 [n football] [gadj [adj americain] np3] GP] NP1] or [NP1 [Np2 [det
le] [n joueur] NP2] [GP [prep de ] [np3 [n football] np3] GP] [gadj
[adj americain] gadj] NP1] (maybe for error, it's hard to draw tree by
hand)

so either the football is american or the player
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com