Ambiguous grammar
Builds on Context-free grammarContext-free languageRooted tree
Definition
Let be a context-free grammar. The grammar is ambiguous if some word has two different leftmost derivations from . Otherwise is unambiguous.
Remarks
Equivalently, is ambiguous if some word of has two different parse trees, since parse trees, which are rooted trees, correspond one-to-one to leftmost derivations. Example: the grammar with rules and is ambiguous. The word has the two leftmost derivations and . Non-example: the grammar with rules and is unambiguous. Every sentential form contains a single , and a word with letters forces uses of followed by one use of . A context-free language is inherently ambiguous if every context-free grammar that generates it is ambiguous; is such a language.
Reading path
To understand this page from the ground up, read these 4 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Context-free grammar concept
- Context-free language concept
- Rooted tree concept
- Ambiguous grammar definition
Further reading
About this page
| Tag | WEJJSM62WM |
|---|---|
| URI | m2://WEJJSM62WM |
| Kind | definition |
| Writing | W0 stub |
| MSC | 68Q42, 68Q45 |
| Defines | Ambiguous grammar |
| Uses | Context-free grammar, Context-free language, Rooted tree |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.