06.03.2013 Views

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

context sensitive grammar is thus more useful than its context free<br />

counterpart.<br />

One important point needs mention about the context sensitive<br />

grammar. Unlike the context free grammar, the context sensitive counterpart<br />

can have more than one literal in the left-h<strong>and</strong> side of the re-write rules. One<br />

typical re-write rule that illustrates this is: x y z→x w z, which means if y is<br />

between x <strong>and</strong> z, replace it by w.<br />

For the sake of simplicity, we present below a fragment of the context<br />

sensitive grammar that enforces number agreement between article <strong>and</strong> noun<br />

<strong>and</strong> between subject <strong>and</strong> verb, as presented below:<br />

1. S → NP VP<br />

2. NP → ART NUM N //NUM=Number//<br />

3. NP → NUM N<br />

4. NUM → singular<br />

5. NUM → plural<br />

6. ART singular → a singular<br />

7. ART singular → the singular<br />

8. ART plural → the plural<br />

9. ART plural → some plural<br />

10. Singular N → bird singular<br />

11. Plural N → birds plural<br />

12. singular VP → singular V<br />

13. plural VP → plural V<br />

14. singular V → flies<br />

15. singular V → loves<br />

16. plural V → fly<br />

17. plural V → love<br />

Now, with this context sensitive grammar that checks<br />

singularity/plurality, we want to parse the sentence: ‘Birds fly’. The derivation<br />

includes the following steps.<br />

1. S<br />

2. NP VP (by rule(1))<br />

3. NUM N VP (by rule(3))<br />

4. Plural N VP (by rule(5))<br />

5. birds plural VP (by rule(11))<br />

6. birds plural V (by rule(13))<br />

7. birds fly<br />

The context sensitive grammar presented in this section is meant for a<br />

limited vocabulary <strong>and</strong> includes checking of persons, numbers, etc. Then

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!