On transducers determinization Pierre-Alain Reynier Modelization - - PowerPoint PPT Presentation

on transducers determinization
SMART_READER_LITE
LIVE PREVIEW

On transducers determinization Pierre-Alain Reynier Modelization - - PowerPoint PPT Presentation

On transducers determinization Pierre-Alain Reynier Modelization and Verification team LIF, Aix-Marseille University & CNRS Formal methods to improve software Software systems are complex and ubiquitous critical systems reliability


slide-1
SLIDE 1

On transducers determinization

Pierre-Alain Reynier Modelization and Verification team LIF, Aix-Marseille University & CNRS

slide-2
SLIDE 2

Formal methods to improve software

Software systems are complex and ubiquitous critical systems ‹ reliability widespread ‹ efficiency, scalability ‹ need for formal methods

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 2 / 25

slide-3
SLIDE 3

Formal methods to improve software

Software systems are complex and ubiquitous critical systems ‹ reliability widespread ‹ efficiency, scalability ‹ need for formal methods Automata-based approaches: model checking controller synthesis performance evaluation model optimization Objective: Improve our theoretical understanding of automata models

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 2 / 25

slide-4
SLIDE 4

From Languages to Transductions

Languages Transductions Input ! {0, 1} Input ! Outputs automata transducers accept inputs transform inputs

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 3 / 25

slide-5
SLIDE 5

From Languages to Transductions

Languages Transductions Input ! {0, 1} Input ! Outputs automata transducers accept inputs transform inputs Applications: Word-to-word transducers:

I language and speech processing I model-checking infinite state-space systems I reactive systems I verification of web sanitizers

Nested-word-to-word transducers:

I XML transformations I model for recursive programs Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 3 / 25

slide-6
SLIDE 6

Simplification of models

General Problem

Given a (complex) model of a transformation, does there exist an equivalent simpler model? ‹ Natural question: minimization of automata determinism reduce number of registers 2way: reduce number of passes . . .

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 4 / 25

slide-7
SLIDE 7

Overview

1

Introduction

2

Determinization of transducers

3

Register minimization

4

Multi-sequentiality

5

Conclusion

slide-8
SLIDE 8

Overview

1

Introduction

2

Determinization of transducers

3

Register minimization

4

Multi-sequentiality

5

Conclusion

slide-9
SLIDE 9

Finite-state Transducers

= associate output words with transitions of a finite state automaton

Example (A transducer T)

`|✏ a|a b|✏ a|✏ Semantics JTK: f : `wa 7! a#a(w), with w 2 {a, b}⇤ Non-determinism: semantics is a relation

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 5 / 25

slide-10
SLIDE 10

Finite-state Transducers

= associate output words with transitions of a finite state automaton

Example (A transducer T)

`|✏ a|a b|✏ a|✏ Semantics JTK: f : `wa 7! a#a(w), with w 2 {a, b}⇤ Non-determinism: semantics is a relation A transducer is: functional if it realizes a function deterministic if the underlying automaton is deterministic Classes: DFT, fNFT, NFT

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 5 / 25

slide-11
SLIDE 11

Comparison of classes

DFT= Deterministic Finite-state Transducers fNFT= Functional Finite-state Transducers NFT= Non-deterministic Finite-state Transducers

Theorem

DFT ( fNFT ( NFT Examples: See blackboard

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 6 / 25

slide-12
SLIDE 12

Determinization of Finite-state Transducers

Determinization Problem

Input: a fNFTT Question: does there exist an equivalent DFT? Standard technique: subset construction starting from the set of initial states.

  • utput longest common prefix

store the unproduced outputs in the state States of the form {(p, a), (q, "), (s, bb)}

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 7 / 25

slide-13
SLIDE 13

An example

dom(f ) = Σ3 f (u) = last(u)|u|

i p1 p2 p3 q1 q2 q3

|a |a a|a |b |b b|b

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 8 / 25

slide-14
SLIDE 14

An example

dom(f ) = Σ3 f (u) = last(u)|u|

i p1 p2 p3 q1 q2 q3

|a |a a|a |b |b b|b

{(i, ε)} ⇢ (p1, a) (q1, b)

  • ⇢ (p2, aa)

(q2, bb)

  • {(p3, ε)}

{(q3, ε)}

|" |" a|aaa b|bbb

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 8 / 25

slide-15
SLIDE 15

An example

dom(f ) = Σ3 f (u) = last(u)|u|

i p1 p2 p3 q1 q2 q3

|a |a a|a |b |b b|b

{(i, ε)} ⇢ (p1, a) (q1, b)

  • ⇢ (p2, aa)

(q2, bb)

  • {(p3, ε)}

{(q3, ε)}

|" |" a|aaa b|bbb Goal: characterize termination of subset construction

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 8 / 25

slide-16
SLIDE 16

Delay between words

Definition (Longest common prefix)

Given two words u, v 2 Σ⇤, lcp(u, v) denotes the longest common prefix of u and v. Example: lcp(aaa, aab) = aa

Definition (Delay)

Given two words u, v 2 Σ⇤, we define: delay(u, v) = lcp(u, v)1.(u, v) Example: delay(aaa, aab) = (a, b)

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 9 / 25

slide-17
SLIDE 17

Twinning Property [Choffrut77]

Consider some NFTT.

Definition (Twinning Property)

We say that T satisfies the twinning property iff for all situations as depicted on the right, we have: delay(v1, w1) = delay(v1v2, w1w2)

u1|v1 u1|w1 u2|v2 u2|w2

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 10 / 25

slide-18
SLIDE 18

Characterization of sequentiality

Lemma

If a fNFT satisfies the Twinning Property, then the delays computed by the subset construction are bounded.

Corollary

Twinning Property ( ) Termination of subset construction.

Theorem ([WK95])

Twinning Property can be decided in PTime.

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 11 / 25

slide-19
SLIDE 19

An example violating the Twinning Property

dom(f ) = Σ+ f (u) = last(u)|u|

i1 i2 p1 p2

a|a b|b |a |b After reading an input word u: longest common prefix of outputs = " subset construction ◆ {(i1, a|u|), (i2, b|u|)} ‹ The subset construction does not terminate. The TP is violated: consider synchronised loops around i1 and i2.

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 12 / 25

slide-20
SLIDE 20

Overview

1

Introduction

2

Determinization of transducers

3

Register minimization

4

Multi-sequentiality

5

Conclusion

slide-21
SLIDE 21

Streaming String Transducers [Alur and Cerny, 2010]

Definition

Streaming String Transducers (SST for short) are defined as deterministic Finite-state automata extended with registers. Register updates allowed have the following form: X := u · Y · v X := YZ where X, Y , Z denote registers and u, v are words in Σ⇤.

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 13 / 25

slide-22
SLIDE 22

Streaming String Transducers [Alur and Cerny, 2010]

Definition

Streaming String Transducers (SST for short) are defined as deterministic Finite-state automata extended with registers. Register updates allowed have the following form: X := u · Y · v X := YZ where X, Y , Z denote registers and u, v are words in Σ⇤. Examples: X ` a, X := X.a b, X := X a `wa 7! a#a(w)

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 13 / 25

slide-23
SLIDE 23

Streaming String Transducers [Alur and Cerny, 2010]

Definition

Streaming String Transducers (SST for short) are defined as deterministic Finite-state automata extended with registers. Register updates allowed have the following form: X := u · Y · v X := YZ where X, Y , Z denote registers and u, v are words in Σ⇤. Examples: XaXb ` a, ⇢ Xa := Xa.a Xb := Xb b, ⇢ Xa := Xa Xb := Xb.b a `wa 7! a#a(w)b#b(w)

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 13 / 25

slide-24
SLIDE 24

Another example of SST

Consider the following SST:

pa

Xa

pb

Xb b, upd a, upd a, upd b, upd where upd: ⇢ Xa := Xa.a Xb := Xb.b Which function does it realize?

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 14 / 25

slide-25
SLIDE 25

Another example of SST

Consider the following SST:

pa

Xa

pb

Xb b, upd a, upd a, upd b, upd where upd: ⇢ Xa := Xa.a Xb := Xb.b Which function does it realize? Solution: dom(f ) = Σ⇤ f (u) = last(u)|u|

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 14 / 25

slide-26
SLIDE 26

Examples of SST

How to implement these transformations? mirror u = a1 . . . an 7! ˜ u = an . . . a1

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 15 / 25

slide-27
SLIDE 27

Examples of SST

How to implement these transformations? mirror u = a1 . . . an 7! ˜ u = an . . . a1 copy u 7! uu

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 15 / 25

slide-28
SLIDE 28

Examples of SST

How to implement these transformations? mirror u = a1 . . . an 7! ˜ u = an . . . a1 copy u 7! uu mirror and copy u 7! ˜ uu

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 15 / 25

slide-29
SLIDE 29

Examples of SST

How to implement these transformations? mirror u = a1 . . . an 7! ˜ u = an . . . a1 copy u 7! uu mirror and copy u 7! ˜ uu replace u#v 7! v[a u]

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 15 / 25

slide-30
SLIDE 30

Examples of SST

How to implement these transformations? mirror u = a1 . . . an 7! ˜ u = an . . . a1 copy u 7! uu mirror and copy u 7! ˜ uu replace u#v 7! v[a u] replace2 (k is fixed) u1# . . . #uk#v 7! v[ai ui] How many registers did you use? Is this number minimal?

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 15 / 25

slide-31
SLIDE 31

Expressiveness results

Comparison of SST and Finite-state Transducers New class: Two-way Deterministic Finite-state Transducers (2DFT)

expressiveness

DFTs fNFTs 2DFTs ( (

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 16 / 25

slide-32
SLIDE 32

Expressiveness results

Comparison of SST and Finite-state Transducers New class: Two-way Deterministic Finite-state Transducers (2DFT)

expressiveness

DFTs fNFTs 2DFTs ( ( ⌘ 1-register appending SST

  • nly

X := Xu

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 16 / 25

slide-33
SLIDE 33

Expressiveness results

Comparison of SST and Finite-state Transducers New class: Two-way Deterministic Finite-state Transducers (2DFT)

expressiveness

DFTs fNFTs 2DFTs ( ( ⌘ 1-register appending SST

  • nly

X := Xu ⌘ appending SST

  • nly

X := Yu

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 16 / 25

slide-34
SLIDE 34

Expressiveness results

Comparison of SST and Finite-state Transducers New class: Two-way Deterministic Finite-state Transducers (2DFT)

expressiveness

DFTs fNFTs 2DFTs ( ( ⌘ 1-register appending SST

  • nly

X := Xu ⌘ appending SST

  • nly

X := Yu ⌘ copyless SST forbid (X, Y ) := (X, X)

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 16 / 25

slide-35
SLIDE 35

Expressiveness results

Comparison of SST and Finite-state Transducers New class: Two-way Deterministic Finite-state Transducers (2DFT)

expressiveness

DFTs fNFTs 2DFTs ( ( ⌘ 1-register appending SST

  • nly

X := Xu ⌘ appending SST

  • nly

X := Yu ⌘ copyless SST forbid (X, Y ) := (X, X) ( SST

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 16 / 25

slide-36
SLIDE 36

Expressiveness results

Comparison of SST and Finite-state Transducers New class: Two-way Deterministic Finite-state Transducers (2DFT)

expressiveness

DFTs fNFTs 2DFTs ( ( ⌘ 1-register appending SST

  • nly

X := Xu ⌘ appending SST

  • nly

X := Yu ⌘ copyless SST forbid (X, Y ) := (X, X) ( SST ‹ Long-term objective: Register Minimization for SST

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 16 / 25

slide-37
SLIDE 37

Register minimization for appending SST

dom(f ) = Σ⇤ f (u) = last(u)|u| upd: ⇢ Xa := Xa.a Xb := Xb.b

pa

Xa

pb

Xb b, upd a, upd a, upd b, upd ‹ can be realized with 2 registers Can we do better?

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 17 / 25

slide-38
SLIDE 38

Register minimization for appending SST

dom(f ) = Σ⇤ f (u) = last(u)|u| upd: ⇢ Xa := Xa.a Xb := Xb.b

pa

Xa

pb

Xb b, upd a, upd a, upd b, upd ‹ can be realized with 2 registers Can we do better? No! 1 register is DFT

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 17 / 25

slide-39
SLIDE 39

Register minimization for appending SST

dom(f ) = Σ⇤ f (u) = last(u)|u| upd: ⇢ Xa := Xa.a Xb := Xb.b

pa

Xa

pb

Xb b, upd a, upd a, upd b, upd ‹ can be realized with 2 registers Can we do better? No! 1 register is DFT

Register Complexity Problem

Input: An appending SST T and an integer k Question: Does there exist a k-appending SST T 0 with T ⌘ T 0?

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 17 / 25

slide-40
SLIDE 40

Register complexity using Twinning Property [LICS’16]

Intuition: 2 registers needed if there are 2 runs generating arbitrarily large delays k registers needed if there are k runs generating pairwise arb. large delays

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 18 / 25

slide-41
SLIDE 41

Register complexity using Twinning Property [LICS’16]

Intuition: 2 registers needed if there are 2 runs generating arbitrarily large delays k registers needed if there are k runs generating pairwise arb. large delays Contraposition:

T satisfies the Twinning Property of order k if:

k synchronised loops

for every situation like:

k + 1 runs

‹ there are two runs that remain ”close”

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 18 / 25

slide-42
SLIDE 42

Register complexity using Twinning Property [LICS’16]

Lemma

If T satisfies the TP of order k, then from any set of runs on the same input word, one can extract k runs such that every run is ”close” from one

  • f these k runs.

Theorem

A fNFT is definable by a k-appending SST iff it satisfies the TP of order k.

Theorem

Given a fNFT T and k (in unary), deciding whether T satisfies the TP of

  • rder k is PSpace-complete.

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 19 / 25

slide-43
SLIDE 43

Register complexity using Twinning Property [LICS’16]

An example: how many registers for the following function? f : u1#u2 7! last(u1)|u1|#last(u2)|u2|

a|a a|a b|b b|b #|# #|# #|# #|# a|a b|b a|a b|b |a |a |b |b |a |b |a |b

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 20 / 25

slide-44
SLIDE 44

Register complexity using Twinning Property [LICS’16]

An example: how many registers for the following function? f : u1#u2 7! last(u1)|u1|#last(u2)|u2|

a|a a|a b|b b|b #|# #|# #|# #|# a|a b|b a|a b|b |a |a |b |b |a |b |a |b

Only 2 registers!

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 20 / 25

slide-45
SLIDE 45

Register complexity using Twinning Property [LICS’16]

An example: how many registers for the following function? f : u1#u2 7! last(u1)|u1|#last(u2)|u2|

pa pb

b, upd a, upd a, upd b, upd Xa Xb b, upd a, upd a, upd b, upd #, Xa := Xb.# Xb := Xb.# #, Xa := Xa.# Xb := Xa.#

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 20 / 25

slide-46
SLIDE 46

Overview

1

Introduction

2

Determinization of transducers

3

Register minimization

4

Multi-sequentiality

5

Conclusion

slide-47
SLIDE 47

Multi-sequential functions [CS86]

Definition

A function f is multi-sequential if there exists a finite number of DFTs T1, . . . , Tn such that f = S

iJTiK

Example: f (u) = last(u)|u|

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 21 / 25

slide-48
SLIDE 48

Multi-sequential functions [CS86]

Definition

A function f is multi-sequential if there exists a finite number of DFTs T1, . . . , Tn such that f = S

iJTiK

Example: f (u) = last(u)|u|

Theorem

DFT ( multi-seq ( fNFT Examples: see blackboard

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 21 / 25

slide-49
SLIDE 49

Multi-sequential functions [CS86]

Definition

A function f is multi-sequential if there exists a finite number of DFTs T1, . . . , Tn such that f = S

iJTiK

Example: f (u) = last(u)|u|

Theorem

DFT ( multi-seq ( fNFT Examples: see blackboard

k-sequentiality Problem

Input: A fNFTT and an integer k Question: Does there exist k DFTT1, . . . , Tk such that JTK = S

iJTiK?

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 21 / 25

slide-50
SLIDE 50

Multi-sequential functions as SST [FoSSaCS’17]

Theorem

A function can be realized as a union of k DFT iff it can be realized by a SST with k registers and updates of the form X := Xu. ‹ Solving the k-sequentiality problem amounts to solve register minimization in this class.

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 22 / 25

slide-51
SLIDE 51

Multi-sequential functions as SST [FoSSaCS’17]

Theorem

A function can be realized as a union of k DFT iff it can be realized by a SST with k registers and updates of the form X := Xu. ‹ Solving the k-sequentiality problem amounts to solve register minimization in this class. ‹ introduction of a “Branching” Twinning Property of order k (input words can be different between runs)

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 22 / 25

slide-52
SLIDE 52

Multi-sequential functions as SST [FoSSaCS’17]

Theorem

A function can be realized as a union of k DFT iff it can be realized by a SST with k registers and updates of the form X := Xu. ‹ Solving the k-sequentiality problem amounts to solve register minimization in this class. ‹ introduction of a “Branching” Twinning Property of order k (input words can be different between runs)

Theorem

A fNFT is definable by a union of k DFT iff it satisfies the Branching TP

  • f order k.

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 22 / 25

slide-53
SLIDE 53

Multi-sequential functions as SST [FoSSaCS’17]

Theorem

A function can be realized as a union of k DFT iff it can be realized by a SST with k registers and updates of the form X := Xu. ‹ Solving the k-sequentiality problem amounts to solve register minimization in this class. ‹ introduction of a “Branching” Twinning Property of order k (input words can be different between runs)

Theorem

A fNFT is definable by a union of k DFT iff it satisfies the Branching TP

  • f order k.

Theorem

Given a fNFT T and k (in unary), deciding whether T satisfies the Branching TP of order k is PSpace-complete.

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 22 / 25

slide-54
SLIDE 54

Example

Consider this function: f : u1#u2 7! last(u1)|u1|#last(u2)|u2| Is it 2-sequential? Is it 3-sequential? Is it 4-sequential?

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 23 / 25

slide-55
SLIDE 55

Example

Consider this function: f : u1#u2 7! last(u1)|u1|#last(u2)|u2| Is it 2-sequential? Is it 3-sequential? Is it 4-sequential? Minimum=4 a | a b | a b | a a | a a | a b | a b | a a | a # | # a | a b | a b | a a | a b | b a | b a | b b | b # | # b | b a | b a | b b | b a | a b | a b | a a | a # | # b | b a | b a | b b | b b | b a | b a | b b | b # | #

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 23 / 25

slide-56
SLIDE 56

Overview

1

Introduction

2

Determinization of transducers

3

Register minimization

4

Multi-sequentiality

5

Conclusion

slide-57
SLIDE 57

Summary

Some “old” results: Finite-state Transducers Determinization not always possible for transducers Twinning Property to characterize determinizability Recent applications to: Streaming String Transducer Register minimization Multi-sequential functions

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 24 / 25

slide-58
SLIDE 58

Summary

Some “old” results: Finite-state Transducers Determinization not always possible for transducers Twinning Property to characterize determinizability Recent applications to: Streaming String Transducer Register minimization Multi-sequential functions I did not present...

  • ther decidability results (2Way ; 1Way)

logical characterization algebraic characterization

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 24 / 25

slide-59
SLIDE 59

Some perspectives

Extend register minimization to larger classes of SST

  • ngoing work on updates X := uYv

algebraic presentation, canonical object Specification languages for transformations Alternative semantics to break undecidability/high complexity

Pierre-Alain Reynier (LIF, team MoVe) On transducers determinization Nov 23, 2017 25 / 25

slide-60
SLIDE 60

The Modelization and Verification team

Research topics:

  • Language theory

transducers, higher-order languages, weighted automata

  • Algorithmic verification

infinite state systems such as Petri nets, timed systems

  • Security applications

workflows, access control, quantitative information flow

slide-61
SLIDE 61

The Modelization and Verification team

slide-62
SLIDE 62

Thanks!