Quasi-Distances and Weighted Finite Automata Timothy Ng, David - - PowerPoint PPT Presentation

quasi distances and weighted finite automata
SMART_READER_LITE
LIVE PREVIEW

Quasi-Distances and Weighted Finite Automata Timothy Ng, David - - PowerPoint PPT Presentation

. .. . .. . . .. . . .. . . .. . . . .. . .. . . .. . . .. . Quasi-Distances and Weighted Finite Automata Timothy Ng, David Rappaport, and Kai Salomaa School of Computing, Queens University DCFS 2015, Waterloo, ON .


slide-1
SLIDE 1

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Quasi-Distances and Weighted Finite Automata

Timothy Ng, David Rappaport, and Kai Salomaa

School of Computing, Queen’s University DCFS 2015, Waterloo, ON

June 27, 2015

slide-2
SLIDE 2

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Are neighbourhoods of a regular language also regular? What is the state complexity of the neighbourhood of a regular language?

slide-3
SLIDE 3

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

We use weighted finite automata to help us show the state complexity of the neighbourhood of a regular language (Salomaa, Schofield 2007).

slide-4
SLIDE 4

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

  • 1. Can additive additive WFAs recognize neighbourhoods

with respect to additive quasi-distances?

  • 2. Is there a lower bound example for the state complexity
  • f additive WFA languages over an alphabet with a

constant number of symbols?

slide-5
SLIDE 5

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

  • 1. Can additive additive WFAs recognize neighbourhoods

with respect to additive quasi-distances?

  • 2. Is there a lower bound example for the state complexity
  • f additive WFA languages over an alphabet with a

constant number of symbols?

slide-6
SLIDE 6

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

A distance is a function d : Σ∗ × Σ∗ → [0, ∞) such that

  • 1. d(x, y) = 0 if and only if x = y
  • 2. d(x, y) = d(y, x)
  • 3. d(x, y) ≤ d(x, w) + d(w, y)

If condition (1) is relaxed to d x y if x y, then d is a quasi-distance.

slide-7
SLIDE 7

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

A distance is a function d : Σ∗ × Σ∗ → [0, ∞) such that

  • 1. d(x, y) = 0 if and only if x = y
  • 2. d(x, y) = d(y, x)
  • 3. d(x, y) ≤ d(x, w) + d(w, y)

If condition (1) is relaxed to d(x, y) = 0 if x = y, then d is a quasi-distance.

slide-8
SLIDE 8

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Islington → Eglin_ton

slide-9
SLIDE 9

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Montréal → Montreal

slide-10
SLIDE 10

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

The neighbourhood of a language L ⊆ Σ∗ of radius r ≥ 0 with respect to a distance measure d is the set of all words u with d(w, u) ≤ r for some w ∈ L, E(L, d, r) = {u ∈ Σ∗ | (∃w ∈ L)d(w, u) ≤ r}.

slide-11
SLIDE 11

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

For which distances are neighbourhoods of regular languages regular for all radii r ≥ 0?

slide-12
SLIDE 12

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

A distance d on Σ∗ is additive if for all factorizations w = w1w2, we have for all r ≥ 0 E({w}, d, r) = ∪

r1+r2=r

E({w1}, d, r1) · E({w2}, d, r2)

Theorem (Calude, Salomaa, Yu 2002)

Let d be an additive quasi-distance on and L be a regular language. Then E L d r is regular for all r .

slide-13
SLIDE 13

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

A distance d on Σ∗ is additive if for all factorizations w = w1w2, we have for all r ≥ 0 E({w}, d, r) = ∪

r1+r2=r

E({w1}, d, r1) · E({w2}, d, r2)

Theorem (Calude, Salomaa, Yu 2002)

Let d be an additive quasi-distance on Σ∗ and L ⊆ Σ∗ be a regular language. Then E(L, d, r) is regular for all r ≥ 0.

slide-14
SLIDE 14

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

An additive weighted finite automaton is a 6-tuple A = (Q, Σ, γ, ω, q0, F), where

▶ Q is the set of states ▶ Σ is the alphabet ▶ γ is the transition function ▶ ω is the weight function ▶ q0 is the initial state ▶ F is the set of final states

slide-15
SLIDE 15

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Theorem (Salomaa, Schofield 2007)

Let A be an NFA, d an additive distance, and r0 ≥ 0. We can construct an additive WFA which recognizes the neighbourhood E(L(A), d, r) for any 0 ≤ r ≤ r0.

slide-16
SLIDE 16

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

This involves adding transitions with the appropriate weight. . . p . q . s . a . c We can do this because neighbourhoods of additive distances are finite.

slide-17
SLIDE 17

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

This involves adding transitions with the appropriate weight. . p . q . s . a . c . b|1 . b|1 . b|2 We can do this because neighbourhoods of additive distances are finite.

slide-18
SLIDE 18

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

How do we construct an additive WFA for neighbourhoods with respect to quasi-distances?

slide-19
SLIDE 19

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

. . start . 1 . σ|d(σ, a) . σ|d(σ, ϵ) . σ|d(σ, ϵ) . . p . q . s . a . c

slide-20
SLIDE 20

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

. . start . 1 . σ|d(σ, a) . σ|d(σ, ϵ) . σ|d(σ, ϵ) . . p . q . s . a . c

slide-21
SLIDE 21

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

. p, 0 . q, 0 . s, 0 . p, 1 . q, 1 . s, 1 . a|1 . c|1 . a|1 . c|1 . a . c|1 Compute all-pairs shortest paths and consider the paths with weight at most r.

slide-22
SLIDE 22

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Theorem

Suppose that L has an NFA with n states and d is a quasi-distance. The neighbourhood of L of radius r can be recognized by an additive WFA having n states within weight bound r.

slide-23
SLIDE 23

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

We can construct an equivalent DFA that recognizes a WFA with weight up to r. This requires at most (r + 2)n states.

Theorem (Salomaa, Schofield 2007)

Let A be an additive WFA with integer weights and r . The language L A r can be recognized by a DFA having r

n states.

slide-24
SLIDE 24

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

We can construct an equivalent DFA that recognizes a WFA with weight up to r. This requires at most (r + 2)n states.

Theorem (Salomaa, Schofield 2007)

Let A be an additive WFA with integer weights and r ∈ N. The language L(A, r) can be recognized by a DFA having (r + 2)n states.

slide-25
SLIDE 25

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

We only need to keep track of the minimal weight computation that reaches each state. (i1, i2, i3, i4, i5, i6, i7, i8) (1, 1, 0, r + 1, 4, r + 1, r + 1, r + 1)

slide-26
SLIDE 26

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

. 3 . 1 . start . 2 . 4 . · · · . n − 1 . n . a, d c, e|1 . b, c d, e|1 . a . b . b . a . a, b . a, b . a, b . a, b . c, d e|1 . c, d e|1 . c, d e|1 . c, d e|1

acknbdkn−1ackn−2 · · · ack3bdk2ck1, if n is odd; abdknackn−1bdkn−2 · · · ack3bdk2ck1, if n is even.

slide-27
SLIDE 27

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

Theorem

For n, r ∈ N, there exist an n-state WFA with integer weights defined over a five-letter alphabet such that the state complexity of L(A, r) is (r + 2)n.

slide-28
SLIDE 28

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .

What is the state complexity of additive neighbourhoods?

▶ The WFA model implies an upper bound of (r + 2)n. ▶ Is there a matching lower bound? ▶ What is the state complexity when we consider specific

distances?

slide-29
SLIDE 29

. .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. . . .. .