tilingand walking - uni-giessen.de

41
Tiling and Walking automata on trees and grids Hendrik Jan Hoogeboom Workshop on Non-Classical Models of Automata and Applications August 31 - September 1, 2009, Wroclaw, Poland Hendrik Jan Hoogeboom Leiden

Upload: others

Post on 14-Apr-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tilingand Walking - uni-giessen.de

Tiling and Walkingautomata on trees and grids

Hendrik Jan Hoogeboom

Workshop on

Non-Classical Models of Automata and Applications

August 31 - September 1, 2009, Wroclaw, Poland

Hendrik Jan HoogeboomLeiden

Page 2: Tilingand Walking - uni-giessen.de

themes

acceptanceacceptanceacceptanceacceptance• tiling a global labelling• walking a local control

structuresstructuresstructuresstructures• strings• strings• trees• pictures• …

pebblespebblespebblespebbles• non-classical

Page 3: Tilingand Walking - uni-giessen.de

background

� XML document transformationXML document transformationXML document transformationXML document transformation

M

� graph explorationgraph explorationgraph explorationgraph explorationmany heads on graphs ‘robots’grids, toruses, mazes, …

Page 4: Tilingand Walking - uni-giessen.de

bottom-up tree automaton

∨∨∨∨∨∨∨∨

∧∧∧∧ ∨∨∨∨

T∨∨∨∨

∧∧∧∧

1111

1111

1111

1111

0000

1111

1111

1111

1111

1111

0000 00001111

∧∧∧∧0000

00000000

0000

∨∨∨∨0000

00000000

1111

FT00001111rules:

TF TF

T∧∧∧∧∨∨∨∨F FT1111 0000

1111

1111

11110000

0000 0000

0000

1111∧∧∧∧0000

00001111

∧∧∧∧0000

11110000

∧∧∧∧1111

11111111

∨∨∨∨1111

00001111

∨∨∨∨1111

11110000

∨∨∨∨1111

11111111

bottom-up evaluation

Page 5: Tilingand Walking - uni-giessen.de

walking along the tree

∨∨∨∨∨∨∨∨

∧∧∧∧ ∨∨∨∨

∨∨∨∨

∧∧∧∧

1111

1111

1111

1111

0000

1111

1111

1111

11110000 1111

∧∧∧∧0000

00001111

∨∨∨∨0000

00000000

∨∨∨∨1111

11110000

21

21 21

∧∧∧∧0000

00001

?

TF F

T∧∧∧∧∨∨∨∨F T1111 0000

1111

1111

0000

0000

0000

111100001111

∧∧∧∧1111

11111111

11110000

FT00001111

21∨∨∨∨

1111

11111

?

?

cf. two-way finite state automaton

evaluates and/or trees !

Page 6: Tilingand Walking - uni-giessen.de

tree walking automaton

3 1

H

internal:down1

leaf

ch2:up

root

example: complete pre order tree traversal

11

at internal node

move to first child

2 down2ch1:up

walk along edges, moves based on• state• node label• child number

(= incoming edge)

∧∧∧∧

21

2lab

ch

2

1

3

Page 7: Tilingand Walking - uni-giessen.de

strings: 2way automata

‘visit sequences’

Rabin&Scott, Shepherdson (1959)

Page 8: Tilingand Walking - uni-giessen.de

pictures (arrays, lattices)

tiling: Γ-markings match# # tiling: Γ-markings match

language: Σ-labelled rectangles

TILE

recognizable REC

(Giammarresi & Restivo, Handbook FLT 1997)

Wang tiles

local lattice languages h(LLL)

1

#

0#

0

#

#0

1

1#

0

#1

Page 9: Tilingand Walking - uni-giessen.de

squares ∈ TILE

may add more colours 9

, …,,,,

0

1

1#

1

#

0#

1

0

01

0

#

00

0

0

00

0

0

0#

0

1

10

1

0

01

#

0

0#

#

0

00

#

1

10

0

#

#0

0

0

#0

#

0

#1

0

1

1#

1

#

0#

1

0

01

0

#

00

0

0

00

0

0

0#

0

1

10

1

0

01

#

0

0#

#

0

00

#

1

10

0

#

#0

0

0

#0

0

0

#0

#

0

#1

0

#

00

#

#

##

#

1

1#

Page 10: Tilingand Walking - uni-giessen.de

other languages in TILE over pictures

• binary counting

• connected area (*)

• equal numbers (**)

(Reinhardt)

Page 11: Tilingand Walking - uni-giessen.de

not closed complement

equal- �∈ TILE

X y

(Kari & Moore, STACS 2001)

unequal- ∈ TILE

Page 12: Tilingand Walking - uni-giessen.de

picture walking

odd squares:

middle cell blue

‘four-way automaton’

nondeterministic

Page 13: Tilingand Walking - uni-giessen.de

examples

“By bouncing like a billiard ball or making knights' moves, and

ending one cell from the corner, a DFA can check that the two sides

of a rectangle are mutually prime,

or that the side of a square is a power of 2”

avoid infinite loops!

(Lindgren, Moore & Nordahl, J. Stat. Phys. 1998)

Page 14: Tilingand Walking - uni-giessen.de

tree automata as tiling system

∨∨∨∨1111

11110000

1111

∨∨∨∨

1111

1111

11110000

∧∧∧∧1111

T1111

T

####

TF TF

∨∨∨∨

T∧∧∧∧

∨∨∨∨

∨∨∨∨F

∧∧∧∧

FT

∨∨∨∨

T∨∨∨∨

∧∧∧∧

1111

1111

1111

1111

0000

1111

1111

1111

1111

1111

11110000

0000 0000

0000

1111

Page 15: Tilingand Walking - uni-giessen.de

not accepted by walking

equivalent n×2n ‘chunks’ (k states)

1 2n

n

#

#

(Inoue & Nakamura, 1977)

equivalent n×2 ‘chunks’ (k states)

inout

outout

Page 16: Tilingand Walking - uni-giessen.de

TILE vs. WALK

WALK ⊆⊆⊆⊆ TILE

visit sequences

WALK = TILE (REG) strings

WALK ⊂⊂⊂⊂ TILE (REG) trees (open untill 2005!)

WALK ⊂⊂⊂⊂ TILE (REC) pictures ‘chunks’

Page 17: Tilingand Walking - uni-giessen.de

‘branching structure’ of even lengthBojańczyk & Colcombet STOC, 2005

WALK ⊂⊂⊂⊂ TILE

bbbb

branching? for trees

not by WALKbut FO

aa

aaaaa

a

bbbb

ba

a

bb

Page 18: Tilingand Walking - uni-giessen.de

ADDING PEBBLES

Page 19: Tilingand Walking - uni-giessen.de

pebbles to mark nodesBojańczyk & Colcombet

bbbb

WALK ⊂⊂⊂⊂ TILEfor trees

not by WALKbut PBBL

using a pebbleto determine branching

aa

aaaaa

a

bbbb

ba

a

bb

Page 20: Tilingand Walking - uni-giessen.de

adding nested pebbles to the TWA

pebblepebblepebblepebble: mark a node

dropretrieve

� fixed number for automaton� can be distinguished & reused� used to determine where to go

PBBL ⊆ REG

� nested lifetimesnested lifetimesnested lifetimesnested lifetimes ‘stack discipline’

‘regular’ extension

1111

2222

3333

2222

for trees

Page 21: Tilingand Walking - uni-giessen.de

beware of the pebble

a a a b b b

1111

2222

3333

2222

1111 2222

avoid counting

a a a b b b

1111 2222

a a a b b b

1111 2222

a a a b b b a a a b b b a a a b b b

a a a b b b

1111 2222

a a a b b b

1111 2222

a a a b b b

1111 2222

► nest!

► bounded number!

1111 2222 1111 22221111 2222

general: LOGSPACE

Page 22: Tilingand Walking - uni-giessen.de

power of tree walking automata

WALK ⊆ REG

WALK ⊂⊂⊂⊂ REG

Bojańczyk & Colcombet STOC’05

(≡TILE)

“tree walking automata easily loose their way”(even with the help of pebbles)

PBBL ⊆ REG

PBBL ⊂⊂⊂⊂ REG

Bojańczyk, Samuelides,

Schwentick & Segoufin ICALP'06

Engelfriet & H ‘99

Page 23: Tilingand Walking - uni-giessen.de

nested pebbles on strings

single pebblekeep track of excursions

p

qq

similar techniques in trees

PBBL = WALK = TILEfor strings

Page 24: Tilingand Walking - uni-giessen.de

single pebble on pictures

equal- �∈ TILE

unequal- ∈ TILE

(un)equal- ∈ 1PBBL

(cf. Nakamura, ‘one-pebble rectangular array acceptors’, IPL, 1981)

X y

Page 25: Tilingand Walking - uni-giessen.de

CONNECTIONS TO LOGIC

Page 26: Tilingand Walking - uni-giessen.de

labelled graphs

a

1

2

2

3

3

1 1 1

1 1 1

1 1 1

2 2 2 2

2 2 2 2

edges:locally injective

1 1 1

2 2 2 2

picture=grid, torus

locally injective

ffff

k1 2

trees

Page 27: Tilingand Walking - uni-giessen.de

mso logic

x,y node variablesX,Y node sets

laba(x)edgi(x,y)x ≤ y (partial order)

i

x y

ax

x = yx ∈ X

¬ ∧∧∧∧ ∨∨∨∨ connectives ∀∀∀∀x ∃∃∃∃x quantification (nodes)∀∀∀∀X ∃∃∃∃X (sets)

FO first orderEMSO existential mso

Page 28: Tilingand Walking - uni-giessen.de

example (strings)

next a

no position in between has a

number of a’s is even

there exists a set X that contains

every other position with aevery other position with a

b a a b a b b a a b b a

Page 29: Tilingand Walking - uni-giessen.de

classic

closed formula a language

for strings, treesMSO = REG (aka TILE)

for picturesEMSO = REC (aka TILE)

Page 30: Tilingand Walking - uni-giessen.de

graph acceptors

(Thomas: Logics, tilings and automata, ICALP 1991)

• labelling of nodes with states

• look at subgraphs of certain diameter

• distinguish types

• acceptance: boolean combination of ‘type α occurs ≤ k times’

► generalization of TILEcorresponds to EMSO

diameter and counting can be avoided in special cases

FO

Page 31: Tilingand Walking - uni-giessen.de

tiling necklaces

baa

a

a

a

a a

‘has label b’ ∉ TILE

aa

graph acceptors can force ‘b’-tile

Page 32: Tilingand Walking - uni-giessen.de

(1) logic to nested pebbles

free variables ~fixed pebbles

laba(x)edgi(x,y)

x x x x ≤≤≤≤ yyyyx = y

¬ ∧∧∧∧ ∨∨∨∨

ϕ → A

FO+dTC ⊆⊆⊆⊆ dPBBL

x

y

x x x x ≤≤≤≤ yyyy

x

∀∀∀∀x x x x ϕϕϕϕ(x)(x)(x)(x)

¬ ∧∧∧∧ ∨∨∨∨

∀∀∀∀xxxx ∃∃∃∃x

ϕ*(x,y)

Page 33: Tilingand Walking - uni-giessen.de

transitive closure

∨∨∨∨

∧∧∧∧

∨∨∨∨

∧∧∧∧

∧∧∧∧

∨∨∨∨

T∨∨∨∨

∧∧∧∧

21

21

21

21

21

21v

uv’

ϕ(x,y)

ϕ*(u,v) tc

TF TF

T∧∧∧∧F ∧∧∧∧

FT

2121 21

vu

v’

deterministic tc: ϕ functional

ϕ(u,v,z)

Page 34: Tilingand Walking - uni-giessen.de

(2) nested pebbles to logic

laba(u) ∧∧∧∧ (∃u’)edg2(u’,u) ∧∧∧∧ u ≠≠≠≠ x3 ∧∧∧∧ edg1(u,v)

iiii single move ϕpq(u,v)

aaaa

2

1uuuu

vvvvfree variables for pebbles

dPBBL ⊆⊆⊆⊆ FO+dTC

p

q

3( not here )

iiiiiiii computation ~ tc with states

ϕpq(x,y)

p1 p2 p3 p4 p5 p6 p7

#

Kleene: removing states finite aut to reg expr

iiiiiiiiiiii dropping pebbles ~ tc (inductively)

Page 35: Tilingand Walking - uni-giessen.de

logic vs. automata

TILE = EMSO

PBBL = FO+TC

for general graph-like structures

PBBL = FO+TC

(almost)

Page 36: Tilingand Walking - uni-giessen.de

use a guide

FO+dTC = dPBBLFO+posTC = PBBL

for families of searchablesearchablesearchablesearchable graphswith a ‘guide’

guide: deterministicwith pebbles

visits each node (at least) once& halts

unranked trees, grids, toruses, …

(∀x) lab0(x)

2 pebbles

Page 37: Tilingand Walking - uni-giessen.de

walking the torus

1 1 1

1 1 1

2 2 2 2

1

1fixed

1 1 1

1 1 1

2 2 2 2

2 2 2 2

1

1

2 2 2 2

two pebbles(nested)

Page 38: Tilingand Walking - uni-giessen.de

mazes / labyrinths

Page 39: Tilingand Walking - uni-giessen.de

mazes

counter, ortwo heads, ortwo pebbles

(Blum & Kozen ‘power of the compass’)

two pebbles(not nested)

xxxxxxxx

(Budach)

single pebble not ok

Page 40: Tilingand Walking - uni-giessen.de

conclusion

‘invisible’ pebbles obtain all REG trees(distributed stack)

nested pebbles and … pictures 1PBBL � TILE… pictures 1PBBL � TILE

… mazes… traces / dependence graphs… texts (two orders on string)

strong / weak pebbles

Page 41: Tilingand Walking - uni-giessen.de

thank you 9 ‘tossing Pebbles’‘tossing Pebbles’‘tossing Pebbles’‘tossing Pebbles’

thank you 9

Joost Engelfriet

Hendrik Jan HoogeboomLeiden NL