From NFA to minimal DFA

80
From NFA to minimal DFA Bas Ploeger 1 Rob van Glabbeek 2 Jan Friso Groote 1 1 Department of Mathematics and Computer Science Technische Universiteit Eindhoven The Netherlands 2 National ICT Australia Sydney, Australia ProSe, 19 October 2006

Transcript of From NFA to minimal DFA

Page 1: From NFA to minimal DFA

From NFA to minimal DFA

Bas Ploeger1 Rob van Glabbeek2 Jan Friso Groote1

1 Department of Mathematics and Computer ScienceTechnische Universiteit Eindhoven

The Netherlands

2 National ICT AustraliaSydney, Australia

ProSe, 19 October 2006

Page 2: From NFA to minimal DFA

Overview

Introduction

Problem

Solution 1

Solution 2

Conclusions

Page 3: From NFA to minimal DFA

Preliminaries

Finite automata

I NFA is a tuple (S ,Σ,→, i ,F )

I DFA: every state has at most one outgoing a-transition forevery a ∈ Σ

Language semantics

I Language of a state s: L(s) = {σ ∈ Σ∗ | ∃f ∈ F . sσ−→ f }

I Language preorder and equivalence on states s, s ′:

s vL s ′ ⇔ L(s) ⊆ L(s ′)s ≡L s ′ ⇔ L(s) = L(s ′)

Page 4: From NFA to minimal DFA

Preliminaries

Finite automata

I NFA is a tuple (S ,Σ,→, i ,F )

I DFA: every state has at most one outgoing a-transition forevery a ∈ Σ

Language semantics

I Language of a state s: L(s) = {σ ∈ Σ∗ | ∃f ∈ F . sσ−→ f }

I Language preorder and equivalence on states s, s ′:

s vL s ′ ⇔ L(s) ⊆ L(s ′)s ≡L s ′ ⇔ L(s) = L(s ′)

Page 5: From NFA to minimal DFA

Canonization

ProblemGiven an NFA, find the smallest, language equivalent DFA.

Solution

1. Determinize NFA (subset construction)

2. Minimize DFA (Hopcroft)

Minimal DFA can be exponentially larger than NFA

Page 6: From NFA to minimal DFA

Canonization

ProblemGiven an NFA, find the smallest, language equivalent DFA.

Solution

1. Determinize NFA (subset construction)

2. Minimize DFA (Hopcroft)

Minimal DFA can be exponentially larger than NFA

Page 7: From NFA to minimal DFA

Canonization

ProblemGiven an NFA, find the smallest, language equivalent DFA.

Solution

1. Determinize NFA (subset construction) EXPTIME

2. Minimize DFA (Hopcroft) PTIME

Minimal DFA can be exponentially larger than NFA

Page 8: From NFA to minimal DFA

Canonization

ProblemGiven an NFA, find the smallest, language equivalent DFA.

Solution

1. Determinize NFA (subset construction) EXPTIME

2. Minimize DFA (Hopcroft) PTIME

Minimal DFA can be exponentially larger than NFA

Page 9: From NFA to minimal DFA

ExampleSubset construction

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}{2}

b

a

{3}

b

a

b

Page 10: From NFA to minimal DFA

ExampleSubset construction

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}{2}

b

a

{3}

b

a

b

Page 11: From NFA to minimal DFA

ExampleSubset construction

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}

{2}

b

a

{3}

b

a

b

Page 12: From NFA to minimal DFA

ExampleSubset construction

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}

{2}

b

a

{3}

b

a

b

Page 13: From NFA to minimal DFA

ExampleSubset construction

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}

{2}

b

a

{3}

b

a

b

Page 14: From NFA to minimal DFA

ExampleSubset construction

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}

{2}

b

a

{3}

b

a

b

Page 15: From NFA to minimal DFA

ExampleSubset construction

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}

{2}

b

a

{3}

b

a

b

Page 16: From NFA to minimal DFA

ExampleMinimization

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a

{2}

{2}

b

a

{3}

b

a

b

Page 17: From NFA to minimal DFA

ExampleMinimization

NFA

0

1 2

3

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

a,b

a

{3}

b

Page 18: From NFA to minimal DFA

Relevance to Process Theory (1)

Labelled Transition Systems

I Process modelled by LTS (S ,Σ,→, i)

I No final states (computation “never” stops)

Trace semanticsI Traces of a state s: Tr(s) = {σ ∈ Σ∗ | ∃f ∈ S . s

σ−→ f }I Trace equivalence: s ≡T s ′ ⇔ Tr(s) = Tr(s ′)

Bisimulation semanticsI Bisimulation is a relation R on states satisfying, for a ∈ Σ:

I if s R t and sa−→ s ′, then ∃t ′ . t

a−→ t ′ and s ′ R t ′;I if s R t and t

a−→ t ′, then ∃s ′ . sa−→ s ′ and s ′ R t ′;

I Bisimulation equivalence: s↔ s ′ if there exists a bisimulationR with s R s ′

Page 19: From NFA to minimal DFA

Relevance to Process Theory (1)

Labelled Transition Systems

I Process modelled by LTS (S ,Σ,→, i)

I No final states (computation “never” stops)

Trace semanticsI Traces of a state s: Tr(s) = {σ ∈ Σ∗ | ∃f ∈ S . s

σ−→ f }I Trace equivalence: s ≡T s ′ ⇔ Tr(s) = Tr(s ′)

Bisimulation semanticsI Bisimulation is a relation R on states satisfying, for a ∈ Σ:

I if s R t and sa−→ s ′, then ∃t ′ . t

a−→ t ′ and s ′ R t ′;I if s R t and t

a−→ t ′, then ∃s ′ . sa−→ s ′ and s ′ R t ′;

I Bisimulation equivalence: s↔ s ′ if there exists a bisimulationR with s R s ′

Page 20: From NFA to minimal DFA

Relevance to Process Theory (1)

Labelled Transition Systems

I Process modelled by LTS (S ,Σ,→, i)

I No final states (computation “never” stops)

Trace semanticsI Traces of a state s: Tr(s) = {σ ∈ Σ∗ | ∃f ∈ S . s

σ−→ f }I Trace equivalence: s ≡T s ′ ⇔ Tr(s) = Tr(s ′)

Bisimulation semanticsI Bisimulation is a relation R on states satisfying, for a ∈ Σ:

I if s R t and sa−→ s ′, then ∃t ′ . t

a−→ t ′ and s ′ R t ′;I if s R t and t

a−→ t ′, then ∃s ′ . sa−→ s ′ and s ′ R t ′;

I Bisimulation equivalence: s↔ s ′ if there exists a bisimulationR with s R s ′

Page 21: From NFA to minimal DFA

Relevance to Process Theory (2)

ProblemGiven an LTS, minimize it under trace semantics

Facts

I Deciding trace equivalence is PSPACE-complete

I Deciding bisimulation equivalence is in PTIME

I If LTS is deterministic: ≡T equals ↔

Solution

1. Determinize LTS (subset construction)

2. Minimize LTS under bisimulation semantics (Paige-Tarjan)

Page 22: From NFA to minimal DFA

Relevance to Process Theory (2)

ProblemGiven an LTS, minimize it under trace semantics

Facts

I Deciding trace equivalence is PSPACE-complete

I Deciding bisimulation equivalence is in PTIME

I If LTS is deterministic: ≡T equals ↔

Solution

1. Determinize LTS (subset construction)

2. Minimize LTS under bisimulation semantics (Paige-Tarjan)

Page 23: From NFA to minimal DFA

Relevance to Process Theory (2)

ProblemGiven an LTS, minimize it under trace semantics

Facts

I Deciding trace equivalence is PSPACE-complete

I Deciding bisimulation equivalence is in PTIME

I If LTS is deterministic: ≡T equals ↔

Solution

1. Determinize LTS (subset construction)

2. Minimize LTS under bisimulation semantics (Paige-Tarjan)

Page 24: From NFA to minimal DFA

Relevance to Process Theory (2)

ProblemGiven an LTS, minimize it under trace semantics

Facts

I Deciding trace equivalence is PSPACE-complete

I Deciding bisimulation equivalence is in PTIME

I If LTS is deterministic: ≡T equals ↔

Solution

1. Determinize LTS (subset construction)

2. Minimize LTS under bisimulation semantics (Paige-Tarjan)

Page 25: From NFA to minimal DFA

Relevance to Process Theory (2)

ProblemGiven an LTS, minimize it under trace semantics

Facts

I Deciding trace equivalence is PSPACE-complete

I Deciding bisimulation equivalence is in PTIME

I If LTS is deterministic: ≡T equals ↔

Solution

1. Determinize LTS (subset construction)

2. Minimize LTS under bisimulation semantics (Paige-Tarjan)

Page 26: From NFA to minimal DFA

Problem

Overview

NFA mDFADFAsubset construction minimize

Questions

I What if DFA is much larger than mDFA?

I Can we avoid the generation of redundant states?

I Space efficiency (average case)

Page 27: From NFA to minimal DFA

Problem

Overview

NFA mDFADFAsubset construction minimize

Questions

I What if DFA is much larger than mDFA?

I Can we avoid the generation of redundant states?

I Space efficiency (average case)

Page 28: From NFA to minimal DFA

Problem

Overview

NFA mDFADFAsubset construction minimize

Questions

I What if DFA is much larger than mDFA?

I Can we avoid the generation of redundant states?

I Space efficiency (average case)

Page 29: From NFA to minimal DFA

Problem

Overview

NFA mDFA?

Questions

I What if DFA is much larger than mDFA?

I Can we avoid the generation of redundant states?

I Space efficiency (average case)

Page 30: From NFA to minimal DFA

Problem

Overview

NFA mDFA?

Questions

I What if DFA is much larger than mDFA?

I Can we avoid the generation of redundant states?

I Space efficiency (average case)

Page 31: From NFA to minimal DFA

Solution 1

Subset construction

Input: NFA N = (SN ,ΣN ,−→N , iN ,FN )Output: DFA D = (SD,ΣD,−→D, iD,FD)

Every DFA state P ∈ SD is a set of NFA states

Basic ideaI Add “irrelevant” NFA states to P

I State is irrelevant if it does not alter L(P)

L(P)?

I Language in NFA: LN (P) =⋃

p∈P LN (p)

I Language in DFA: LD(P), defined as usual

I Lemma: LN (P) = LD(P) for every P ⊆ SN

Page 32: From NFA to minimal DFA

Solution 1

Subset construction

Input: NFA N = (SN ,ΣN ,−→N , iN ,FN )Output: DFA D = (SD,ΣD,−→D, iD,FD)

Every DFA state P ∈ SD is a set of NFA states

Basic ideaI Add “irrelevant” NFA states to P

I State is irrelevant if it does not alter L(P)

L(P)?

I Language in NFA: LN (P) =⋃

p∈P LN (p)

I Language in DFA: LD(P), defined as usual

I Lemma: LN (P) = LD(P) for every P ⊆ SN

Page 33: From NFA to minimal DFA

Solution 1

Subset construction

Input: NFA N = (SN ,ΣN ,−→N , iN ,FN )Output: DFA D = (SD,ΣD,−→D, iD,FD)

Every DFA state P ∈ SD is a set of NFA states

Basic ideaI Add “irrelevant” NFA states to P

I State is irrelevant if it does not alter L(P)

L(P)?

I Language in NFA: LN (P) =⋃

p∈P LN (p)

I Language in DFA: LD(P), defined as usual

I Lemma: LN (P) = LD(P) for every P ⊆ SN

Page 34: From NFA to minimal DFA

Solution 1

Subset construction

Input: NFA N = (SN ,ΣN ,−→N , iN ,FN )Output: DFA D = (SD,ΣD,−→D, iD,FD)

Every DFA state P ∈ SD is a set of NFA states

Basic ideaI Add “irrelevant” NFA states to P

I State is irrelevant if it does not alter L(P)

L(P)?

I Language in NFA: LN (P) =⋃

p∈P LN (p)

I Language in DFA: LD(P), defined as usual

I Lemma: LN (P) = LD(P) for every P ⊆ SN

Page 35: From NFA to minimal DFA

Solution 1

Subset construction

Input: NFA N = (SN ,ΣN ,−→N , iN ,FN )Output: DFA D = (SD,ΣD,−→D, iD,FD)

Every DFA state P ∈ SD is a set of NFA states

Basic ideaI Add “irrelevant” NFA states to P

I State is irrelevant if it does not alter L(P)

L(P)?

I Language in NFA: LN (P) =⋃

p∈P LN (p)

I Language in DFA: LD(P), defined as usual

I Lemma: LN (P) = LD(P) for every P ⊆ SN

Page 36: From NFA to minimal DFA

Solution 1

Subset construction

Input: NFA N = (SN ,ΣN ,−→N , iN ,FN )Output: DFA D = (SD,ΣD,−→D, iD,FD)

Every DFA state P ∈ SD is a set of NFA states

Basic ideaI Add “irrelevant” NFA states to P

I State is irrelevant if it does not alter L(P)

L(P)?

I Language in NFA: LN (P) =⋃

p∈P LN (p)

I Language in DFA: LD(P), defined as usual

I Lemma: LN (P) = LD(P) for every P ⊆ SN

Page 37: From NFA to minimal DFA

Solution 1

Closure

I For any set P ⊆ SN define: P = {p ∈ SN | LN (p) ⊆ LN (P)}

I Proposition: P ≡L P for any P ⊆ SN

Algorithm

I Normal subset construction, but . . .

I Replace every generated set P by P

Main TheoremGiven an NFA, the algorithm constructs the minimal, languageequivalent DFA

Page 38: From NFA to minimal DFA

Solution 1

Closure

I For any set P ⊆ SN define: P = {p ∈ SN | p vL P}

I Proposition: P ≡L P for any P ⊆ SN

Algorithm

I Normal subset construction, but . . .

I Replace every generated set P by P

Main TheoremGiven an NFA, the algorithm constructs the minimal, languageequivalent DFA

Page 39: From NFA to minimal DFA

Solution 1

Closure

I For any set P ⊆ SN define: P = {p ∈ SN | p vL P}I Proposition: P ≡L P for any P ⊆ SN

Algorithm

I Normal subset construction, but . . .

I Replace every generated set P by P

Main TheoremGiven an NFA, the algorithm constructs the minimal, languageequivalent DFA

Page 40: From NFA to minimal DFA

Solution 1

Closure

I For any set P ⊆ SN define: P = {p ∈ SN | p vL P}I Proposition: P ≡L P for any P ⊆ SN

Algorithm

I Normal subset construction, but . . .

I Replace every generated set P by P

Main TheoremGiven an NFA, the algorithm constructs the minimal, languageequivalent DFA

Page 41: From NFA to minimal DFA

Solution 1

Closure

I For any set P ⊆ SN define: P = {p ∈ SN | p vL P}I Proposition: P ≡L P for any P ⊆ SN

Algorithm

I Normal subset construction, but . . .

I Replace every generated set P by P

Main TheoremGiven an NFA, the algorithm constructs the minimal, languageequivalent DFA

Page 42: From NFA to minimal DFA

Example

NFA

0 (a|b)a∗b

1a∗b

2a∗b

3 {λ}

a a,b

a

b

a

a

b

DFA

{0}

{1, 2} {2}{1, 2}

{3}

ab

a

b

Page 43: From NFA to minimal DFA

Example

NFA

0 (a|b)a∗b

1a∗b

2a∗b

3 {λ}

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

{2}{1, 2}

{3}

a

b

a

b

Page 44: From NFA to minimal DFA

Example

NFA

0 (a|b)a∗b

1a∗b

2a∗b

3 {λ}

a a,b

a

b

a

a

b

DFA

{0}

{1, 2} {2}

{1, 2}

{3}

ab

a

b

Page 45: From NFA to minimal DFA

Example

NFA

0 (a|b)a∗b

1a∗b

2a∗b

3 {λ}

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

{2}

{1, 2}

{3}

ab

a

b

Page 46: From NFA to minimal DFA

Example

NFA

0 (a|b)a∗b

1a∗b

2a∗b

3 {λ}

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

{2}{1, 2}

{3}

a,b

b

a

b

Page 47: From NFA to minimal DFA

Example

NFA

0 (a|b)a∗b

1a∗b

2a∗b

3 {λ}

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

{2}{1, 2}

{3}

a,b

b

a

b

Page 48: From NFA to minimal DFA

Example

NFA

0 (a|b)a∗b

1a∗b

2a∗b

3 {λ}

a a,b

a

b

a

a

b

DFA

{0}

{1, 2}

{2}{1, 2}

{3}

a,b

b

a

b

Page 49: From NFA to minimal DFA

Complexity issues

Closure

I Language inclusion is PSPACE-complete

Simulation semantics

I Simulation is a relation R on states satisfying, for a ∈ ΣN :I if s R t and s

a−→ s ′, then ∃t ′ . ta−→ t ′ and s ′ R t ′

I if s R t then s ∈ F ⇒ t ∈ F

I Simulation preorder: s ⊂→ s ′ if there exists a simulation R withs R s ′.

I Simulation is in PTIME

Page 50: From NFA to minimal DFA

Complexity issues

Closure

I Language inclusion is PSPACE-complete

Simulation semantics

I Simulation is a relation R on states satisfying, for a ∈ ΣN :I if s R t and s

a−→ s ′, then ∃t ′ . ta−→ t ′ and s ′ R t ′

I if s R t then s ∈ F ⇒ t ∈ F

I Simulation preorder: s ⊂→ s ′ if there exists a simulation R withs R s ′.

I Simulation is in PTIME

Page 51: From NFA to minimal DFA

Complexity issues

Closure

I Language inclusion is PSPACE-complete

Simulation semantics

I Simulation is a relation R on states satisfying, for a ∈ ΣN :I if s R t and s

a−→ s ′, then ∃t ′ . ta−→ t ′ and s ′ R t ′

I if s R t then s ∈ F ⇒ t ∈ F

I Simulation preorder: s ⊂→ s ′ if there exists a simulation R withs R s ′.

I Simulation is in PTIME

Page 52: From NFA to minimal DFA

Implementation

Trade-off

I Use ⊂→ instead of vL in closure

I Resulting DFA is not minimal

I But at most as large as the DFA produced by subsetconstruction

Page 53: From NFA to minimal DFA

Implementation

Trade-off

I Use ⊂→ instead of vL in closure

I Resulting DFA is not minimal

I But at most as large as the DFA produced by subsetconstruction

Page 54: From NFA to minimal DFA

Preliminary results

NFA min. DFAstates transitions states transitions

1 236 456 1.367 2.690

2 1.438 2.821 18.925 37.615

DFAstates transitions memory time

1 - normal 42.665 83.416 5,90 MB 0,200 sec1 - solution 1 4.712 9.252 4,39 MB 0,844 sec

2 - normal 7.403.224 14.616.424 468,05 MB 72,468 sec2 - solution 1 176.105 348.005 63,57 MB 561,022 sec

Page 55: From NFA to minimal DFA

Preliminary results

NFA min. DFAstates transitions states transitions

1 236 456 1.367 2.690

2 1.438 2.821 18.925 37.615

DFAstates transitions memory time

1 - normal 42.665 83.416 5,90 MB 0,200 sec1 - solution 1 4.712 9.252 4,39 MB 0,844 sec

2 - normal 7.403.224 14.616.424 468,05 MB 72,468 sec2 - solution 1 176.105 348.005 63,57 MB 561,022 sec

Page 56: From NFA to minimal DFA

Solution 2

Idea

I Why not remove irrelevant states from a set P?

I A p ∈ P is irrelevant if: ∃q ∈ P . p 6= q ∧ p vL q

Better idea

I Replace P by the set of transitions of the states in P:

T = {(a, q) ∈ Σ× S | ∃p ∈ P . pa−→ q}

I Remove irrelevant transitions from T

I A t ∈ T is irrelevant if: ∃u ∈ T . t 6= u ∧ t vL u

Page 57: From NFA to minimal DFA

Solution 2

Idea

I Why not remove irrelevant states from a set P?

I A p ∈ P is irrelevant if: ∃q ∈ P . p 6= q ∧ p vL q

Better idea

I Replace P by the set of transitions of the states in P:

T = {(a, q) ∈ Σ× S | ∃p ∈ P . pa−→ q}

I Remove irrelevant transitions from T

I A t ∈ T is irrelevant if: ∃u ∈ T . t 6= u ∧ t vL u

Page 58: From NFA to minimal DFA

Solution 2

Idea

I Why not remove irrelevant states from a set P?

I A p ∈ P is irrelevant if: ∃Q ⊆ P . p 6∈ Q ∧ p vL Q

Better idea

I Replace P by the set of transitions of the states in P:

T = {(a, q) ∈ Σ× S | ∃p ∈ P . pa−→ q}

I Remove irrelevant transitions from T

I A t ∈ T is irrelevant if: ∃u ∈ T . t 6= u ∧ t vL u

Page 59: From NFA to minimal DFA

Solution 2

Idea

I Why not remove irrelevant states from a set P?

I A p ∈ P is irrelevant if: ∃Q ⊆ P . p 6∈ Q ∧ p vL Q

Better idea

I Replace P by the set of transitions of the states in P:

T = {(a, q) ∈ Σ× S | ∃p ∈ P . pa−→ q}

I Remove irrelevant transitions from T

I A t ∈ T is irrelevant if: ∃u ∈ T . t 6= u ∧ t vL u

Page 60: From NFA to minimal DFA

Solution 2

Idea

I Why not remove irrelevant states from a set P?

I A p ∈ P is irrelevant if: ∃Q ⊆ P . p 6∈ Q ∧ p vL Q

Better idea

I Replace P by the set of transitions of the states in P:

T = {(a, q) ∈ Σ× S | ∃p ∈ P . pa−→ q}

I Remove irrelevant transitions from T

I A t ∈ T is irrelevant if: ∃u ∈ T . t 6= u ∧ t vL u

Page 61: From NFA to minimal DFA

Definitions

Language semantics

For transitions t = (a, q) and u = (b, r):

I Language of t: L(t) = {aσ ∈ Σ+ | σ ∈ L(q)}

I t vL u ⇔ a = b ∧ q vL r

Compression

For any set of transitions T define:

↓T =

T if ¬∃t, u ∈ T . t 6= u ∧ t vL u↓(T − {t}) where t ∈ T and ∃u ∈ T . t 6= u ∧ t vL u,

otherwise

Page 62: From NFA to minimal DFA

Definitions

Language semantics

For transitions t = (a, q) and u = (b, r):

I Language of t: L(t) = {aσ ∈ Σ+ | σ ∈ L(q)}I t vL u ⇔ a = b ∧ q vL r

Compression

For any set of transitions T define:

↓T =

T if ¬∃t, u ∈ T . t 6= u ∧ t vL u↓(T − {t}) where t ∈ T and ∃u ∈ T . t 6= u ∧ t vL u,

otherwise

Page 63: From NFA to minimal DFA

Definitions

Language semantics

For transitions t = (a, q) and u = (b, r):

I Language of t: L(t) = {aσ ∈ Σ+ | σ ∈ L(q)}I t vL u ⇔ a = b ∧ q vL r

Compression

For any set of transitions T define:

↓T =

T if ¬∃t, u ∈ T . t 6= u ∧ t vL u↓(T − {t}) where t ∈ T and ∃u ∈ T . t 6= u ∧ t vL u,

otherwise

Page 64: From NFA to minimal DFA

Compression

Language equivalence

For a set of transitions T :

I Language of T : L(T ) =⋃

t∈T L(t)

I Proposition: T ≡L ↓T

Uniqueness?

I ↓T is not unique for a given T

I ↓T is unique if no two states in the NFA are languageequivalent

Page 65: From NFA to minimal DFA

Compression

Language equivalence

For a set of transitions T :

I Language of T : L(T ) =⋃

t∈T L(t)

I Proposition: T ≡L ↓T

Uniqueness?

I ↓T is not unique for a given T

I ↓T is unique if no two states in the NFA are languageequivalent

Page 66: From NFA to minimal DFA

Compression

Language equivalence

For a set of transitions T :

I Language of T : L(T ) =⋃

t∈T L(t)

I Proposition: T ≡L ↓T

Uniqueness?

I ↓T is not unique for a given T

I ↓T is unique if no two states in the NFA are languageequivalent

Page 67: From NFA to minimal DFA

Compression

Language equivalence

For a set of transitions T :

I Language of T : L(T ) =⋃

t∈T L(t)

I Proposition: T ≡L ↓T

Uniqueness?

I ↓T is not unique for a given T

I ↓T is unique if no two states in the NFA are languageequivalent

Page 68: From NFA to minimal DFA

Sets of transitions

Language equivalence

I For any state p, Tp is the set of outgoing transitions of p

I L(p) = L(Tp)

∪{{λ} if p ∈ F∅ if p 6∈ F

I For any set of states P: L(P) =⋃

p∈P L(p)

DFA state

I A set of transitions T

I T does not determine whether the state is final

I Add a boolean

Page 69: From NFA to minimal DFA

Sets of transitions

Language equivalence

I For any state p, Tp is the set of outgoing transitions of p

I L(p) = L(Tp)

∪{{λ} if p ∈ F∅ if p 6∈ F

I For any set of states P: L(P) =⋃

p∈P L(p)

DFA state

I A set of transitions T

I T does not determine whether the state is final

I Add a boolean

Page 70: From NFA to minimal DFA

Sets of transitions

Language equivalence

I For any state p, Tp is the set of outgoing transitions of p

I L(p) = L(Tp) ∪{{λ} if p ∈ F∅ if p 6∈ F

I For any set of states P: L(P) =⋃

p∈P L(p)

DFA state

I A set of transitions T

I T does not determine whether the state is final

I Add a boolean

Page 71: From NFA to minimal DFA

Sets of transitions

Language equivalence

I For any state p, Tp is the set of outgoing transitions of p

I L(p) = L(Tp) ∪{{λ} if p ∈ F∅ if p 6∈ F

I For any set of states P: L(P) =⋃

p∈P L(p)

DFA state

I A set of transitions T

I T does not determine whether the state is final

I Add a boolean

Page 72: From NFA to minimal DFA

Sets of transitions

Language equivalence

I For any state p, Tp is the set of outgoing transitions of p

I L(p) = L(Tp) ∪{{λ} if p ∈ F∅ if p 6∈ F

II For any set of states P:

L(P) =⋃

p∈P L(Tp) ∪{{λ} if p ∈ F∅ if p 6∈ F

DFA state

I A set of transitions T

I T does not determine whether the state is final

I Add a boolean

Page 73: From NFA to minimal DFA

Sets of transitions

Language equivalence

I For any state p, Tp is the set of outgoing transitions of p

I L(p) = L(Tp) ∪{{λ} if p ∈ F∅ if p 6∈ F

II For any set of states P:

L(P) =⋃

p∈P L(Tp) ∪{{λ} if p ∈ F∅ if p 6∈ F

DFA state

I A set of transitions T

I T does not determine whether the state is final

I Add a boolean

Page 74: From NFA to minimal DFA

Solution 2

Algorithm

I Minimize NFA under language semantics

I Subset construction; DFA states are tuples (T , b)

I Replace every (T , b) by (↓T , b)

Implementation

I Minimize NFA under simulation semantics

I Use ⊂→ for compression

Page 75: From NFA to minimal DFA

Solution 2

Algorithm

I Minimize NFA under language semantics

I Subset construction; DFA states are tuples (T , b)

I Replace every (T , b) by (↓T , b)

Implementation

I Minimize NFA under simulation semantics

I Use ⊂→ for compression

Page 76: From NFA to minimal DFA

Conclusions

Done:

I Two algorithms for NFA −→ minimal DFA

I Aim: improve space efficiency (average case)

I Implementation trade-off: simulation semantics

I Suboptimal results

To do:

I Implement Solution 2

I Investigate performance gain in practice (benchmarking!)

I Compare to other tools

I Finish paper

Page 77: From NFA to minimal DFA

Conclusions

Done:

I Two algorithms for NFA −→ minimal DFA

I Aim: improve space efficiency (average case)

I Implementation trade-off: simulation semantics

I Suboptimal results

To do:

I Implement Solution 2

I Investigate performance gain in practice (benchmarking!)

I Compare to other tools

I Finish paper

Page 78: From NFA to minimal DFA

Conclusions

Done:

I Two algorithms for NFA −→ minimal DFA

I Aim: improve space efficiency (average case)

I Implementation trade-off: simulation semantics

I Suboptimal results

To do:

I Implement Solution 2

I Investigate performance gain in practice (benchmarking!)

I Compare to other tools

I Finish paper

Page 79: From NFA to minimal DFA

Conclusions

Done:

I Two algorithms for NFA −→ minimal DFA

I Aim: improve space efficiency (average case)

I Implementation trade-off: simulation semantics

I Suboptimal results

To do:

I Implement Solution 2

I Investigate performance gain in practice (benchmarking!)

I Compare to other tools

I Finish paper

Page 80: From NFA to minimal DFA

Conclusions

Done:

I Two algorithms for NFA −→ minimal DFA

I Aim: improve space efficiency (average case)

I Implementation trade-off: simulation semantics

I Suboptimal results

To do:

I Implement Solution 2

I Investigate performance gain in practice (benchmarking!)

I Compare to other tools

I Finish paper