Question 2:
Consider the following GFC rules:
S->A|B|AB
A->a|aA|aC|M
B->b|bB|bA|bC
C->c|cC|D
D->d|dM
M-> !
Draw the derivation syntax tree of each the following:
aabbaacc
bbaaacccd
aacccdd?
Consider the following GFC rules:
S->AB|BA|AM|BM
A->a|AA|AC
B->b|BA|BC
C->C|CC|CD
D->d|DM
M->! !
Apply the CKY algorithm (show your work) to test if each of the following sentences
can be derived using the above GFC rules. If yes, give the sequence of rules to derive
it.
abcd!
aaac?
bacd!
bcda