Talk:Unrestricted grammar
![]() | This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||
|
![]() | This article may be too technical for most readers to understand.(September 2010) |
Untitled
editI believe the following is incorrect. Can someone confirm?
is a set of production rules of the form where and are in
I say this because in this snippet:
If appears at some position on the second tape, replace by at that point, possibly shifting the symbols on the tape left or right depending on the relative lengths of and (e.g. if is longer than , shift the tape symbols left).
... it looks like and are sequences, so not in , but in the set of all finite sequences using letters from the alphabet (I'm not sure the best way to notate this, maybe something from Sequence_space)
Pchiusano 02:49, 26 July 2006 (UTC)
- Yes, you're right; someone must have written without really thinking. Ruakh 13:10, 26 July 2006 (UTC)
In the definition, I believe all the sets should be finite. I will change this soon unless I hear back otherwise. 129.15.139.171 (talk) 14:56, 27 March 2012 (UTC)
Terminals only on left hand side not always allowed
edit- Could you please provide the section number for this cite? I can only access editions 2 and 3.
- Chomsky's Axiom 2 ("A∈VN if and only if there are φ,ψ,ω such that φAψ → φωψ"[1]: 141 ) excludes, among others, production rules of the form a→ω, where a is a non-terminal.
Paradoctor (talk) 00:42, 13 September 2018 (UTC)
- @Paradoctor: (User name inferred from history page)
- In the 1979 edition, chapter 9 (p.217-233) is named "The Chomsky hierarchy", its section 9.2 (p.220-223) is named "Unrestricted grammars", its section 9.3 (p.223-226) "Context-sensitive languages". It seems that in the later editions, these sections were omitted. The initial paragraph of section 9.2 reads:
After that, an example grammar for follows; it actually uses only productions with nonterminals in the lhs. Then they construct in Thm. 9.3 a (nondeterministic) Turing machine for every unrestricted grammar, and in Thm. 9.4 an unrestricted grammar for every acceptor Turing machine. Again, the latter grammar has a nonterminal in each production's lhs. However, Thm 9.3 works also if no nonterminal is in a production's lhs. So, by applying Thm 9.3 and then 9.4, every unrestricted grammar can be transformed into a version having a nonterminal in each lhs.The largest family of grammars in the Chomsky hierarchy permits productions of the form , where and are arbitrary strings of grammar symbols, with . These grammars are known as semi-Thue, type 0, phrase structure or unrestricted grammars. We shall continue to use the 4-tuple notation for unrestricted grammars. We say whenever is a production. As before, stands for the reflexive and transitive closure of the relation : , exactly as for context-free grammars.
- Maybe, Hopcroft/Ullman's definition deviates from Chomsky's original version in his 1959 paper cited by you. However, in that paper " " (also called "can be rewritten as") corresponds to " " in Hopcroft/Ullman's book, while the finite pair set (also called "rules") from Ax.4 corresponds to H/U's . So it seems to me that in Ax.2 the "if" direction requires to stop further rewriting once all nonterminals have disappeared from the string (i.e. as long as there are nonterminals present in the string, terminal-only-lhs productions may well be applied to it). The "only if" direction seems to require that an applicable rule exists for every derivable string containing a nonterminal; e.g. the context-free grammar consisting of the single rule wouldn't be admitted by that, whereas today we'd consider it as valid, and producing the empty language. This indicates to me that some details of Chomsky's initial definition are no longer in force today. Another example is , contradicting Ax.1. - Jochen Burghardt (talk) 09:48, 13 September 2018 (UTC)
- (No need to ping, I'm watching) Sorry for the missing sig. Thanks for the quote. "Tbd"? Paradoctor (talk) 09:58, 13 September 2018 (UTC)
You need one non-terminal on the left hand side, otherwise you get pathological cases where the union of two grammars produces more than the union of their languages. E.g. G1=(S1->a,b->c), G2=(S2->b), G = G1 + G2 = (S->S1,S->S2,S1->a,S2->b,b->c). Here we have L1={a}, L2={b}, but L={a,b,c}. The German Wikipedia got that right, see: https://de.wiki.x.io/w/index.php?title=Chomsky-Hierarchie&oldid=229255677#Typ-0-Grammatik_(allgemeine_Chomsky-Grammatik_oder_Phrasenstrukturgrammatik) Andreasabel (talk) 16:28, 22 February 2023 (UTC)
- I agree that the usual construction of a grammar for the union language wouldn't work any longer. However, other union constructions would still work, e.g. convert G1 and G2 to Turing machines, convert them back to grammars (with a nonterminal in every LHS), then apply your construction to them. - Jochen Burghardt (talk) 18:40, 22 February 2023 (UTC)
Start a discussion about improving the Unrestricted grammar page
Talk pages are where people discuss how to make content on Wikipedia the best that it can be. You can use this page to start a discussion with others about how to improve the "Unrestricted grammar" page.