Questions tagged [chomsky-hierarchy]

The Chomsky hierarchy is a containment hierarchy of classes of formal grammars.

Within the field of computer science, specifically in the area of formal languages, the Chomsky hierarchy (occasionally referred to as Chomsky-Schützenberger hierarchy) is a containment hierarchy of classes of formal grammars. This hierarchy of grammars was described by Noam Chomsky in 1956.1 It is also named after Marcel-Paul Schützenberger, who played a crucial role in the development of the theory of formal languages. The Chomsky Hierarchy, in essence, allows the possibility for the understanding and use of a computer science model which enables a programmer to accomplish meaningful linguistic goals systematically. wikipedia

40 questions
1
vote
1 answer

Pumping Lemma and Hierachy

I have a question involving the Pumping Lemma for Regular Languages and Pumping Lemma for Context-free Languages: Is it possible that there's a language which doesn't meet the criteria for the pumping-lemma for context-free languages but does meet…
1
vote
2 answers

If L and L complement are Recursively enumerable then why can't L be a Regular language?

Below question was asked in GATE 2008 paper : If L and L' (L complement) are Recursively enumerable then L is ? a) Regular b) CFL c) CSL d) Recursive Correct option was option (d) and I accept that it's true. But my question is why can't it be…
1
vote
1 answer

Is L = {a^mb^nc^k | if (m=n) then (n=k) } CFL or not?

I see that in this language , by the time we are deciding m=n; then we have no b's left; so we can't sompare them with c's.So, i think it should NOT be CFL. But below solution shows that it is CFL In the above given solution, is L2 CFL correct ?
1
vote
1 answer

Chomsky Hierarchy: LR(k) grammars vs Deterministic CFGs?

We are learning the chomsky hiearchy in my introduction to computer science course. My professor has mention lrk grammars multiple times, but they're not taught in the book. From my understanding, they are a subset of deterministic context free…
1
vote
1 answer

recognise max type of formal language

Currently I´m trying to learn and understand formal languages and grammatics. I understand the Chomsky hierarchy but I found an task where I don´t know how they got the solution. The task is: G=({S},{a,b},S,P) P={S->epsilon, S->aS, S->Sb} What is…
1
vote
1 answer

Chomsky hierarchy - Type-1 context-sensitive languages

I try to unterstand the Chomsky hierarchy with the different levels. I checked some examples and here is one I don't really understand. Maybe someone knows why this one is not a context-sensitive language: S → aA A → aA | ε B → bA
1
vote
1 answer

Chomsky languages: how to recognize them?

I have a problem with the recognition of languages. Given a certain language, for example ancb2n, n > 0, how do I determine quickly what type belongs according Chomsky? My idea was to determine the grammar that generates it and then up to the…
1
vote
2 answers

What is this? Looking for the correct terminology what is going on here

Looking at the following grammar which has an obvious flaw as far as parser generators are concerned: "Start Symbol" = "Case Sensitive" = True "Character Mapping" = 'Unicode' {A} = {Digit} {B} = [abcdefABCDEF] {C} = {A} + {B} Integer =…
BitTickler
  • 10,905
  • 5
  • 32
  • 53
1
vote
1 answer

Chomsky Hierarchy Type 2: Not terminal symbols on left hand site

is it allowed to make two non terminal symbols on the left handed side of a grammatic in type 2 grammatic? I should define a Type 2 grammatic for the Language L2. It was easy if it is allowed to do a rule like CB->BC but I'm not sure if this would…
stackiflow111
  • 155
  • 1
  • 9
1
vote
1 answer

Context-sensitive grammar

I'm looking for a context-sensitive grammar that describes the following language: L = { ww | w ∈ {a,b}*, |w| ≥ 1}
I've got problems with the fact that no rules such as X -> ε are allowed and therefore I can't place any nonterminal indicating…
1
vote
1 answer

Converting a language specification into production rules (not sure if it's a CFG or CSG)

I have to write a function that checks whether input strings are valid for a given language specification. I thought that this would be a standard CFG -> Chomsky Normal Form, then CYK parsing, but one of the rules in the language is preventing this…
0
votes
0 answers

languages, pumping-lemma and myhill-nerode-equivalence-classes

Is it possible that a context-free-language has infinite myhill-nerode-classes or is there a way to narrow down (in terms of chomsky hierachy) which kind of classes can or can't have infinite myhill-nerode-classes? I have a problem where I should…
0
votes
1 answer

What is the point of the 4 grammars specified in Chomsky hierarchy?

I'm currently studying compiler's and am on the topic of "Chomsky Hierarchy and the 4 languages." But it beats me as to what the practical purpose of all this is? It'd be great if I could see real-life examples of the 4 grammars: Unrestricted, CSG,…
0
votes
1 answer

Stochastic context-free grammars to Chomsky normal form

I actually don't understand how to convert scfg to cnf. I know just how to convert cfg. What should I do with probabilities? Example: S->c W1 g:0.9|c W:0.1 W1->g W2 u:0.8|W2 u:0.2 W2->g W3 c:0.6|a W3 u:0.4 W3->g W4 c:0.5|W4 c:0.5 W4->a W5:0.7|c…
0
votes
1 answer

How can one define a language which does not fit in the Chomsky Hierarchy?

I'm asking this question because I've stumbled across the accepted answer of Chomsky Language Types This quote is referring to Type-0 Grammars: This means that if you have a language that is more expressive than this type (e.g. English), you cannot…
Novicegrammer
  • 222
  • 1
  • 9