1,554 views

1 Answer

2 votes
2 votes

A viable prefix of a sentential form φβt, where β denotes the handle, is any prefix of φβ. A viable prefix cannot contain symbols to the right of the handle.

(source: https://nptel.ac.in/courses/106108113/module3/Lecture9.pdf )

Example:

S → E#,

E → E + T | E − T | T,

T → id | (E)

Now,

S ⇒ E#E + T # ⇒ E + (E)# ⇒ E + (T)# ⇒ E + (id)#

(bold and underlined are the handles for that right sentential form)

And,

all viable prefixes of the right sentential form E + (id)# :

E, E+, E + (, and E + (id

as ' id ' is the handle of this sentential form so we cant take any other symbol in its right( for viable prefix)

--------------------------------------------

So,

E + (id)# is a right sentential form

id is its handle and,

E, E+, E + (, and E + (id  are its Viable prefixes.

Related questions

5 votes
5 votes
1 answer
1
Vijay Thakur asked Jan 13, 2017
1,314 views
Consider the following grammar:$S\rightarrow0S1 | 01$How many of the following are the viable prefixes of the grammar?i. 01 ii. 001iii. 00011iv. 00S1PS: given answers ...
2 votes
2 votes
3 answers
2
2 votes
2 votes
1 answer
4