Prediction of Infinite Words with Automata Tim Smith LIGM - - PowerPoint PPT Presentation

prediction of infinite words with automata
SMART_READER_LITE
LIVE PREVIEW

Prediction of Infinite Words with Automata Tim Smith LIGM - - PowerPoint PPT Presentation

Prediction of Infinite Words with Automata Tim Smith LIGM Universit Paris-Est Marne-la-Valle EQINOCS workshop, Paris 11 May 2016 1 Prediction Setting We consider an emitter and a predictor. The emitter takes no input,


slide-1
SLIDE 1

Tim Smith

LIGM Université Paris-Est Marne-la-Vallée

1

EQINOCS workshop, Paris

Prediction of Infinite Words with Automata

11 May 2016

slide-2
SLIDE 2

Prediction Setting

  • We consider an “emitter” and a “predictor”.
  • The emitter takes no input, but just emits

symbols one at a time, continuing indefinitely.

  • The predictor receives each symbol output

by the emitter, and tries to guess the next symbol.

  • We say that the predictor “masters” the

emitter if there is a point after which all of the predictor’s guesses are correct.

2

slide-3
SLIDE 3

Our Model

  • We view the emitter as an infinite word α, i.e., an

infinite sequence of symbols drawn from a finite alphabet A.

  • We view the predictor as an automaton M whose

input is α and whose output is an infinite word M(α). We call each symbol of M(α) a guess.

  • M is required to output the i-th symbol of M(α)

before it can read the i-th symbol of α.

  • If for some n ≥ 1, for all i ≥ n, M(α)[i] = α[i],

then M masters α.

3

slide-4
SLIDE 4

Prediction Example

  • A DFA predictor is a DFA which takes an

infinite word as input, and on each transition, tries to guess the next symbol.

  • Consider a DFA predictor M which always

guesses that the next symbol is a.

  • An ultimately periodic word is an infinite word
  • f the form xyω = xyyy... for some x,y in A*.
  • M masters aω, baω, abaω, bbaω, ..., i.e., every

ultimately periodic word ending in aω.

4

slide-5
SLIDE 5

Limitations of DFA predictors

  • A purely periodic word is an infinite word of the

form xω = xxx... for some x in A*.

  • Theorem: No DFA predictor masters every

purely periodic word.

  • Proof by contradiction: Suppose there is a DFA

predictor M which masters every purely periodic word. Let n be the number of states

  • f M. Then M does not master the purely

periodic word (an+1 b)ω.

5

slide-6
SLIDE 6

Research Direction

  • [Smith 2016] Prediction of infinite words with

automata CSR 2016 (forthcoming)

  • Considers various classes of automata and infinite

words in a prediction setting.

  • Studies the question of which automata can master

which infinite words.

  • Motivation: Make connections among automata,

infinite words, and learning theory, via the notion of mastery or “learning in the limit” [Gold 1967].

6

slide-7
SLIDE 7

Automata Considered

7

Class Name

DFA deterministic finite automata DPDA deterministic pushdown automata DSA deterministic stack automata multi-DFA multihead deterministic finite automata sensing multi-DFA sensing multihead deterministic finite automata

  • All of the automata have a one-way input tape.
slide-8
SLIDE 8

Infinite Words Considered

8

Class Example

purely periodic words ababab... ultimately periodic words abaaaaa... multilinear words abaabaaab...

  • We have the proper containments:
  • purely periodic ⊂ ultimately periodic ⊂ multilinear
slide-9
SLIDE 9

Prediction Results

9

∃ masters ∀ purely periodic ultimately periodic multilinear DFA DPDA DSA multi-DFA sensing multi-DFA

✕ ✕ ✕

infinite words automata

slide-10
SLIDE 10

Multihead Finite Automata

  • Finite automata with one or more input heads on a

single tape [Rosenberg 1965].

  • We are interested in multi-DFA, the class of one-way

multihead deterministic finite automata.

  • What are the predictive capabilities of multi-DFA?

10

multi-DFA = [

k≥1

k-DFA

slide-11
SLIDE 11

Prediction by Multihead Automata

  • Theorem: Some multihead DFA masters every

ultimately periodic word.

  • Construction:

Variation of the “tortoise and hare”

  • algorithm. Let M be a two-head DFA which

always guesses that the symbols under the heads will match, and

  • if the last guess was correct, M moves each

head one square to the right;

  • otherwise, M moves the left head one square

to the right and the right head two squares to the right.

11

slide-12
SLIDE 12

12

α = (aaab)ω

a ?

2-head DFA which masters all ultimately periodic words

slide-13
SLIDE 13

13

α = (aaab)ω

a a X

2-head DFA which masters all ultimately periodic words

slide-14
SLIDE 14

14

α = (aaab)ω

a a ?

2-head DFA which masters all ultimately periodic words

slide-15
SLIDE 15

15

α = (aaab)ω

a a a X

2-head DFA which masters all ultimately periodic words

slide-16
SLIDE 16

16

α = (aaab)ω

a a a ?

2-head DFA which masters all ultimately periodic words

slide-17
SLIDE 17

17

α = (aaab)ω

a a a b ×

2-head DFA which masters all ultimately periodic words

slide-18
SLIDE 18

18

α = (aaab)ω

a a a b a ?

2-head DFA which masters all ultimately periodic words

slide-19
SLIDE 19

19

α = (aaab)ω

a a a b a a ×

2-head DFA which masters all ultimately periodic words

slide-20
SLIDE 20

20

α = (aaab)ω

a a a b a a a ?

2-head DFA which masters all ultimately periodic words

slide-21
SLIDE 21

21

α = (aaab)ω

a a a b a a a b ×

2-head DFA which masters all ultimately periodic words

slide-22
SLIDE 22

22

α = (aaab)ω

a a a b a a a b a ?

2-head DFA which masters all ultimately periodic words

slide-23
SLIDE 23

23

α = (aaab)ω

a a a b a a a b a a X

2-head DFA which masters all ultimately periodic words

slide-24
SLIDE 24

24

α = (aaab)ω

a a a b a a a b a a ?

2-head DFA which masters all ultimately periodic words

slide-25
SLIDE 25

25

α = (aaab)ω

a a a b a a a b a a a X

2-head DFA which masters all ultimately periodic words

slide-26
SLIDE 26

26

α = (aaab)ω

a a a b a a a b a a a ?

2-head DFA which masters all ultimately periodic words

slide-27
SLIDE 27

27

α = (aaab)ω

a a a b a a a b a a a b X

2-head DFA which masters all ultimately periodic words

slide-28
SLIDE 28

Prediction Results

28

∃ masters ∀ purely periodic ultimately periodic multilinear DFA DPDA DSA multi-DFA sensing multi-DFA

✕ ✕ ✕

✓ ✓ ✓ ✓

infinite words automata

slide-29
SLIDE 29

DPDA predictors

  • [Smith 2016] No DPDA predictor masters every purely

periodic word.

  • Proof idea:
  • Suppose there is a DPDA predictor M which masters

every purely periodic word. Set n to be very large with respect to the number of states of M and the size of the stack alphabet. Let α = (an b)ω.

  • We show that in some block of consecutive a’s, there

are configurations Ci and Cj of M with the same state and top-of-stack symbol, such that the stack below the top symbol at Ci is not accessed between Ci and Cj. Then M does not master α.

29

slide-30
SLIDE 30

Stack Automata

  • Generalization of pushdown automata due

to [Ginsburg, Greibach, & Harrison 1967].

  • In addition to pushing and popping at the

top of the stack, the stack head can move up and down the stack in read-only mode.

  • We consider DSA, the class of one-way

deterministic stack automata.

30

read push/pop

slide-31
SLIDE 31

Prediction with Stack Automata

  • [Smith 2016] Some DSA predictor masters every purely

periodic word.

  • Algorithm: The goal is to build up the stack until it holds the

period of the word.

  • The stack automaton M makes guesses by repeatedly

matching its stack against the input. Call each traversal of the stack a “pass”.

  • In the event of a mismatch, M finishes the current pass, then

continues making passes until one succeeds with no

  • mismatches. Then it pushes the next symbol of the input
  • nto the stack and continues as before.
  • Eventually the stack holds the period and M achieves mastery.

31

slide-32
SLIDE 32

32

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · ?

slide-33
SLIDE 33

33

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a X

slide-34
SLIDE 34

34

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a ?

slide-35
SLIDE 35

35

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b X

slide-36
SLIDE 36

36

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b ?

slide-37
SLIDE 37

37

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c X

slide-38
SLIDE 38

38

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c ?

slide-39
SLIDE 39

39

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a X

slide-40
SLIDE 40

40

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a ?

slide-41
SLIDE 41

41

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a a ×

slide-42
SLIDE 42

42

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a a ?

slide-43
SLIDE 43

43

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a a b ×

slide-44
SLIDE 44

44

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a a b ?

slide-45
SLIDE 45

45

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a a b ? h h

slide-46
SLIDE 46

46

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a a b c · · · ? h h h|x|

slide-47
SLIDE 47

47

Stack automaton which masters all purely periodic words

α = xω

a b c stack · · · a b c a a b c · · · a b c h h h|x|

slide-48
SLIDE 48

48

Stack automaton which masters all purely periodic words

α = xω

a b c a stack · · · a b c a a b c · · · a b c a h h h|x|

slide-49
SLIDE 49

49

Stack automaton which masters all purely periodic words

α = xω

a b c a stack · · · a b c a a b c · · · a b c a ? h h h|x|

slide-50
SLIDE 50

Prediction Results

50

∃ masters ∀ purely periodic ultimately periodic multilinear DFA DPDA DSA multi-DFA sensing multi-DFA

✕ ✕ ✕ ✕ ✕ ✕

? ?

✓ ✓ ✓ ✓

infinite words automata

slide-51
SLIDE 51

Multilinear Words

  • An infinite word α is multilinear if it has the form
  • Thus, α is broken into blocks, each consisting of

m segments of the form pisin.

  • Example:
  • [Endrullis et al. 2011], [Smith 2013]
  • Normal form (unless α is ultimately periodic):
  • pi ≠ ε, si ≠ ε, si[1] ≠ pi+1[1], and sm[1] ≠ p1[1]

51

q Y

n≥1 m

Y

i≥1

pisn

i

Y

n≥1

abncn = abcabbccabbbccc · · ·

slide-52
SLIDE 52

Predicting Multilinear Words

  • We have seen that there is a two-head DFA which

masters every ultimately periodic word.

  • Can some multihead DFA master every multilinear

word? Open problem.

  • We consider sensing multihead DFAs, an extension of

multihead DFAs able to sense, for each pair of heads, whether those two heads are at the same input position.

  • [Smith 2016] Some sensing multihead DFA masters

every multilinear word.

52

slide-53
SLIDE 53

Algorithm which masters every multilinear word

  • The correction procedure

tries to line up certain heads at segment boundaries so that the number of segments separating the heads is a multiple of m.

  • The matching procedure

tries to master the input α

  • n the assumption that the

correction procedure has successfully lined up the heads.

53

k = 0 loop k += 1 correction procedure matching procedure

  • Uses a 10-head sensing DFA.

Alternates between two procedures, correction and matching, with an increasing threshold k.

slide-54
SLIDE 54

Correction Procedure

  • Tries to line up the heads

h1, h2, h3, and h4 to be k segments apart.

  • k is a threshold which

increases each time the procedure is entered.

  • When the procedure is

entered, h1 < h2 < h3 < h4.

  • Uses a subroutine advance

whose successful operation depends on k.

54

move h1 until h1 = h4 advance h1 by 1 segment move h2 until h2 = h1 advance h2 by k segments move h3 until h3 = h2 advance h3 by k segments move h4 until h4 = h3 advance h4 by k segments

slide-55
SLIDE 55

advance subroutine

  • Tries to advance a given head

hi past its current segment pjsjn, leaving hi at pj+1.

  • Uses a threshold k which

increases between calls to the subroutine.

  • Follows tortoise and hare

algorithm until the number of consecutive correct guesses reaches k.

  • Finally, moves t and hi

together until they disagree.

55

move t until t = hi move hi correct = 0 while correct < k if α[t] = α[hi] correct += 1 else correct = 0 move hi move t and hi while α[t] = α[hi] move t and hi

slide-56
SLIDE 56

Matching Procedure

  • Tries to master the

multilinear word α.

  • Works if h1, h2, h3, and h4 are

a multiple of m segments apart, where m is the number

  • f segments per block of α.
  • Uses h1, h2, and h3 to

coordinate and predict α[h4].

  • If any guess is incorrect, exits

so that the correction procedure can be called again.

56

loop move h3a until h3a = h3 while α[h1] = α[h2] = α[h3] = α[h4] move h1, h2, h3a, h3 move h4, guessing α[h2] exit procedure if guess was wrong while α[h2] = α[h3] = α[h4] move h2, h3 move h4, guessing α[h3] exit procedure if guess was wrong while α[h3a] = α[h3] = α[h4] move h3a, h3 move h4, guessing α[h3a] exit procedure if guess was wrong while h3a ≠ h3 and α[h3a] = α[h4] move h3a move h4, guessing α[h3a] exit procedure if guess was wrong

slide-57
SLIDE 57

Prediction Results

57

∃ masters ∀ purely periodic ultimately periodic multilinear DFA DPDA DSA multi-DFA sensing multi-DFA

✕ ✕ ✕ ✕ ✕ ✕

? ?

✓ ✓

?

✓ ✓ ✓

infinite words automata

slide-58
SLIDE 58

Further Work

  • Consider other classes of automata and infinite

words to see what connections can be made among them in a prediction setting.

  • Open problems:
  • Can some DSA master every ultimately

periodic word?

  • Can some (non-sensing) multi-DFA master

every multilinear word?

58

slide-59
SLIDE 59

Thank you!

59