Language generated by a grammer

  • Thread starter Thread starter Movingon
  • Start date Start date
  • Tags Tags
    Language
AI Thread Summary
The discussion centers on determining the language generated by a given formal grammar without manually applying its rules. It highlights that while one can identify the language's position in the Chomsky hierarchy by inspecting the grammar's structure, obtaining a precise description often requires rule application. The example provided illustrates a specific grammar that generates the language L = {a^n b^{2n+m} | n ≥ 0, m ≥ 0}. Participants suggest that for more complex grammars, simply analyzing the form may not suffice to fully describe the generated language. Ultimately, the conversation emphasizes the challenges in accurately identifying a language from its grammar without extensive rule application.
Movingon
Messages
4
Reaction score
0
Ok I have a simple question. Let us say we have a formal grammar, let us take this simple example:

S → aSb
S → ab

This grammar generates language a^n b^n. My question is, is there a way I can tell what kind of language this generates from the rules? I can of course apply the rules and find out this grammar can generate such a language but sometimes we may have more complex examples containing more rules. So my questions is, how can we then find out exactly the kind of language generated by a given grammar without having to manually apply rules as this may not be always practical? Thanks in advance!
 
Technology news on Phys.org
"exactly the kind of language generated by a given grammar" is perhaps not precise enough to know exactly what kind of answer you want given any arbitrary grammar.

You can, by inspecting the form of the grammar and not manually applying the rules, probably determine which level of the Chomksy heirarchy the language resides in.

A few seconds of searching turns up one reasonable description of the heirarchy.
http://www.answers.com/topic/chomsky-hierarchy
There are many other well written descriptions of this out there.

If, as I suspect, you are looking for a more precise description of the language than this then I suspect the answer may be that you cannot determine this in every case by just inspecting the form of the grammar.
 
Thanks. Yeah what I meant was describing more precisely and formally a language generated by a certain grammar, the Chomsky hierarchy I already know of. For example, you are given a grammar as follows: G = ({S, X}, {a, b}, P, S) with the rules:
P = {S → aaSbb | X | ε, X → Xb | ε}.

where ε here stands for the empty string. You are asked to find out and describe formally the language generated by this grammar. As it turns out, this grammar generates language L = {a^n b^{2n+m} | n \geq 0, m \geq 0}

So my question is, how could I, for example, figure out that this grammar generates this language? Do I have to apply those rules and then from the result find out the kind of language generated? Is this the only way to find out a language L generated by grammar G?
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top