0% found this document useful (0 votes)
32 views2 pages

Assignment No

The document contains instructions for Assignment 2 for a student named Elaf Yousef Alyousef. It instructs the student to read questions carefully, answer clearly, submit both a soft copy to Blackboard and a hard copy to the instructor by the due date of October 14, 2021. The assignment contains two questions - the first asks the student to perform pairwise disjointness tests on three grammar rules, and the second asks the student to draw parse trees for three right sentential forms showing phrases, simple phrases, and handles.

Uploaded by

deftsoftp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

Assignment No

The document contains instructions for Assignment 2 for a student named Elaf Yousef Alyousef. It instructs the student to read questions carefully, answer clearly, submit both a soft copy to Blackboard and a hard copy to the instructor by the due date of October 14, 2021. The assignment contains two questions - the first asks the student to perform pairwise disjointness tests on three grammar rules, and the second asks the student to draw parse trees for three right sentential forms showing phrases, simple phrases, and handles.

Uploaded by

deftsoftp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Kingdom of Saudi Arabia ‫ال مملكة العـــــربية السعــودية‬

Al-Imam Muhammad Ibn Saud Islamic University ‫الـــتــعــلــي ــم الـــعــالـــــــــــــ ي‬

College of Shariah and Islamic Studies in Ahsa’a ‫جامعـة اإلمام محمد بن سعود اإلسالم ية‬
Department of Computer Science and Information ‫ الشريعة والدراسات اإلسالم ية‬: ‫كليـــة‬
Concepts of PL Assignment ‫ علوم الحاسب والمعلومات‬: ‫قســـم‬

Assignment No.2
Student Name: Elaf Yousef Alyousef Student Number: 441024035 4
Assignment no.2 Instructions:

1. Please read each question carefully before answering.


2. Please answer all questions very clear.
3. Assignment no.2 carries four marks only.
4. The last day of a submission for the assignment no.2: 14/10/2021-Thursday at 8:30 AM.
5. Please submit a soft copy to Blackboard & a hard copy to your instructor in the class.
Instructor Email: [email protected]
1. Perform the pairwise disjointness test for the following grammar rules.

a. A → aB | b | cBB disjoint. So, these rules pass the test

b. B → aB | bA | aBb not disjoint. So, these rules fail the test

c. C → aaA | b | caB disjoint. So, these rules pass the test

2. Given the following grammar and the right sentential form, draw a parse tree and show the
phrases and simple phrases, as well as the handle.
S → AbB | bAc
A → Ab | aBB
B → Ac | cBb | c
a. aAcccbbc
b. AbcaBccb
c. baBcBbbc
Solution for part a(
Phrases: aAcccbbc, aAcccb, Ac, ccb, c, c
Simple phrases: c
Handle: c

Solution for part b)

Phrases: AbcaBccb, caBccb, aBcc, aBc, c


Simple phrases: c
Handle: c

Solution for part c)

Phrases: baBcBbbc, aBcBbb, aBcBb, cBb


Simple phrases: cBb
Handle: cBb

You might also like