Deterministic simulation of a NFA with k symbol lookahead

Similar documents
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:

Language Processors F29LP2, Lecture 5

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

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

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

Theory of Computation Regular Languages

Worked out examples Finite Automata

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Nondeterminism and Nodeterministic Automata

2-Way Finite Automata Radboud University, Nijmegen. Writer: Serena Rietbergen, s Supervisor: Herman Geuvers

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

Non-Deterministic Finite Automata

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

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

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

Non Deterministic Automata. Formal Languages and Automata - Yonsei CS 1

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Deterministic Finite-State Automata

Chapter 2 Finite Automata

CS 275 Automata and Formal Language Theory

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.

1.4 Nonregular Languages

1 Nondeterministic Finite Automata

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

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

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility)

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

( ) D x ( s) if r s (3) ( ) (6) ( r) = d dr D x

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

Discrete Mathematics and Logic II. Automata

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

Math 4318 : Real Analysis II Mid-Term Exam 1 14 February 2013

Good-for-Games Automata versus Deterministic Automata.

First Midterm Examination

CSCI FOUNDATIONS OF COMPUTER SCIENCE

Designing finite automata II

FI 2201 Electromagnetism

Non-deterministic Finite Automata

Finite-State Automata: Recap

Non-deterministic Finite Automata

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

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

Minimal DFA. minimal DFA for L starting from any other

Homework 3 Solutions

Introduction to ω-autamata

Fundamentals of Computer Science

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

Automata and Languages

CISC 4090 Theory of Computation

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

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

Let's start with an example:

1.3 Regular Expressions

Recursively Enumerable and Recursive. Languages

Deterministic Finite Automata

Lecture 6 Regular Grammars

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

On Determinisation of History-Deterministic Automata.

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Data Structures. Element Uniqueness Problem. Hash Tables. Example. Hash Tables. Dana Shapira. 19 x 1. ) h(x 4. ) h(x 2. ) h(x 3. h(x 1. x 4. x 2.

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

CHAPTER 1 Regular Languages. Contents

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Week 8. Topic 2 Properties of Logarithms

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

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

More on automata. Michael George. March 24 April 7, 2014

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

First Midterm Examination

Harvard University Computer Science 121 Midterm October 23, 2012

Java II Finite Automata I

Previously. Extensions to backstepping controller designs. Tracking using backstepping Suppose we consider the general system

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

CS375: Logic and Theory of Computing

Formal Methods in Software Engineering

input tape head moves current state

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

Turing Machines Part One

ɛ-closure, Kleene s Theorem,

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

Optimization. x = 22 corresponds to local maximum by second derivative test

Learning Moore Machines from Input-Output Traces

ITI Introduction to Computing II

Prefix-Free Subsets of Regular Languages and Descriptional Complexity

Coalgebra, Lecture 15: Equations for Deterministic Automata

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

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Lecture 18: Graph Isomorphisms

Synchronizing Automata with Random Inputs

Languages & Automata

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Lecture 08: Feb. 08, 2019

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Solution to HW 3, Ma 1a Fall 2016

Transcription:

Deteministic simultion of NFA with k symbol lookhed SOFSEM 7 Bl Rvikum, Clifoni Stte Univesity (joint wok with Nic Snten, Univesity of Wteloo)

Oveview Definitions: DFA, NFA nd lookhed DFA Motivtion: utomted e sevice composition nd delegtion The NFA delegtion model, exmples, popeties Chcteiztion of existence of delegto Complexityof finding delegto fo unmbiguous nd genel NFA An lgoithm fo genel NFA delegtion Conclusion, futhe wok

DFA Deteministic Finite Automton A = Q,, δ, s, F δ : Q ( ) ~ Q s s { } ( ) ( ) ( ) L A w w = Σ is odd = +

NFA Nondeteministic Finite Automton δ : Q (,, δ,, ) P( Q) M = Q s F,, s s s s 3 ( ) = ( + ) ( ) ( + ) L A

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 symbol lookhed 3 4 5

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 4 5

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 4 5

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 4 5

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 4 5

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 4 5

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 4 5

k symbols Lookhed DFA D= Q,, δ, s, F δ : Q ( ) k ~ Q 3 4 5

E Sevices Composition nd Delegtion tsk tsk tsk tsk... i i+ i+ i+ 3 e-sevice... seve Bsed on the "sttus" of evey e-sevice, the seve disptches the next tsk i to e-sevice j. Ech e-sevice i my be modeled by n ctivity utomton A, nd evey tsk by symbol fom finite lphbet. i... e-sevice e-sevice j

E Sevices Composition nd Delegtion tsk tsk tsk tsk... i i+ i+ i+ 3 e-sevice... seve Bsed on the "sttus" of evey e-sevice, the seve disptches the next tsk i to e-sevice j. Ech e-sevice i my be modeled by n ctivity utomton A, nd evey tsk by symbol fom finite lphbet. i... e-sevice e-sevice j

Composition nd Delegtion Models A: epesents vlid sequences of tomic tsks (e.g. web session) A: ctivity utomton fo specific e-sevice i i A; A,..., A is composble if ( ) ( )# ( )#...# ( ) L A L A L A L A (e.g. xyby b # xyy ) This is necessy condition to ensue tht the web ppliction is fesible. Question: is it sufficient?

Composition nd Delegtion Models A: epesents vlid sequences of tomic tsks (e.g. web session) A: ctivity utomton fo specific e-sevice i i A; A,..., A is composble if ( ) ( )# ( )#...# ( ) L A L A L A L A (e.g. xyby b # xyy ) This is necessy condition to ensue tht the web ppliction is fesible. Question: is it sufficient?

Composition nd Delegtion A : q q q q q 3 4 5 A : p p p 3 4 A... : p p A ( A #...# A ) A : p p ( q, p, p,..., ) ( q, p, p,..., p) ( q3, p, p,..., p) p ( q, p, p,..., p ) ( q p, p,..., p ) 4 5,

Composbility nd Delegtion 3 4 A : q q q q q 5 : A p p p 3 4 A... : p p A ( A #...# A ) A : p p.., ) (,,,..., ) 3 ( q, p, p,. p q p p p ( q, p, p,..., p ) ( q, p, p,..., p ) ( q p, p,..., p ) 4 5,

Composbility nd Delegtion 3 A : q q q q 4 q 5 : p A p p 3 4 A... : p p A ( A #...# A ) A : p p ( q, p, p,..., p ) (, p, p,..., p ) ( q,,,..., p ) q 3 p p ( q, p, p,..., p ) ( q p, p,..., p ) 4 5,

Composbility nd Delegtion A : q q 3 q3 q4 q 5 : A p p p 3 4 A... : p p A ( A #...# A ) A : p 3 p.., ) (, p, p,..., p ) 3 ( q4, p p,..., p ) ( q, p, p,. p q ( q, p, p,..., p ) 3, ( q p, p,..., p ) 5, 3

Nondeteministic Delegto 3 4 3 4 5 A : q q q q q A : p p A : p p... 4 p 3 4 A ( A #...# A ) A : p 3 p ( q, p, p,..., p ) ( q, p, p,..., p ) (, p, p,..., p ) q 3 3 q4 p p p 4 q5, p p (,,,..., ) (,,..., p ) 3

k Lookhed Delegtion Model M ( Q,, δ, s, F) : the composite NFA A ( A #...# A ) = How cn we use M deteministiclly? k delegto fo M is n equivlent k-symbol lookhed ( Q δ s F) Σ k ~ DFA,,,,, with δ : Q Q veify k ( ) δ ( ) δ ( ) i i ing: q,... Q Σ : q,... q,, i k

k Lookhed Delegtion Model ( Q,, δ, s, F) : the composite NFA ( #...# ) M = A A A How cn we use M deteministiclly? k delegto fo M is n equivlent k-symbol lookhed ( Q δ s F) DFA,,,, Σ k ~, with δ : Q Q ve i k ( ) δ ( ) δ ( ) i i fying: q,... Q Σ : q,... q,, i k

k Lookhed Delegtion Model Intepettion: n NFA M k delegto fo M q q... q j... q t δ ( q, ) q... i q j (,... ) q = δ q q t i k ( q,... ) Q : δ ( q,... ) δ ( q, ) Σ i i

Exmple: n unmbiguous NFA 3 b ( ( ) + ( ) ) b b 4 5

Exmple: delegto b 3 b b, b ( ( ) + ( ) ) b b,, 4 5 This unmbiguous NFA hs delegto.

Exmple: n unmbiguous NFA 3 ( + ) 4 5 this unmbigous NFA hs no k-delegto, k >.

Exmple: no delegtos 3 ( + ) 4 5 This unmbigous NFA hs no k-delegto, k >.

Exmple: n mbiguous NFA... p pk p k p q... qk q k ( + ) k

Exmple: k delegto, no (<k) delegto k, k p,,... k k k pk... p k k k,,..., p k... q k, k qk... q k k k,,..., ( + ) k This NFA hs k-delegto but no ( k ) - delegtos. Note: k-delegtion ( k ) + -delegtion

Exmple: n mbiguous NFA,, s s s s 3 ( + ) ( ) ( + )

Exmple: no delegtos,, s s s s 3 ( + ) ( ) ( + ) This NFA hs no k-delegto, fo ny k >. ide: tke nd k- k k- k+

Why Study NFA Delegtion E Sevice Composition given some specifictions nd set of e sevices, implement n ppliction which follows the specifictions. Deteministic simultion of NFA: ltentive to clssicl subset constuction to simulte n NFA by DFA. Line blow up vs. exponentil blow up. A theoeticl metic fo nondeteminism: if n NFA M hs 3 delegto nd M does not hve k delegto fo, sy k <, then M is moe nondeteministic thn M.

Lnguge vs. Mchine Popety 'st Question: Is delegtion lnguge popety o mchine popety? (thee exist infinitely mny NFA fo given egul lnguge)

Delegtion s Lnguge Popety L - egul lnguge. L is wekly delegble if ( M )( k )( M hs k delegto) NFA fo L k >. L is stongly delegble if ( k )( M )( M hs k delegto) k> NFA fo L

Delegtion s Lnguge Popety Theoem. L is stongly deleg. L is wekly deleg. L is finite Consequence. It is moe inteesting to see delegbility s mchine popety.

Complexity of Finding k Delegto Poblems: ( ) P k is n intege not pt of the input. ( P ) ( P ) 3 input : n NFA M output : YES if M hs k delegto, NO othewise input : n NFA M nd n intege k output : YES if M hs k delegto, NO othewise input : n NFA M output : YES if M hs delegto, NO othewise

Stte Blindness [ ]... k q p...... kv p... kv q is... -blind if k (, ) δ (, ), : δ (,... ), δ (,... ) p δ q p q v p v F p v F k k stte is k-blind if thee exists... such tht it is... -blind k k

Stte Blindness [ ]... k q p...... kv p... kv q is... -blind if k (, ) δ (, ), : (,... ), (,... ) p δ q p q v δ p v F= φ δ p v F φ k k stte is k-blind if thee exists... such tht it is... -blind k k

Stte blindness is computble Recll tht sting w is q blind if it is not possible in stte q to find deteministic choice given w s the look hed. Define B q = { w w is q blind } Theoem: Let M be DFA with n sttes, nd ove n lphbet of size m, nd let q be stte of M. The lnguge B q is egul, nd thee is DFA with t most (4 n + ) m tht ccepts B q.

A Chcteiztion fo Unmbiguous NFA Theoem. An unmbiguous NFA hs k-delegto iff none of its sttes e k-blind. Consequently, n unmbiguous NFA hs delegto iff ll its sttes hve finite blindness.

Poblem fo unmbiguous NFA s Theoem: Let k be fixed intege. Thee is polynomil time lgoithm tht given n unmbiguous NFA M detemines if M hs k delegto. Poof (sketch) The poblem cn be educed to the poblem of continment poblem fo unmbiguous NFA s. Fom esult of Hunt nd Stens, this poblem is known to be solvble in polynomil time.

Delegtion fo Unmbiguous NFA Theoem(). s ( P) ( P ) ( P ) 3 unmbiguous NFA P co-np PSPACE The poof of co NP nd PSPACE uppe bounds fo P nd P3 e simil to tht of Poblem.

Abity NFA All 3 poblems e significntly hde fo genel NFA: - delegto fo (tim) unmbiguous NFA must use ll its sttes: locl popeties (blindness) hve globl impct; - continment nd equivlence poblems e decidble in polynomil time fo unmb. NFA.

Abity NFA: Fobidden Wods [ ]... k q p...... kbp... kb q is... -fobidden if one of the following two conditions k is stisfied ecusively (intuitive def.) :. q is... -blind; k ( ). fo evey stte p δ q, thee exists b such tht p is... b -fobidden. k p p

Abity NFA: Fobidden Wods [ ]... k q p...... kbp... kb q is... -fobidden k is stisfied ecusively (intuitive def.) : if one of the following two conditions. q is... - blind; k ( q ). fo evey stte p δ, thee exists b such tht p is... b - fobidden. k p p

Abity NFA: Delegtion Chcteiztion Nottion: F is the set of ll fobidden wods fo q. q Theoem. ( δ ) ( ) An NFA M = Q, Σ,, q, F hs k-delegto iff F pef L = φ. q k M Consequently, n NFA hs delegto iff F is finite. q

Delegtion fo Unmbiguous NFA Theoem(). s ( P ) ( P ) ( P ) 3 genel NFA PSPACE-complete PSPACE-hd?

Wp up NFA delegtion is finite stte model used in web sevice pplictions, tsk scheduling, NFA simultion, mesue of nondeteminism, etc. NFA delegtion is mchine popety nd its computtionl complexity is mchine dependent: ( P) ( P ) ( P ) 3 unmbiguous P co-np PSPACE genel PSPACE-complete PSPACE-hd? (pevious wok: fo k =, P in the genel cse : EXPTIME)

Min open poblem: Diection fo futue wok Investigte complexity mttes fo othe fmilies of NFA. Fo exmple, study NFA tht e shuffle poduct of DFA. Is delegtion decidble fo bity NFA? Study the ntue of. F q Othe Questions: The complexity esult fo Poblem (genel cse) ws poven fo 4 lette lphbet. Cn the PSPACE completeness poof be extended to smlle lphbets? Is poblem complete fo co NP fo unmbiguous NFA? Is poblem 3 complete fo PSPACE fo unmbiguous NFA?

Refeences Sevice oiented computing: R. Hull nd J. Su. Tools fo Design of Composite Web Sevices. In SIGMOD 4, pp. 958 96 (4) M. Mecell nd G. D. Gicomo. Sevice Composition: Technologies, Methods nd Tools fo Synthesis nd Ochesttion of Composite Sevices nd Pocesses. Tutoil in ICSOC 4. D. Bedi, D. Clvnese, G. D. Gicomo, M. Lenzeini, nd M. Mecell. Automtic Composition of e Sevices tht Expot thei Behviou. In ICSOC 3, LNCS 9, pp. 43 58, 3. Finite stte models fo e sevices: C. E. Geede, O. H. Ib, B. Rvikum, nd J. Su. On line nd Ad hoc Minimum Cost Delegtion in e Sevice Composition. In IEEE SCC, pp. 3, 5. Z. Dng, O. H. Ib, nd J. Su. Composbility of Infinite Stte Activity Automt. In ISAAC 4, LNCS 334, pp. 377 388. C. E. Geede, R. Hull, O. H. Ib, nd J. Su. Automted Composition of e Sevices: Lookheds. In ISOC 4, pp. 5 6.

Design Methodology Exmple p d d 3 es d : downlods nd pocesses files sequentilly P es : downlods files t time nd pocesses them in pllel S - ppliction specifiction: p p downlod nd pocess, hving no moe thn files in the system t ny time d P d 3

Design Methodology Step constuct es # es : p d [,] P [,] d [, ] p d [, ] d [,3] P d [, 3] d p it epesents the shuffle behvio of es nd es

Design Methodology Step constuct S es # es : p [,,] d [,,] p [ 3,, ] d [,, ] d d P [ 3,,3] it epesents the nondeteministic behvio of the ppliction ( S)

Design Methodology Step 3 find delegto : pd, p es dp dd pd dp ddpdpd p es P, Pd dp it epesents the design of S