Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Recursive grammar

From Wikipedia, the free encyclopedia
(Redirected fromNon-recursive grammar)
Computer science and linguistics concept relating to non-terminal production

Incomputer science, agrammar is informally called arecursive grammar if it containsproduction rules that arerecursive, meaning that expanding a non-terminal according to these rules can eventually lead to a string that includes the same non-terminal again. Otherwise it is called anon-recursive grammar.[1]

For example, a grammar for acontext-free language isleft recursive if there exists a non-terminal symbolA that can be put through the production rules to produce a string withA (as the leftmost symbol).[2][3]All types of grammars in theChomsky hierarchy can be recursive and it is recursion that allows the production of infinite sets of words.[1]

Properties

[edit]

A non-recursive grammar can produce only a finite language; and each finite language can be produced by a non-recursive grammar.[1]For example, astraight-line grammar produces just a single word.

A recursive context-free grammar that contains nouseless rules necessarily produces an infinite language. This property forms the basis for analgorithm that can test efficiently whether a context-free grammar produces a finite or infinite language.[4]

References

[edit]
  1. ^abcNederhof, Mark-Jan; Satta, Giorgio (2002), "Parsing Non-recursive Context-free Grammars",Proceedings of the 40th Annual Meeting on Association for Computational Linguistics (ACL '02), Stroudsburg, PA, USA: Association for Computational Linguistics, pp. 112–119,doi:10.3115/1073083.1073104.
  2. ^Notes on Formal Language Theory and ParsingArchived 2017-08-28 at theWayback Machine, James Power, Department of Computer Science National University of Ireland, Maynooth Maynooth, Co. Kildare, Ireland.
  3. ^Moore, Robert C. (2000), "Removing Left Recursion from Context-free Grammars",Proceedings of the 1st North American Chapter of the Association for Computational Linguistics Conference (NAACL 2000), Stroudsburg, PA, USA: Association for Computational Linguistics, pp. 249–255.
  4. ^Fleck, Arthur Charles (2001),Formal Models of Computation: The Ultimate Limits of Computing, AMAST series in computing, vol. 7, World Scientific, Theorem 6.3.1, p. 309,ISBN 9789810245009.
Each category of languages, except those marked by a*, is aproper subset of the category directly above it.Any language in each category is generated by a grammar and by an automaton in the category in the same line.
P ≟ NP 

Thistheoretical computer science–related article is astub. You can help Wikipedia byadding missing information.

Retrieved from "https://en.wikipedia.org/w/index.php?title=Recursive_grammar&oldid=1306542400"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp