Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Samenvatting Hoofdstuk 5: Context-vrije Talen

Rating
-
Sold
-
Pages
7
Uploaded on
29-07-2022
Written in
2020/2021

Dit is de samenvatting van het vijfde hoofdstuk van het vak Automaten en Berekenbaarheid. In deze samenvatting werd alle relevante informatie uit de slides alsook uit eigen notities opgenomen. Eindresultaat: 16/20

Institution
Course

Content preview

Hoofdstuk 5: Context-vrije talen
1 Context-vrije grammatica’s
Grammatica = constructieve manier om een taal te beschrijven

Definitie:
Een grammatica 𝐺 = (𝑉, 𝑇, 𝑆, 𝑃) is context-vrij als alle productieregels van volgende vorm zijn

𝐴→𝑥
Met 𝐴 ∈ 𝑉 en 𝑥 ∈ (𝑉 ∪ 𝑇)∗

Opmerking: Elke reguliere grammatica is ook een context-vrije grammatica.

Definitie context-vrije taal:
Een taal L is context-vrij indien een context-vrije grammatica G bestaat waarvoor geldt dat L(G) = L.

Opmerking: dezelfde taal zal vaak ook kunnen voorgesteld worden door een grammatica die niet
context-vrij is. Dit betekent echter niet dat de taal niet context-vrij is!!




1.1 Bewijzen context-vrij
Bewijs dat 𝐿 = {𝑎𝑛 𝑏𝑚 : 𝑛 ≠ 𝑚} een context-vrije taal is.

• Stel 𝐿= = {𝑎𝑛 𝑏𝑚 : 𝑛 = 𝑚}. Van deze taal hebben we bewezen dat ze niet regulier is door
middel van de pompstelling.
• Stel 𝐿𝑟𝑎𝑛𝑑 = 𝑎∗ 𝑏 ∗ . Deze taal is regulier aangezien we ze voorstellen door middel van een
reguliere expressie.

Nu is 𝐿= = 𝐿𝑟𝑎𝑛𝑑 − 𝐿. We weten dat het verschil van 2 reguliere talen weer een reguliere taal is.
Maar we weten dat 𝐿= zeker niet regulier is en 𝐿𝑟𝑎𝑛𝑑 zeker wel dus kunnen we afleiden dat L niet
regulier is.



CV want regulier

CV want CV grammatica voor te vinden

Niet CV

CV want unie van 2 CV talen

CV want CV grammatica voor te vinden




1

, 1.2 Why care?
• Many concepts in programming languages require a context-free language. E.g., "correct
brackets”
• Syntax of (programming) languages often given as a context-free grammar(Backus–Naur
form (BNF))
• Implications on parsing, compiler design, ...

2 Derivations
In elke stap in een derivation moeten 2 keuzes gemaakt worden:

• Welke variabele gaan we vervangen?
o Heeft geen invloed op eindresultaat (CV!)
• Welke regel gaan we gebruiken om deze variabele mee te vervangen
o Kan aanleiding geven tot ambiguity
▪ ∃𝑤 ∈ 𝐿: ∃ 𝑣𝑒𝑟𝑠𝑐ℎ𝑖𝑙𝑙𝑒𝑛𝑑𝑒 𝑝𝑎𝑟𝑠𝑒 𝑡𝑟𝑒𝑒𝑠 𝑣𝑜𝑜𝑟 𝑤

2.1 Leftmost en rightmost derivations
Definitie leftmost derivation:
Een derivation is leftmost als in iedere stap steeds de meest linkse variabele in de sentential form
vervangen wordt.

Definitie rightmost derivation:
Een derivation is rightmost als in iedere stap steeds de meest rechtse variabele in de sentential form
vervangen wordt.




2.2 Derivation trees/parse trees




2

Connected book

Written for

Institution
Study
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
Chapter 5
Uploaded on
July 29, 2022
Number of pages
7
Written in
2020/2021
Type
SUMMARY

Subjects

$4.68
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
lennyS Vrije Universiteit Brussel
Follow You need to be logged in order to follow users or courses
Sold
166
Member since
6 year
Number of followers
62
Documents
34
Last sold
1 month ago

4.5

6 reviews

5
4
4
1
3
1
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions