Einführung in die Computerlinguistik reguläre Sprachen und endliche Automaten

Ähnliche Dokumente
Einführung in die Computerlinguistik reguläre Sprachen und endliche Automaten

Einführung in die Computerlinguistik reguläre Sprachen und endliche Automaten

Einführung in die Computerlinguistik reguläre Sprachen und endliche Automaten

Automatentheorie und formale Sprachen reguläre Ausdrücke

Automatentheorie und formale Sprachen endliche Automaten

Einführung in die Computerlinguistik Satz von Kleene

Einführung in die Computerlinguistik Satz von Kleene

Automatentheorie und formale Sprachen rechtslineare Grammatiken

Automatentheorie und formale Sprachen Pumping-Lemma für reguläre Sprachen

Einführung in die Computerlinguistik formale Sprachen

Einführung in die Computerlinguistik formale Sprachen

Einführung in die Computerlinguistik formale Sprachen

Einführung in die Computerlinguistik formale Sprachen

Mathematische Grundlagen der Computerlinguistik formale Sprachen

Automatentheorie und Formale Sprachen

Automaten und formale Sprachen. Lösungen zu den Übungsblättern

Einführung in die Computerlinguistik

Computational Models

Einführung in die Computerlinguistik Satz von Kleene

Number of Maximal Partial Clones

Einführung in die Computerlinguistik Formale Grammatiken rechtslineare und kontextfreie Grammatiken Kellerautomaten

Einführung in die Computerlinguistik Satz von Kleene

Einführung in die Computerlinguistik Kontextfreie Grammatiken und. Kellerautomaten. Dozentin: Wiebke Petersen

Teil 2.2: Lernen formaler Sprachen: Hypothesenräume

Was bisher geschah. Modellierung von Aussagen durch Logiken. Modellierung von Daten durch Mengen

Formale Grundlagen der Wirtschaftsinformatik

Einführung in die Computerlinguistik. Chomskyhierarchie. Dozentin: Wiebke Petersen Wiebke Petersen Einführung CL (SoSe 2010) 1

A Classification of Partial Boolean Clones

Bayesian Networks. Syntax Semantics Parametrized Distributions Inference in Bayesian Networks. Exact Inference. Approximate Inference

Satz von Kleene. (Stephen C. Kleene, ) Wiebke Petersen Einführung CL 2

Reguläre Sprachen und endliche Automaten

Automatentheorie und formale Sprachen

Theorie der Informatik. Theorie der Informatik. 6.1 Einführung. 6.2 Alphabete und formale Sprachen. 6.3 Grammatiken. 6.4 Chomsky-Hierarchie

Willkommen zur Vorlesung Komplexitätstheorie

Grundlegende Parsingalgorithmen

Unterspezifikation in der Semantik Hole Semantics

Einführung in die Computerlinguistik

Unit 4. The Extension Principle. Fuzzy Logic I 123

Unit 1. Motivation and Basics of Classical Logic. Fuzzy Logic I 6

Finite Difference Method (FDM)

Automaten und Formale Sprachen Endliche Automaten und Reguläre sprachen

Reguläre Ausdrücke. Michael Jäger. 4. April 2017

Harry gefangen in der Zeit Begleitmaterialien

DIBELS TM. German Translations of Administration Directions

1 Eliminieren von ɛ-übergängen

Level 2 German, 2015

10. Linksassoziative Grammatik (LAG)

2. Gegeben sei folgender nichtdeterministischer endlicher Automat mit ɛ-übergängen:

Definition 4 (Operationen auf Sprachen) Beispiel 5. Seien A, B Σ zwei (formale) Sprachen. Konkatenation: AB = {uv ; u A, v B} A + = n 1 An

Logik für Informatiker Logic for computer scientists

2. Gegeben sei folgender nichtdeterministischer endlicher Automat mit ɛ-übergängen:

Weather forecast in Accra

Introduction FEM, 1D-Example

Theorie der Informatik

Stochastic Processes SS 2010 Prof. Anton Wakolbinger. Klausur am 16. Juli 2010

Wortstellung. Rule 1. The verb is the second unit of language in a sentence. The first unit of language in a sentence can be:

Magic Figures. We note that in the example magic square the numbers 1 9 are used. All three rows (columns) have equal sum, called the magic number.

Automatentheorie und formale Sprachen Entscheidbarkeitsprobleme endliche Transduktoren Komplexität natürlicher Sprachen

Formale Sprachen, Automaten, Compiler

Formale Methoden 1. Gerhard Jäger 16. Januar Uni Bielefeld, WS 2007/2008 1/19

A comparison of automata and tableau methods for modal satisfiability*

Willkommen zur Vorlesung Komplexitätstheorie

Tutoraufgabe 1 (ɛ-produktionen):

Lösungen zum Ergänzungsblatt 1

Willkommen zur Vorlesung Komplexitätstheorie

FEM Isoparametric Concept

Introduction FEM, 1D-Example

Offenes Lernen 1: Pflichtaufgaben

FEM Isoparametric Concept

Einführung in die Computerlinguistik Chomskyhierarchie

Ein Stern in dunkler Nacht Die schoensten Weihnachtsgeschichten. Click here if your download doesn"t start automatically

Einführung in die Computerlinguistik deterministische und nichtdeterministische endliche Automaten

Level 1 German, 2014

Einführung in die Computerlinguistik Chomskyhierarchie

ist ein regulärer Ausdruck.

Kapitel 0: Grundbegriffe Gliederung

Accelerating Information Technology Innovation

Allgemeine Mechanik Musterlösung 11.

Grundbegriffe der Informatik

Grundbegriffe der Informatik

Einführung in die Computerlinguistik Pumpinglemma für reguläre Sprachen. Suche mit regulären Ausdrücken. Dozentin: Wiebke Petersen 17.5.

Final Exam. Friday June 4, 2008, 12:30, Magnus-HS

Informatik II, SS 2018

Wie man heute die Liebe fürs Leben findet

Theoretische Informatik und Logik, VU 4.0 (Teil1: Berechenbarkeit, Formale Sprachen und Komplexitätstheorie)

Pascal Schärli

Prof. S. Krauter Kombinatorik. WS Blatt03.doc

Tube Analyzer LogViewer 2.3

Grundbegriffe der Informatik Tutorium 2

Schachaufgabe 37: Schachma in 2 Zügen Chess Problem 37: Checkmate in 2 Moves. Stufe / Level: 5

Der Earley-Algorithmus

Level 2 German, 2013

Algorithmic Bioinformatics III Graphs, Networks, and Systems SS2008 Ralf Zimmer

Der Earley-Algorithmus

Statistics, Data Analysis, and Simulation SS 2015

Transkript:

Einführung in die Computerlinguistik reguläre Sprachen und endliche Automaten Dozentin: Wiebke Petersen May 3, 2010 Wiebke Petersen Einführung CL (SoSe2010) 1

Operationen auf Sprachen Seien L Σ und K Σ zwei Sprachen über dem Alphabet Σ, dann entstehen durch die Verknüpfung mit Mengenoperatoren neue Sprachen über Σ: K L, K L, K \ L Die Verkettung von Wörtern kann ausgedehnt werden auf die Verkettung von Sprachen: K L := {v w Σ v K, w L} Beispiel: Sei K = {abb, a} und L = {bbb, ab} K L = {abbbbb, abbab, abbb, aab} und L K = {bbbabb, bbba, ababb, aba} K = K {ɛ} = K K 2 = K K = {abbabb, abba, aabb, aa} Wiebke Petersen Einführung CL (SoSe2010) 2

Formal language Denition Eine formale Sprache L ist eine Menge von Wörtern über einem Alphabet Σ, also L Σ. Denition Ein Wort ist eine endliche Kette/Folge x 1... x n von Symbolen/Zeichen eines Alphabets (n 0). Das Wort, das aus null Zeichen besteht heiÿt leeres Wort und wird mit ɛ bezeichnet. Denition Ein Alphabet Σ ist eine nichtleere endliche Menge von Symbolen / Zeichen. Wiebke Petersen Einführung CL (SoSe2010) 3

Describing formal languages by enumerating all words Peter says that Mary has fallen o the tree. Oskar says that Peter says that Mary has fallen o the tree. Lisa says that Oskar says that Peter says that Mary has fallen o the tree.... The set of strings of a natural language is innite. The enumeration does not gather generalizations. Wiebke Petersen Einführung CL (SoSe2010) 4

Describing formal languages by grammars Grammar A formal grammar is a generating device which can generate (and analyze) strings/words. Grammars are nite rule systems. The set of all strings generated by a grammar is the formal language generated by the grammar. S NP VP VP V NP D N D the N cat V sleeps Generates: the cat sleeps Wiebke Petersen Einführung CL (SoSe2010) 5

Describing formal languages by automata Automaton An automaton is a recognizing device which accepts strings/words. The set of all strings accepted by an automaton is the formal language accepted by the automaton. Wiebke Petersen Einführung CL (SoSe2010) 6

Sprachbeschreibung Zusammenhang nach Klabunde 1998 Formale Sprachen besitzen strukturelle Eigenschaften. Grammatiken sind Erzeugungssysteme für formale Sprachen. Automaten sind Erkennungssysteme für formale Sprachen. Vorsicht: per Denition besitzen formale Sprachen keine strukturellen Eigenschaften; uns interessieren aber nur solche mit strukturellen Eigenschaften, die von einer Grammatik erzeugt werden können. Auÿerdem können Grammatiken auch für die Analyse (Erkennung) formaler Sprachen und endliche Automaten für ihre Erzeugung genutzt werden. Wiebke Petersen Einführung CL (SoSe2010) 7

Regular expressions RE: syntax The set of regular expressions RE Σ over an alphabet Σ = {a 1,..., a n } is dened by: is a regular expression. ɛ is a regular expression. a 1,..., a n are regular expressions If a and b are regular expressions over Σ then (a + b) (a b) (a ) are regular expressions too. (The brackets are frequently omitted w.r.t. the following dominance scheme: dominates dominates +) Wiebke Petersen Einführung CL (SoSe2010) 8

Regular expressions RE: semantics Each regular expression r over an alphabet Σ describes a formal language L(r) Σ. Regular languages are those formal languages which can be described by a regular expression. The function L is dened inductively: L( ) =, L(ɛ) = {ɛ}, L(a i ) = {a i } L(a + b) = L(a) L(b) L(a b) = L(a) L(b) L(a ) = L(a) Wiebke Petersen Einführung CL (SoSe2010) 9

Aufgaben für Übungssitzung (1) Exercise 1 Find a regular expression which describes the regular language L (be careful: at least one language is not regular!) L is the language over the alphabet {a, b} with L = {aba, ɛ, aa, bbb}. L is the language over the alphabet {a, b} which consists of all words which start with a nonempty string of b's followed by at least one a followed by any number of b's L is the language over the alphabet {a, b} such that every a has a b immediately to its left. L is the language over the alphabet {a, b} which consists of all words which contain an uneven number of a's. L is the language of all palindromes over the alphabet {a, b}. Wiebke Petersen Einführung CL (SoSe2010) 10

Deterministic nite-state automaton (DFSA) Denition A deterministic nite-state automaton is a tuple Q, Σ, δ, q 0, F with: 1 a nite, non-empty set of states Q 2 an alphabet Σ with Q Σ = 3 a partial transition function δ : Q Σ Q 4 an initial state q 0 Q and 5 a set of nal/accept states F Q. accepts: L(a ba ) Wiebke Petersen Einführung CL (SoSe2010) 11

partial/total transition function FSA with complete transition function FSA with partial transition function accepts ab a accepts ab a transition table transition table Wiebke Petersen Einführung CL (SoSe2010) 12

Example DFSA / NFSA The language L(ab + ac ) is accepted by Wiebke Petersen Einführung CL (SoSe2010) 13

Nondeterministic nite-state automaton NFSA Denition A nondeterministic nite-state automaton is a tuple Q, Σ,, q 0, F with: 1 a nite non-empty set of states Q 2 an alphabet Σ with Q Σ = 3 a transition relation Q Σ Q 4 an initial state q 0 Q and 5 a set of nal states F Q. Theorem A language L can be accepted by a DFSA i L can be accepted by a NFSA. Note: Even automatons with ɛ-transitions accept the same languages like DFSA's. Wiebke Petersen Einführung CL (SoSe2010) 14

Automaton with ɛ-transition Wiebke Petersen Einführung CL (SoSe2010) 15

Aufgaben für Übungssitzung (2) Exercise 2 Give an FSA for each of the following languages over the alphabet {a, b} (and try to make it deterministic): L = {w between each two `a's in w there are at least three `b's} L = {w w is any word except bab} L = {w w does not contain the inx ab} L = {w w contains at most two `a's} L = {w w contains an uneven number of `a's} L((b a) ab ) L(a (ab) ) L(aa b). L((bb + ab a)) Wiebke Petersen Einführung CL (SoSe2010) 16

Hausaufgaben (Abgabe bis zum 6.5.2010; für den BN: 2 aus 5) Sei K = {aa, aaa, ba}, L = {bb, aa} 1 Geben sie die Sprachen L L, L K, {ɛ} L, {ɛ} und K an. 2 Geben sie die Sprache L 3 an. 3 Geben sie die Sprache L \ K an. 4 Geben sie eine implizite Mengendarstellung der Sprache K K an. 5 Wie unterscheiden sich die Sprachen L und L +? Wiebke Petersen Einführung CL (SoSe2010) 17