|
| |||
|
|
String languages (from Marriott & Meyer) Following Chomsky the syntax of sequantial languages is specified using a phrase-structure grammar. Grammars are production rules describing composition of the grammatical components (sentences or noun phrases). Example: English sentence (S) consists of a noun phrase (NP) followed by a verb phrase (VP). NP consists of a noun (N) preceded by optional article or determiner (D) and adjectives (A). VP consists of a verb (V) followed by NP. This definition for a subset of English with N, A, V, D is captured by production rules: S -> NP VP, NP -> D NP2 NP2->A NP2 NP2-> N VP -> V NP D -> the/a N -> dog/dinner V -> eats A -> happy/black Thus "The happy dog eats dinner" is syntactically valid sentense since it can be furnished a derivation: that is recursive application of a production rule to replace the right-hand side of a prodution by the left-hand side. terminal symbols: real words (dog, eats) and non-terminal symbols: grammar categories (N, P,..) S- is a start non-terminal symbol. The set of sentences, which may by produced from S in the grammar using productions in the grammar is language of the grammar. Membership problem: is a sentence in the language of the grammar? is solved by a parser, which will or will not produce a derivation like above. |
||||||||||||||