C-F languages (or see the following figure). In particular..it points out that the language {am,a"b" | m,n = N} is a deterministic C-F language, but not LL(k) for any k. Palindromes over {a, b} Non-deterministic C-F {am,a"b" | m.ne N}; Deterministic C-F {ab❘n EN} LL(K) Regular To show the language is not LL(k) for any k, note that a grammar for this language is SAB A -> B- or S-A|B A→ B (you only need to answer one case here, either one). The language contains A as an element. Now consider the case k = 1 and consider the input string ab. When the first symbol is scanned, we get an 'a'. This information alone is not enough for us to make a proper choice. So we don't even know what to do with the first step in | the parsing process. For k = 2, if we consider the input string aabb, we face the same problem. For any k > 2, the input string a*b* would cause exactly the same problem. So this grammar is not LL(k) for any k. On the other hand, by putting proper instructions into the blanks of the following figure, we get a deterministic final-state PDA that accepts the language {am anb m,n EN } a, x a, a push(a) push(a) start or a, x a.a push(a) push(a) start (again, you only need to answer one case here, either one). Hence, this language is indeed deterministic C-F, but not LL(k) for any k

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

could you fill in the blanks for me please I'm struggling

C-F languages (or see the following figure). In particular..it points out that the
language {am,a"b" | m,n = N} is a deterministic C-F language, but not LL(k) for
any k.
Palindromes over {a, b}
Non-deterministic C-F
{am,a"b" | m.ne N};
Deterministic C-F
{ab❘n EN}
LL(K)
Regular
To show the language is not LL(k) for any k, note that a grammar for this language is
SAB A ->
B-
or
S-A|B
A→
B
(you only need to answer one case here, either one). The language contains A as
an element. Now consider the case k = 1 and consider the input string ab. When
the first symbol is scanned, we get an 'a'. This information alone is not enough for
us to make a proper choice. So we don't even know what to do with the first step in |
the parsing process.
For k = 2, if we consider the input string aabb, we face the same problem. For any
k > 2, the input string a*b* would cause exactly the same problem. So this
grammar is not LL(k) for any k.
On the other hand, by putting proper instructions into the blanks of the following
figure, we get a deterministic final-state PDA that accepts the language
{am anb m,n EN }
Transcribed Image Text:C-F languages (or see the following figure). In particular..it points out that the language {am,a"b" | m,n = N} is a deterministic C-F language, but not LL(k) for any k. Palindromes over {a, b} Non-deterministic C-F {am,a"b" | m.ne N}; Deterministic C-F {ab❘n EN} LL(K) Regular To show the language is not LL(k) for any k, note that a grammar for this language is SAB A -> B- or S-A|B A→ B (you only need to answer one case here, either one). The language contains A as an element. Now consider the case k = 1 and consider the input string ab. When the first symbol is scanned, we get an 'a'. This information alone is not enough for us to make a proper choice. So we don't even know what to do with the first step in | the parsing process. For k = 2, if we consider the input string aabb, we face the same problem. For any k > 2, the input string a*b* would cause exactly the same problem. So this grammar is not LL(k) for any k. On the other hand, by putting proper instructions into the blanks of the following figure, we get a deterministic final-state PDA that accepts the language {am anb m,n EN }
a, x
a, a
push(a) push(a)
start
or
a, x
a.a
push(a) push(a)
start
(again, you only need to answer one case here, either one). Hence, this language
is indeed deterministic C-F, but not LL(k) for any k
Transcribed Image Text:a, x a, a push(a) push(a) start or a, x a.a push(a) push(a) start (again, you only need to answer one case here, either one). Hence, this language is indeed deterministic C-F, but not LL(k) for any k
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 1 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education