0% found this document useful (0 votes)
27 views7 pages

Lect - 5 - Ambiguity in Grammars and Languages

This lecture discusses ambiguity in grammars and languages, defining a grammar as ambiguous if it allows multiple derivations or parse trees for the same input string. Key topics include parse trees, their construction, and examples of ambiguous grammars. The lecture also includes homework assignments related to the topic.

Uploaded by

umarhadi10109
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)
27 views7 pages

Lect - 5 - Ambiguity in Grammars and Languages

This lecture discusses ambiguity in grammars and languages, defining a grammar as ambiguous if it allows multiple derivations or parse trees for the same input string. Key topics include parse trees, their construction, and examples of ambiguous grammars. The lecture also includes homework assignments related to the topic.

Uploaded by

umarhadi10109
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

Computation Theory

B.Sc./ 1st Semester

2024/2025
Lecture5 Title
Ambiguity in Grammars and Languages

Dr. Dhamyaa Nasrawi / University of Kerbala


By : @CSFilesBot - @WajibCS
Lecture 5: Ambiguity in Grammars and Languages Computation Theory II
Dhamyaa A. Nasrawi 2nd Stage
………………………………………………………………………………………………………………………

A grammar is said to be ambiguous if there exists more than one left most derivation
or more than one right most derivation or more than one parse tree for a given input
string.
………………………………………………………………………………………….
Outline of this lecture
• Parse Trees
• Constructing Parse Trees
• Ambiguous of Grammars
• Examples
………………………………………………………………………………………….
Parse Trees

Constructing Parse Trees

By : @CSFilesBot - @WajibCS
Lecture 5: Ambiguity in Grammars and Languages Computation Theory II
Dhamyaa A. Nasrawi 2nd Stage
………………………………………………………………………………………………………………………

Example:

Example: in the grammar

By : @CSFilesBot - @WajibCS
Lecture 5: Ambiguity in Grammars and Languages Computation Theory II
Dhamyaa A. Nasrawi 2nd Stage
………………………………………………………………………………………………………………………

Ambiguous of Grammars

By : @CSFilesBot - @WajibCS
Lecture 5: Ambiguity in Grammars and Languages Computation Theory II
Dhamyaa A. Nasrawi 2nd Stage
………………………………………………………………………………………………………………………

Example:

By : @CSFilesBot - @WajibCS
Lecture 5: Ambiguity in Grammars and Languages Computation Theory II
Dhamyaa A. Nasrawi 2nd Stage
………………………………………………………………………………………………………………………

Examples

By : @CSFilesBot - @WajibCS
Lecture 5: Ambiguity in Grammars and Languages Computation Theory II
Dhamyaa A. Nasrawi 2nd Stage
………………………………………………………………………………………………………………………

Homework:
1.

2.

By : @CSFilesBot - @WajibCS

You might also like