formal-languages

Is L = {a^n b^m | n>m} a regular or irregular language?

浪尽此生 提交于 2019-11-28 11:25:27
I have troubles in solving/proving this problem. Any ideas please? Grijesh Chauhan L = {a n b m | n > m} is not regular language. Yes, the problem is tricky at first few try and deserve vote-up. Pumping Lemma a necessary property of regular language is tool for formal proof that language is not regular language. Formal definition: Pumping lemma for regular languages Let L be a regular language. Then there exists an integer p ≥ 1 depending only on L such that every string w in L of length at least p ( p is called the "pumping length") can be written as w = xyz (i.e., w can be divided into three

To make sure: Pumping lemma for infinite regular languages only?

為{幸葍}努か 提交于 2019-11-28 09:22:25
So this is not about the pumping lemma and how it works, it's about a pre-condition. Everywhere in the net you can read, that regular languages must pass the pumping lemma, but noweher anybody talks about finite languages, which actually are a part of regular languages. So we might all aggree, that the following language is a finite language as well as it's a regular one, but it definitely does not pass the pumping lemma: L = {'abc', 'defghi'} Please, tell me if simply no one writes about it or why we're wrong - or even not. The reason that finite languages work with the pumping lemma is

What is a regular language?

試著忘記壹切 提交于 2019-11-27 16:43:38
I'm trying to understand the concept of languages levels (regular, context free, context sensitive, etc.). I can look this up easily, but all explanations I find are a load of symbols and talk about sets . I have two questions: Can you describe in words what a regular language is, and how the languages differ? Where do people learn to understand this stuff? As I understand it, it is formal mathematics? I had a couple of courses at uni which used it and barely anyone understood it as the tutors just assumed we knew it. Where can I learn it and why are people "expected" to know it in so many

What kind of formal languages can modern regex engines parse?

淺唱寂寞╮ 提交于 2019-11-27 07:06:27
Here on SO people sometimes say something like "you cannot parse X with regular expressions, because X is not a regular language". From my understanding however, modern regular expressions engines can match more than just regular languages in Chomsky's sense . My questions: given a regular expression engine that supports backreferences lookaround assertions of unlimited width recursion, like (?R) what kind of languages can it parse? Can it parse any context-free language, and if not, what would be the counterexample? (To be precise, by "parse" I mean "build a single regular expression that

What is a regular language?

社会主义新天地 提交于 2019-11-27 04:09:07
问题 I'm trying to understand the concept of languages levels (regular, context free, context sensitive, etc.). I can look this up easily, but all explanations I find are a load of symbols and talk about sets . I have two questions: Can you describe in words what a regular language is, and how the languages differ? Where do people learn to understand this stuff? As I understand it, it is formal mathematics? I had a couple of courses at uni which used it and barely anyone understood it as the

To make sure: Pumping lemma for infinite regular languages only?

梦想的初衷 提交于 2019-11-27 02:50:37
问题 So this is not about the pumping lemma and how it works, it's about a pre-condition. Everywhere in the net you can read, that regular languages must pass the pumping lemma, but noweher anybody talks about finite languages, which actually are a part of regular languages. So we might all aggree, that the following language is a finite language as well as it's a regular one, but it definitely does not pass the pumping lemma: L = {'abc', 'defghi'} Please, tell me if simply no one writes about it

Tips for creating “Context Free Grammar”

荒凉一梦 提交于 2019-11-27 00:29:01
I am new to CFG's, Can someone give me tips in creating CFG that generates some language For example L = {a m b n | m >= n} What I got is: S o -> a | aS o | aS 1 | e S 1 -> b | bS 1 | e but I think this area is wrong, because there is a chance that the number of b 's can be greater than a 's. Grijesh Chauhan How to write CFG with example a m b n L = {a m b n | m >= n}. Language description: a m b n consist of a followed by b where number of a are equal or more then number of b . some example strings: {^, a, aa, aab, aabb, aaaab, ab......} So there is always one a for one b but extra a are

Left-Linear and Right-Linear Grammars

南楼画角 提交于 2019-11-26 14:14:35
I need help with constructing a left-linear and right-linear grammar for the languages below? a) (0+1)*00(0+1)* b) 0*(1(0+1))* c) (((01+10)*11)*00)* For a) I have the following: Left-linear S --> B00 | S11 B --> B0|B1|011 Right-linear S --> 00B | 11S B --> 0B|1B|0|1 Is this correct? I need help with b & c. Constructing an equivalent Regular Grammar from a Regular Expression First, I start with some simple rules to construct Regular Grammar(RG) from Regular Expression(RE). I am writing rules for Right Linear Grammar (leaving as an exercise to write similar rules for Left Linear Grammar) NOTE:

What kind of formal languages can modern regex engines parse?

只愿长相守 提交于 2019-11-26 13:03:36
问题 Here on SO people sometimes say something like \"you cannot parse X with regular expressions, because X is not a regular language\". From my understanding however, modern regular expressions engines can match more than just regular languages in Chomsky\'s sense. My questions: given a regular expression engine that supports backreferences lookaround assertions of unlimited width recursion, like (?R) what kind of languages can it parse? Can it parse any context-free language, and if not, what

Left-Linear and Right-Linear Grammars

天涯浪子 提交于 2019-11-26 03:49:27
问题 I need help with constructing a left-linear and right-linear grammar for the languages below? a) (0+1)*00(0+1)* b) 0*(1(0+1))* c) (((01+10)*11)*00)* For a) I have the following: Left-linear S --> B00 | S11 B --> B0|B1|011 Right-linear S --> 00B | 11S B --> 0B|1B|0|1 Is this correct? I need help with b & c. 回答1: Constructing an equivalent Regular Grammar from a Regular Expression First, I start with some simple rules to construct Regular Grammar(RG) from Regular Expression(RE). I am writing