Theory of Computer Science
- C1. Formal Languages and Grammars
Gabriele R¨
- ger
University of Basel
March 18, 2020
Gabriele R¨
- ger (University of Basel)
Theory of Computer Science March 18, 2020 1 / 24
Theory of Computer Science C1. Formal Languages and Grammars - - PowerPoint PPT Presentation
Theory of Computer Science C1. Formal Languages and Grammars Gabriele R oger University of Basel March 18, 2020 Gabriele R oger (University of Basel) Theory of Computer Science March 18, 2020 1 / 24 Theory of Computer Science March
University of Basel
Gabriele R¨
Theory of Computer Science March 18, 2020 1 / 24
March 18, 2020 — C1. Formal Languages and Grammars
Gabriele R¨
Theory of Computer Science March 18, 2020 2 / 24
Introduction
Gabriele R¨
Theory of Computer Science March 18, 2020 3 / 24
Introduction
Gabriele R¨
Theory of Computer Science March 18, 2020 4 / 24
Introduction
Gabriele R¨
Theory of Computer Science March 18, 2020 5 / 24
Introduction
Gabriele R¨
Theory of Computer Science March 18, 2020 6 / 24
Introduction
Gabriele R¨
Theory of Computer Science March 18, 2020 7 / 24
Alphabets and Formal Languages
Gabriele R¨
Theory of Computer Science March 18, 2020 8 / 24
Alphabets and Formal Languages
German: Alphabet, Zeichen/Symbole, leeres Wort, formale Sprache
Gabriele R¨
Theory of Computer Science March 18, 2020 9 / 24
Alphabets and Formal Languages
Gabriele R¨
Theory of Computer Science March 18, 2020 10 / 24
Grammars
Gabriele R¨
Theory of Computer Science March 18, 2020 11 / 24
Grammars
1 Σ finite alphabet of terminal symbols 2 V finite set of variables (nonterminal symbols)
3 P ⊆ (V ∪ Σ)+ × (V ∪ Σ)∗ finite set of rules (or productions) 4 S ∈ V start variable
German: Grammatik, Terminalalphabet, Variablen, Regeln/Produktionen, German: Startvariable
Gabriele R¨
Theory of Computer Science March 18, 2020 12 / 24
Grammars
Gabriele R¨
Theory of Computer Science March 18, 2020 13 / 24
Grammars
Gabriele R¨
Theory of Computer Science March 18, 2020 14 / 24
Grammars
1 u = xyz, v = xy′z with x, z ∈ (V ∪ Σ)∗ and 2 there is a rule y → y′ ∈ P.
German: Ableitung
Gabriele R¨
Theory of Computer Science March 18, 2020 15 / 24
Grammars
German: erzeugte Sprache
Gabriele R¨
Theory of Computer Science March 18, 2020 16 / 24
Grammars
Gabriele R¨
Theory of Computer Science March 18, 2020 17 / 24
Chomsky Hierarchy
Gabriele R¨
Theory of Computer Science March 18, 2020 18 / 24
Chomsky Hierarchy
German: Chomsky-Hierarchie, Typ 0, Typ 1 (kontextsensitiv), Typ 2 (kontextfrei), Typ 3 (regul¨ ar)
Gabriele R¨
Theory of Computer Science March 18, 2020 19 / 24
Chomsky Hierarchy
Gabriele R¨
Theory of Computer Science March 18, 2020 20 / 24
Chomsky Hierarchy
Gabriele R¨
Theory of Computer Science March 18, 2020 21 / 24
Chomsky Hierarchy
regular languages (type 3) context free languages (type 2) context sensitive languages (type 1) Type-0 languages All languages
Gabriele R¨
Theory of Computer Science March 18, 2020 22 / 24
Summary
Gabriele R¨
Theory of Computer Science March 18, 2020 23 / 24
Summary
Gabriele R¨
Theory of Computer Science March 18, 2020 24 / 24