Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi



Similar documents
Introduction to Automata Theory. Reading: Chapter 1

Regular Languages and Finite State Machines

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

Automata and Formal Languages

INTRODUCTORY SET THEORY

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

Discrete Mathematics

Mathematics Review for MS Finance Students

The Halting Problem is Undecidable

Reading 13 : Finite State Automata and Regular Expressions

Lecture 16 : Relations and Functions DRAFT

Introduction to Theory of Computation

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

Basic Concepts of Set Theory, Functions and Relations

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Introduction to Finite Automata

Section 1.4 Place Value Systems of Numeration in Other Bases

Compiler Construction

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Lecture 13 - Basic Number Theory.

Informatique Fondamentale IMA S8

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

How To Compare A Markov Algorithm To A Turing Machine

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Complexity Classes P and NP

Regular Expressions and Automata using Haskell

Cartesian Products and Relations

T Reactive Systems: Introduction and Finite State Automata

Regular Languages and Finite Automata

Two Way F finite Automata and Three Ways to Solve Them

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

MACM 101 Discrete Mathematics I

The Classes P and NP

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Scanner. tokens scanner parser IR. source code. errors

CODING TRUE ARITHMETIC IN THE MEDVEDEV AND MUCHNIK DEGREES

MA651 Topology. Lecture 6. Separation Axioms.

03 - Lexical Analysis

Finite Automata. Reading: Chapter 2

Automata on Infinite Words and Trees

Vocabulary Words and Definitions for Algebra

CPSC 121: Models of Computation Assignment #4, due Wednesday, July 22nd, 2009 at 14:00

Algorithmic Software Verification

THE LANGUAGE OF SETS AND SET NOTATION

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

6.080/6.089 GITCS Feb 12, Lecture 3

A Little Set Theory (Never Hurt Anybody)

C H A P T E R Regular Expressions regular expression

NP-Completeness and Cook s Theorem

To define function and introduce operations on the set of functions. To investigate which of the field properties hold in the set of functions

You know from calculus that functions play a fundamental role in mathematics.

Software Engineering

Chapter 2: Basics on computers and digital information coding. A.A Information Technology and Arts Organizations

1 Sets and Set Notation.

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

FIBER PRODUCTS AND ZARISKI SHEAVES

Lecture I FINITE AUTOMATA

Applies to Version 6 Release 5 X12.6 Application Control Structure

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Deterministic Finite Automata

Computability Theory

Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008.

Logic in Computer Science: Logic Gates

Finite Automata. Reading: Chapter 2

24 Uses of Turing Machines

Lecture 2: Universality

SIMPLIFYING ALGEBRAIC FRACTIONS

Testing LTL Formula Translation into Büchi Automata

Section Composite and Inverse Functions

Lecture 2: Regular Languages [Fa 14]

Symbol Tables. Introduction

3515ICT Theory of Computation Turing Machines

Representing Reversible Cellular Automata with Reversible Block Cellular Automata

LEARNING OBJECTIVES FOR THIS CHAPTER

Notes on Complexity Theory Last updated: August, Lecture 1

The Model Checker SPIN

Finite Automata and Formal Languages

So let us begin our quest to find the holy grail of real analysis.

Turing Machines: An Introduction

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

The Set Data Model CHAPTER What This Chapter Is About

Informatica e Sistemi in Tempo Reale

Semantics of UML class diagrams

Programming Languages CIS 443

Lexical analysis FORMAL LANGUAGES AND COMPILERS. Floriano Scioscia. Formal Languages and Compilers A.Y. 2015/2016

Mathematics for Algorithm and System Analysis

Chapter 7 Uncomputability

Notes on Richard Dedekind s Was sind und was sollen die Zahlen?

Monitoring Metric First-order Temporal Properties

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

Math Week in Review #4. A proposition, or statement, is a declarative sentence that can be classified as either true or false, but not both.

Transcription:

Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the boundary between what a computing machine could do and what it could not do. 1

Finite Automata Studied 40 s and 50 s Originally proposed to model brain function Turned out to be useful for other purposes 2

What is finite automata for? Designing and checking the behavior of digital circuits Lexical analyzer of a typical compiler, that is, compiler component that breaks the input text into logical units Scanning large bodies of text Verifying systems of all types that have a finite number of distinct states Etc. 3

Simplest nontrivial finite automaton remembering whether it is in the on state or the off state 4

Automaton recognizing then 5

Why study Automata theory? What can a computer do at all? This study is called decidability and the problems that can be solved by computer are called decidable. (chapter 9) What can computer do efficiently? This study is called intractability, and the problems that can be solved by a computer using no more time than some slowly growing function (polynomial) of the size of the input are called tractable. 6

Review of Basics Sets Definition A set is an unordered collection of objects S = {a, b, c} a, b, c are elements or members of the set S 7

Sets Definition A set is an unordered collection of objects S = {a, b, c} a, b, c are elements or members of the set S Elements in a set need have no relation to each other S1 = {1, 2, 3} S2 = { red, farmhouse, π, -32 } 8

Sets Definition Sets can contain other sets as elements S1 = {3, {3, 4}, {4, {5, 6}}} S2 = {{1, 2}, {{4}}} Sets do not contain duplicates NotASet = {4, 2, 4, 5} 9

Sets Cardinality Cardinality of a set is the number of elements in the set {a, b, c} = 3 {{a, b}, c} =? 10

Sets Cardinality Cardinality of a set is the number of elements in the set {a, b, c} = 3 {{a, b}, c} = 2 ({a, b} and c) 11

Sets Empty, Singleton Empty Set: {} or Ø, {} = Ø = 0 Singleton set set with one element {1} {4} {}? {{}}? {{3, 1, 2}}? 12

Sets Empty, Singleton Empty Set: {} or Ø, {} = Ø = 0 Singleton set set with one element {1} {4} {} NO! Set contains 0 elements {{}} {{3, 1, 2}} 13

Sets Membership Set membership: x S 3 {1, 3, 5} a {b, c, d} 3 {1, {2, 3}}? {} {1, 2, 3}? {} {1, {}, 4}? 14

Sets Membership Set membership: x S 3 {1, 3, 5} a {b, c, d} 3 {1, {2, 3}} {} {1, 2, 3} {} {1, {}, 4}? 15

Sets Describing S = {x : x has a certain property} S = {x x has a certain property} S = {x : x N x < 10} N is the set of natural numbers {0, 1, 2,... } S = {x : x is prime } A B = {x : x A x B} A B = {x : x A x B} A B = {x : x A x B} 16

S = {0 n 1 n n 1} S = {01, 0011, 000111,.} T = {0 i 1 j 0 i j } T = {1,11,,01,011,,0011,00111, } 17

Sets, More Union & Intersection A and B are disjoint if A B = {} S is a collection of sets (set of sets) S = {x : x A for some A S} {{1, 2}, {2, 3}} = {1, 2, 3} S = {x : x A for all A S} {{1, 2}, {2, 3}} = {2} 18

Sets Subset Subsets & Supersets A is a subset of B, A B if: x, x A x B (x A), x B A is a proper subset of B, A B if: A B ( x, x B x A) {} is a subset of any set (including itself) {} is the only set that does not have a proper subset 19

Sets Power Set Power set: Set of all subsets 2 S = {x : x S} 2 {a,b} = {{}, {a}, {b}, {a, b}} 2 {} = {{}} 2 S =? (cardinality?) 2 S = 2 S 20

Cartesian Product A B = {(x, y) : x A y B} {1, 2} {3, 4} = {(1, 3), (1, 4), (2, 3), (2, 4)} {1, 2} {1, 2} = {(1, 1), (1, 2), (2, 1), (2, 2)} 2 {a} {b} = {{(a, b)}, {}} 2 {a} 2 {b} = {({a}, {b}), ({a}, {}), ({}, {b}), ({}, {})} 21

Cartesian Product Which of the following is true: (A,B) A B = B A If and only if A = B (A,B) A B B A If and only if A B 22

Relations A relation R is a set of ordered pairs For example the relation < over the Natural Numbers is the set: { (0,1), (0,2), (0,3),... (1,2), (1,3), (1,4),... (2,3), (2,4), (2,5),...... } Often, relations are over the same set that is, a subset of A A for some set A Not all relations are over the same set, however Relation describing prices of computer components {(Hard dive, $55), (WAP, $49), (256M DDR, $44),...} 23

Functions A function is a special kind of relation (all functions are relations, but not all relations are functions) A relation R A B is a function if: For each a A, there is exactly one ordered pair in R with the first component a A function f that is a subset of A B is written: f : A B (a, b) f is written f(a) = b A is the domain of the function if A A, f(a ) = {b : a A f(a) = b} is the image of A The range of a function is the image of its domain 24

A function f : A B is: Functions one-to-one if no two elements in A match to the same element in B onto Each element in B is mapped to by at least one element in A a bijection if it is both one-to-one and onto The inverse of a binary relation R A B is denoted R 1, and defined to be {(b, a) : (a, b) R} A function only has an inverse if it is a bijection 25

Structural representations Grammars (will be discussed in ch5) E E + E an expression can be formed by taking any two expressions and connecting them by a plus sign Regular Expressions [A-Z][a-z]*[ ][A-Z][A-Z] Matches Ankara TR but misses Palo Alto CA ([A-Z][a-z]*[ ])*[ ][A-Z][A-Z] Now matches with Palo Alto CA 26

Central Concepts of Automata Theory Alphabet: finite, non empty set of symbols Strings: list of symbols from the alphabet Language: a set of strings from the same alphabet. 27

Alphabets Conventionally denoted by Σ Examples of common alphabets: 1. Σ = {0,1}, the binary alphabet 2. Σ = {a, b, c,.,z}, the set of all lower-case letters 3. The set of ASCII characters 28

Strings A string (or word) is a finite sequence of symbols chosen from some alphabet. 00110101 from binary alphabet Σ={0,1} The empty string is the string with zero occurrences of symbols. Denoted by ε. The number of positions for symbols (ie, number of symbols) in the strings is called the length of the string. 00110101 has length 8. The standard notation for the length of a string ω is ω. 00110101 = 8 ε = 0 29

Powers of an alphabet If Σ is an alphabet, we define Σ k to be the set of strings of length k, each of those symbols in Σ. Examples: Σ 0 = {ε} for all alphabets If Σ = {0,1} Σ 1 = {0,1} Σ 2 = {00,01,10,11} Σ 3 = {000,001,010,011,100,101,110,111} 30

Σ* denotes set of all strings over an alphabet Σ. Σ* = Σ 0 Σ 1 Σ 2 Σ 3. Σ + = Σ 1 Σ 2 Σ 3. Same as previous one but without empty string. Σ* = Σ 0 Σ + 31

Type convention for symbols and strings We shall use lower case letters at the beginning of the alphabet to denote symbols a, b, c, a 1, a 2, c 3, lower case letters at the end of the alphabet to denote strings x, y, z 32

Concatanation of strings Let x and y be strings. Then xy denotes the concatanation of x and y. Example: let x = 01011 and y = 011. Then xy = 01011011 33

Languages A set of strings all of which are chosen from some Σ*, where Σ is a particular alphabet, is called language. If Σ is an alphabet, and L Σ*, then L is language over Σ. 34

Language examples Turkish C The language of all strings consisting of n 0 s followed by n 1 s, for some n 0: {ε, 01, 0011, 000111, 00001111, } The set of binary numbers whose value is a prime {10,11,101,111,1011, } Σ* (set of all strings), the empty language, is a language over any alphabet {ε}, the language consisting of only the empty string,is also a language over any alphabet. 35

Problems In Automata theory, a problem is the question of deciding whether a given string is a member of some particular language. If Σ is an alphabet, and L ( Σ*) is a language over Σ, then the problem is: Given a sting ω in Σ*, decide whether or not ω is in L. 36

Prime numbers example The problem of testing primality can be reduced to a problem of testing whether the given number is a member of L p (language of prime numbers) or not. 37

Definition of problems as languages We are interested in proving lower bounds on the complexity of certain problems. Especially important are techniques for proving that certain problems cannot be solved in an amount of time that is less than exponential in the size of the input. 38