NFA and regex. the Boolean algebra of languages. non-deterministic machines. regular expressions

Similar documents
Running an NFA & the subset algorithm (NFA->DFA) CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/

Finite State Automata and Determinisation

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

State Complexity of Union and Intersection of Binary Suffix-Free Languages

NON-DETERMINISTIC FSA

Regular languages refresher

Nondeterministic Finite Automata

CSE 401 Compilers. Today s Agenda

= state, a = reading and q j

Lecture 08: Feb. 08, 2019

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) - Spring L. Blum

Nondeterministic Automata vs Deterministic Automata

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

1 From NFA to regular expression

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Fundamentals of Computer Science

Harvard University Computer Science 121 Midterm October 23, 2012

Boolean Algebra cont. The digital abstraction

CS 573 Automata Theory and Formal Languages

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

CS375: Logic and Theory of Computing

Regular expressions, Finite Automata, transition graphs are all the same!!

Worked out examples Finite Automata

CHAPTER 1 Regular Languages. Contents

Chapter 4 Regular Grammar and Regular Sets. (Solutions / Hints)

Lecture 6 Regular Grammars

@#? Text Search ] { "!" Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata

NFAs continued, Closure Properties of Regular Languages

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

Finite-State Automata: Recap

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

CS375: Logic and Theory of Computing

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Theory of Computation Regular Languages

CSCI565 - Compiler Design

Some Theory of Computation Exercises Week 1

Prefix-Free Subsets of Regular Languages and Descriptional Complexity

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Bisimulation, Games & Hennessy Milner logic

Proportions: A ratio is the quotient of two numbers. For example, 2 3

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

CS241 Week 6 Tutorial Solutions

Data Structures and Algorithm. Xiaoqing Zheng

Compression of Palindromes and Regularity.

On Implicative and Strong Implicative Filters of Lattice Wajsberg Algebras

Non-deterministic Finite Automata

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

E 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n -1)=2E 0 (n-2) + E 0 (n-3)

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Closure Properties of Regular Languages

Let's start with an example:

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b

Hybrid Systems Modeling, Analysis and Control

Prefix-Free Regular-Expression Matching

Recursively Enumerable and Recursive. Languages

First Midterm Examination

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Deterministic Finite-State Automata

MA10207B: ANALYSIS SECOND SEMESTER OUTLINE NOTES

NFAs continued, Closure Properties of Regular Languages

CIT 596 Theory of Computation 1. Graphs and Digraphs

Non-deterministic Finite Automata

Java II Finite Automata I

Descriptional Complexity of Non-Unary Self-Verifying Symmetric Difference Automata

Myhill-Nerode Theorem

Finite Automata-cont d

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

NFA and regex. the Boolean algebra of languages. regular expressions. Informatics 1 School of Informatics, University of Edinburgh

CISC 4090 Theory of Computation

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

State Minimization for DFAs

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Closure Properties of Regular Languages

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Automata and Languages

Chapter 2 Finite Automata

Lecture 09: Myhill-Nerode Theorem

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Introduction to ω-autamata

In-depth introduction to main models, concepts of theory of computation:

Faster Regular Expression Matching. Philip Bille Mikkel Thorup

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s:

Solutions to Assignment 1

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then.

IST 4 Information and Logic

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Deterministic Finite Automata

QUADRATIC EQUATION. Contents

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

Transcription:

NFA nd regex l the Boolen lger of lnguges non-deterministi mhines regulr expressions Informtis

The intersetion of two regulr lnguges is regulr Run oth mhines in prllel? Build one mhine tht simultes two mhines running in prllel! Keep trk of the stte of eh mhine. Informtis

The intersetion of two regulr lnguges is regulr = 3 3 3 Informtis 3

The intersetion of two regulr lnguges is regulr = 3 3 6 3 6 3 6 4 3 4 5 3 3 5 4 5 4 5 Informtis 4

The intersetion of two regulr lnguges is regulr = 3 3 6 3 6 3 6 3 4 5 3 4 3 5 4 5 4 5 Informtis 5

The regulr lnguges A Σ* form Boolen Alger Sine they re losed under intersetion nd omplement. Informtis 6

Two exmples + Even inry numers Input sequene is epted if it ends with zero. + Input sequene is epted if it ends with one. Odd inry numers Informtis 7

Three exmples Whih inry numers re epted? + 3 Informtis 8

By three or not y three? divisile y three not divisile y three Informtis 9

The omplement of regulr lnguge is regulr If A Σ* is reognised y M then A = Σ* \ A is reognised y M where M nd M re identil exept tht the epting sttes of M re the nonepting sttes of M nd vie-vers Informtis

The intersetion of two regulr lnguges is regulr divisile y 6 divisile y nd divisile y 3 Informtis

The intersetion of two regulr lnguges is regulr Run oth mhines in prllel? Build one mhine tht simultes two mhines running in prllel! Keep trk of the stte of eh mhine. Informtis

The intersetion of two regulr lnguges is regulr = 3 3 3 Informtis 3

The intersetion of two regulr lnguges is regulr = 3 3 6 3 6 3 6 4 3 4 5 3 3 5 4 5 4 5 Informtis 4

The intersetion of two regulr lnguges is regulr = 3 3 6 3 6 3 6 3 4 5 3 4 3 5 4 5 4 5 Informtis 5

The regulr lnguges A Σ* form Boolen Alger Sine they re losed under intersetion nd omplement. Informtis 6

Is there regulr expression for every FSM? L = L = L = Informtis 7

Is there regulr expression for every FSM? L = L = ε Informtis 8 L =

Is there regulr expression for every FSM? L = L L L = ε Informtis 9 L = L

Is there regulr expression for every FSM? L = L L = L L = ε L = L Informtis

Is there regulr expression for every FSM? L = L L = L L = ()* L = ε L = L Informtis

Arden s Lemm If R nd S re regulr expressions then the eqution S X = R X S hs solution X = R S* R X If ε L(S) then this solution is unique. Informtis

Is there regulr expression for every FSM? L L L Let Li e the lnguge epted if i is the epting stte L = ε L = L L = L L L = L ε L = ε ε L = Informtis 3

Is there regulr expression for every FSM? L = L L = L3 L L3 = ε L = ε L L = (ε L ) L 3 = L L = L ( ) Informtis 4

Is there regulr expression for every FSM? L = L ( ) L = ( )* 3 L = L = ( )* L3 = ε L = ε ( )* Informtis 5

Arden s Lemm If R nd S re regulr expressions then the eqution X = R X S hs solution X = R S* If ε L(S) then this solution is unique. L = L ( ) L = ( )* Informtis 6

regulr expressions ny hrter is regexp mthes itself if R nd S re regexps, so is RS mthes mth for R followed y mth for S if R nd S re regexps, so is R S mthes ny mth for R or S (or oth) if R is regexp, so is R* mthes ny sequene of or more mthes for R The lger of regulr expressions lso inludes elements nd mthes nothing; mthes the empty string Kleene *, + * + Stephen Cole Kleene 99-994

regulr expressions denote regulr sets ny hrter is regexp {<>} if R nd S re regexs, so is RS { r s r R nd s S } if R nd S re regexps, so is R S R S if R is regexp, so is R* { rn n N nd r R S = S = S empty set S = S = S {<>} singleton empty sequene: Kleene *, + * + Stephen Cole Kleene 99-994 https://en.wikipedi.org/wiki/kleene_lger