Grammar and language classification

Source: Internet
Author: User
0 Grammar: There is no limit on its rules. Any number of symbols can generate any number of symbols. By 0 Language name generated by grammar 0 Language, recognition 0 Language machines correspondTuring Machine.

 

1 grammar : intuitively, there are two completely different 1 type grammar, but it is actually equivalent. A monotonic language requires no more symbols on the left of its rule than those on the right, for example: n e-> and n . Another language is called context-related. Context-related means that only one symbol on the left of the rule is replaced, and the symbols that are not replaced are kept in the original position. By 1 grammar 1 type language, recognition 1 the type language machine corresponds to linear boundary machine . Example:

Name comma name end-> name and name end.

2Grammar:2Grammar is a context-independent grammar. Simply put, there is only one non-Terminator on the left side of the rule. A typical feature of context-independent grammar is that it can be recursively nested. By2Language name generated by grammar2Language, recognition2Language machines correspondPush-down Automation. For example:

Name-> Tom | dick | Harry

SentenceS-> Name | list and name

List-> name, list | Name

3Grammar: It can only contain two types of rules: one is generated by a non-Terminator0. The second is the generation of a non-Terminator.0One or more Terminators and the last non-Terminator3Language name generated by grammar3Language, recognition3Language machines correspondFinite Automaton. For example:

SentenceS-> T | d | H | list

List-> T listtail | D listtail | H listtail

Listtail-> List | & T | & d | & H

4Grammar: No non-terminator appears on the right of the rule. By4Language name generated by grammar4Language. For example,

SS-> [TDH] | [TDH] & [TDH] | [TDH], [TDH] & [TDH]


N e-> and N

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.