automata-theory

Finiteness of Regular Language

和自甴很熟 提交于 2019-12-28 06:27:42
问题 We all know that (a + b)* is a regular language for containing only symbols a and b . But (a + b)* is a string of infinite length and it is regular as we can build a finite automata, so it should be finite. Can anyone please explain this? 回答1: Finite automaton can be constructed for any regular language, and regular language can be a finite or an infinite set. Of-course there are infinite sets those are not regular sets. Check the Venn diagram below: Notes : 1. every finite set is a regular

LR(1) - Items, Look Ahead

女生的网名这么多〃 提交于 2019-12-10 13:39:08
问题 I am having difficulties understanding the principle of lookahead in LR(1) - items. How do I compute the lookahead sets? Say for an example that I have the following grammar: S -> AB A -> aAb | b B -> d Then the first state will look like this: S -> .AB , {look ahead} A -> .aAb, {look ahead} A -> .b, {look ahead} I know what look aheads are, but I don't know how to compute them. I have googled for answers but couldn't find a webpage which explains this in a simple manner. Thanks in advance

Construct Context free Grammar

大兔子大兔子 提交于 2019-12-10 10:51:23
问题 How can I construct a context free grammar for the following language: L = {a^l b^m c^n d^p | l+n==m+p; l,m,n,p >=1} I started by attempting: S -> abcd | aAbBcd | abcCdD | aAbcdD | AabBcCd and then A = something else... but I couldn't get this working. . I was wondering how can we remember how many c's shud be increased for the no. of b's increased? For example: string : abbccd 回答1: The grammar is : S1 -> a S1 d | S2 S2 -> S3 S4 S3 -> a S3 b | epsilon S4 -> S5 S6 S5 -> b S5 c | epsilon S6 ->

Construct Context free Grammar

大兔子大兔子 提交于 2019-12-06 04:42:16
How can I construct a context free grammar for the following language: L = {a^l b^m c^n d^p | l+n==m+p; l,m,n,p >=1} I started by attempting: S -> abcd | aAbBcd | abcCdD | aAbcdD | AabBcCd and then A = something else... but I couldn't get this working. . I was wondering how can we remember how many c's shud be increased for the no. of b's increased? For example: string : abbccd The grammar is : S1 -> a S1 d | S2 S2 -> S3 S4 S3 -> a S3 b | epsilon S4 -> S5 S6 S5 -> b S5 c | epsilon S6 -> c S6 d | epsilon Rule 1 adds equal number of a's and d's. Rule 3 adds equal number of a's and b's. Rule 5

How can one simulate nondeterministic finite transducers?

时间秒杀一切 提交于 2019-12-01 06:28:44
A nondeterministic automaton can be simulated easily on an input string by just keeping track of the states the automaton is in, and how far in the input string it has gotten. But how can a nondeterministic transducer (a transducer, of course, can translate input symbols to output symbols, and give as output a string, not just a boolean value) be simulated? It seems that this is more complicated, since we need to keep track, somehow, of the output strings, which can be numerous because of the nondeterminism. First of all, some theory. The following are distinct algebraic structures: generators

How can one simulate nondeterministic finite transducers?

戏子无情 提交于 2019-12-01 04:56:40
问题 A nondeterministic automaton can be simulated easily on an input string by just keeping track of the states the automaton is in, and how far in the input string it has gotten. But how can a nondeterministic transducer (a transducer, of course, can translate input symbols to output symbols, and give as output a string, not just a boolean value) be simulated? It seems that this is more complicated, since we need to keep track, somehow, of the output strings, which can be numerous because of the