YES-NO machines Finite State Automata as language recognizers.

Slides:



Advertisements
Similar presentations
Formal Languages Languages: English, Spanish,... PASCAL, C,... Problem: How do we define a language? i.e. what sentences belong to a language? e.g.Large.
Advertisements

1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
CS5371 Theory of Computation
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
1 Languages and Finite Automata or how to talk to machines...

Fall 2005 CSE 467/567 1 Formal languages regular expressions regular languages finite state machines.
Finite state automaton (FSA)
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
1 Finite state automaton (FSA) LING 570 Fei Xia Week 2: 10/07/09 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Topics Automata Theory Grammars and Languages Complexities
CPSC 388 – Compiler Design and Construction
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Regular Expressions (RE) Empty set Φ A RE denotes the empty set Empty string λ A RE denotes the set {λ} Symbol a A RE denotes the set {a} Alternation M.
Finite-State Machines with No Output
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 2 Languages.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Introduction to Theory of Automata
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Lecture # 3 Chapter #3: Lexical Analysis. Role of Lexical Analyzer It is the first phase of compiler Its main task is to read the input characters and.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2006.
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: 
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
Overview of Previous Lesson(s) Over View  Symbol tables are data structures that are used by compilers to hold information about source-program constructs.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Modeling Computation: Finite State Machines without Output
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
Akram Salah ISSR Basic Concepts Languages Grammar Automata (Automaton)
  An alphabet is any finite set of symbols.  Examples: ASCII, Unicode, {0,1} ( binary alphabet ), {a,b,c}. Alphabets.
Costas Busch - LSU1 Deterministic Finite Automata And Regular Languages.
Theory of Languages and Automata By: Mojtaba Khezrian.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
Lecture Three: Finite Automata Finite Automata, Lecture 3, slide 1 Amjad Ali.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
Nondeterminism The Chinese University of Hong Kong Fall 2011
Languages.
Lecture2 Regular Language
CIS Automata and Formal Languages – Pei Wang
Theory of Computation Lecture # 9-10.
Push-down Automata Section 3.3 Wed, Oct 27, 2004.
Push-down Automata.
Deterministic Finite Automata
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Principles of Computing – UFCFA3-30-1
COSC 3340: Introduction to Theory of Computation
Chapter Five: Nondeterministic Finite Automata
Deterministic Finite Automaton (DFA)
CSC 4170 Theory of Computation Finite Automata Section 1.1.
CSC312 Automata Theory Lecture # 2 Languages.
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: ={0,1},
Languages Fall 2018.
What is it? The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled.
Presentation transcript:

YES-NO machines Finite State Automata as language recognizers

A YES-NO machine 0123 a abb Designed to recognize a specific language final state A YES-NO machine has two kinds of states—”final” and “non-final” states. If, after the whole input string has been fed in, (i) the machine is in one of the final states, its “output” is a YES (the machine has accepted the string) (ii) the machine is in one of the non-final states, its “output” is a NO (the machine has rejected the string) The set of strings accepted by a YES-NO machine is the language recognized by it.

Example of a YES-NO machine 2 b a a b 1 4 a b b a 3 L = {strings of a’s and b’s—starting with ‘a’, ending with ‘b’} final state YES-NO machine recognizing L expecting ‘a’ expecting ‘b’ trapped!

The two “laws” of YES-NO machines 1. A YES-NO machine accepts no string that is “outside the set” (i.e., strings that don’t belong to L, the language recognized by the machine ). 2. A YES-NO machine accepts ALL strings that are “inside the set” (i.e., strings that belong to L).

Any computing problem can be seen as a “language recognition” problem! Even problems that seem remotely connected to language recognition such as adding two numbers, for instance, can be posed as language recognition problems. Recognizing languages : What has it to do with computing ?

Definitions of technical terms Alphabet ( Σ) A finite set of symbols. e.g. {a, b, c … z} (the English alphabet) {0, 1} (binary alphabet used in computer “machine language”) { —,. } (“dashes” and “dots”: the Morse code alphabet) Rudiments of formal languages

e.g. cat, rat, automata (words/strings over the English alphabet) String (over an alphabet) A finite sequence of symbols from the alphabet. Length of a string w (denoted as | w | ) Number of symbols in the string. Note: ε is known as the empty string whose length is ZERO. Definitions of technical terms Rudiments of formal languages

Concatenation of strings x and y Appending y to the end of x. Concatenating a string x to itself: xx… x ( k times) is often written as x k. Let x = x 1 x 2 … x m ; y = y 1 y 2 … y n x 1 x 2 … x m y 1 y 2 … y n represents the concatenation of x and y. Definitions of technical terms Rudiments of formal languages

More formally, Σ* = {Strings (over Σ ) of length 0} U {Strings of length 1} U {Strings of length 2} … = Σ 0 U Σ 1 U Σ 2 …. Note: Let Σ = {a, b} Σ 2 = Σ Σ = {aa, ab, ba, bb} Σ 0 = { ε } Kleene Closure (denoted by Σ*) Informally, it is the (infinite) set of all strings one can construct with Σ, the alphabet. e.g. Let Σ = {a, b} Σ* = { ε, a, b, aa, bb, ab, ba, aaa, … } Definitions of technical terms Rudiments of formal languages

Language L (over Σ) A subset of Σ*. (A language can either be finite or infinite.) e.g. Let Σ = {a, b} L 1 = {a, aa, ab, aaa, aab, aba, abb, …} L 1 represents the language, “strings that start with a ” Definitions of technical terms Rudiments of formal languages Complement of a language L (denoted as L ’) Contains strings in Σ* that are not in L. L ’ = Σ* — L e.g. Let Σ = {a, b} L = {a, aa, ab, aaa, aab, aba, abb, …} (“strings that start with a ”) Then, L’ represents the language “strings that don’t start with a ”: { ε, b, bb, ba, …}

Deterministic Finite State Automaton (DFA) Definitions of technical terms Rudiments of formal languages A 5-tuple ( Q, Σ, δ, s, F ) finite set of states input alphabet transition function δ: Q x Σ  Q start state s є Q set of states Q (includes s and F ) δ: Q x Σ  Q string w over Σ set of final states U FQ x  Q abab Σ Q δ : 1 ? ? a b (earlier, we had referred to a DFA as a “YES-NO machine”.)

b a b 2 a 1 A typical DFA Rudiments of formal languages Σ = {a, b} Consider L = { x a y | x, y є Σ* } (strings that have an ‘a’ “somewhere”) Σ = {a, b} Q = {1, 2} F = {2} s = 1 Inputs abab δ is given by a Transition table DFA that recognizes L

If after inputting a string, the DFA is in one of the final states F, it is said to accept the input string; otherwise, it is said to it is said to reject the input string. The set of strings accepted by a DFA is the language recognized by it. Definitions of technical terms Rudiments of formal languages