35
Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ. Roma Tor Vergata Univ. of Catania ITALY

Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Embed Size (px)

Citation preview

Page 1: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Tiling Automata: a computational model for recognizable two-

dimensional languages

Marcella Anselmo Dora Giammarresi Maria Madonia

Univ. of Salerno Univ. Roma Tor Vergata Univ. of Catania

ITALY

Page 2: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

• Topic: recognizability of 2dim languages (picture languages) by finite devices

• Motivation: define a computational device for 2dim languages based on tiling systems

• Results: definition of tiling automata, comparison of deterministic and non-deterministic models, with OTA, 4NFA

Overview

Page 3: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Two-dimensional (2dim) Languages

Problem: generalizing formal language theory

from 1dim to 2dim

Two-dimensional string (or picture) over a finite alphabet:

abaab

bcabc

acbba

• finite alphabet• ** all 2dim strings (pictures) over • L ** 2dim language

Page 4: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

From 1dim to 2dimSeveral attempts since 60s:

• Automata (4NFA and OTA, AFA, … )

• Logics (monadic second-order, first-order, existential monadic second-order)

• Grammars (matrix, image, array, TRG,… grammars)

• Operations (column-, row- concatenation, stars, …)

Definition of different classes of picture languages

A unifying point of view (G, Restivo, 1992):Recognizability by tiling system (= local language + projection) REC family

Page 5: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

4-way automata (4NFA)

Transition function (p,a) = (q, d ) d{,,,}

- L(4DFA) L(4NFA)

- L(4DFA), L(4NFA) not closed under concatenations and *

• Generalization of classical 2-way automata:

They can move: Left, Right,

Up, Down

• First model by Blum & Hewitt (1967)

- The deterministic model is denoted by 4DFA

Page 6: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

On-line tesselation automata (OTA)

(i, j) : Q Q Q 2Q

• DOTA if : Q Q Q Q

a

q i-1,j

q i,j-1

q i-1,j-1

• L(DOTA) L(OTA)/

• OTA: a restricted type of 2dim cellular automata

….computing by diagonal waves

Page 7: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

• REC family is defined in terms of local languages

• It is necessary to identify the boundary of a picture p

using a boundary symbol

REC family I

p =

p =

• L is local if there exists a set of tiles (i. e. square pictures of size 22) such that, for any p in L, any sub-picture 22 of is in p

Page 8: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Ld = the set of square pictures with symbol “1” in all main diagonal positions and symbol “0” in the other positions

(Usual) Example of local language

1001

10

0010

0000

01

1

10

00

00

01

0

00

00

0

1

=0100

100

010

001p =

#####

#100#

#010#

#001#

#####

p =

Page 9: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

• L is recognizable by tiling system if L= (L’) where L’ is a local language and is a mapping from the alphabet of L’ to the alphabet of L

REC family II

Example: LSq = all squares over = {a}

is recognizable by tiling system.

Set L’=Ld and (1)= (0)= a

• REC is the family of two-dimensional languages recognizable by tiling system

(, , , ) , where L’=L(), is called tiling system

Page 10: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

1dim case: from an automaton to a tiling system

0 2

a

a

b b

1b

b1 b2a1

a0#

# b0 Θ =

b0# b0 b1 b0 a1 b1 b1

a1 b2 b2 b2a1 a0

b2 a0

b1 a1

a0 b1 a0 a1 b0 #

b1 #a0 #

L= strings over ={a,b} starting with b and with even occurrences of a

w = b a b a a b a

w’= # b0 a1 b2 a0 a1 b2 a0 #

(a0)= (a1) =a;

(b0)= (b1) = (b2) =b;

Page 11: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

w’= # b0 a1 b2 a0 a1 Θ corresponds to undirected edges!

To use Θ for a computation we need to decide a scanning strategy + variable to keep current local symbol (state)

#0 2

a

a

b bb1 b2

a1

a0#

1b b0

1dim case: “Computing” by a tiling system(from a tiling system to an automaton)

## a0 w = ba b2 b a b a a

Θ =

b0# b0 b1 b0 a1 b1 b1

a1 b2 b2 b2a1 a0

b2 a0

b1 a1

a0 b1 a0 a1 b0 #

b1 #a0 #

Page 12: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

# ###

LSq = squares over {a}. Use L’=Ld (1)= (0)= a

aaa

aaa

aaa

1001

10

0010

0000

01

1

10

00

00

01

0

00

00

0

1

=0100

#####

##

##

##

#

p =

1 0 0

0 0

1

100

2dim case: “Computing” by a tiling system(from a tiling system to an automaton)

First, decide a scanning strategy!

Recall last computed local symbols!

Page 13: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

“Computing” by a tiling system(from a tiling system to an automaton)

Remark : Tiling system = “undirectional” transitions

For a 2dim finite tiling automaton we need

Tiling system + scanning strategy + data structure

Local picture is the run of the automaton.

Page 14: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

# # # # # # #

# #

# #

# #

# # # # # # #

# # # # # # #

# #

# #

# #

# # # # # # #

Scanning strategies (I)

Diagonal (“OTA”)By column

2

4

3

5

6

1 1 2

3

4

5

6

13

14 15

Page 15: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

# # # # # # #

# #

# #

# #

# #

# # # # # # #

# # # # # # #

# #

# #

# #

# #

# # # # # # #

Scanning strategies (II)

FreeSnake-like

2 43 5

6

1

12

3

4

5

Page 16: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Scanning strategy

We need a “good” one!

• Start in a corner• Filling-all-the-picture property• Computable next-position function• Contiguity property• Mono-directional (tl2br or tr2bl or br2tl or bl2tr)

Page 17: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

An example

#######

##

##

##

#######

By column scanning strategy

2

4

3

5

6

1 Filling-all-the-picture

Start in a corner

Mono-directional (tl2br)

Contiguity property

Comp. next-position function: (i, j) (i+1, j)

Page 18: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

• Supports updating operations

• extract 3 local symbols 1, 2, 3 needed to compute

the next local symbol (ex. )

• insert new local symbol

1 23

Data Structure

• Depends on the chosen scanning procedure

In 1dim automata the data structure saves the current state (local symbol) and updates it.

In 2dim

Page 19: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Tiling Automata (1)

Definition: A tiling automaton (TA) of type tl2br is

AA=(T, S, D0, ) where:

• T = (, , , ) is a tiling system• S is a tl2br-directed scanning strategy

• D0 initial content of data structure

: (1, 2, 3, a) = 4 if Θ and (4)=a1 2

3 4

Page 20: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Example

# # # # # #

# 1 0 0 0 #

# 0 1 0 0 #

# 0 a a #

# a a a a #

# # # # # #

0 1 0 0 # # 0

(*) = a

Consider a tiling automaton AA=(TSq, Sr, D0, ) where Tsq tiling system for LSq and Sr a scanning strategy that goes row by row (from the left to the right)

# 00#001

0a 1*

00

Page 21: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Tiling Automata (2)

Similarly define tiling automata of types tr2bl, br2tl,bl2tr

L(TA-tl2br)= L(TA-tr2bl)= L(TA-br2tl)= L(TA-bl2tr)== L(TA) = REC

Acceptance defined as usual L(TA- tl2br)

Page 22: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Tiling Automata (3)

Use standard definitions from string case and define:

• Unambiguos Tiling Automata (UTA)

• Deterministic Tiling Automata (DTA)

L(DTA) = L(DTA-tl2br) L(DTA-tr2bl) L(DTA-br2tl) L(DTA-bl2tr)

Page 23: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Languages of Tiling Automata

1) L(TA) = REC = L(OTA)

2) L(DTA) L(DOTA)

3) L(DTA) is incomparable with L(4DFA)

4) L(UTA) L(DTA)L(4DFA)

Proposition: The following properties hold

Page 24: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Sketch proof item 3)

3) L(DTA) is incomparable with L(4DFA)

Remark : TA are conceptually different from 4NFA

in L(4DFA) but not in L(DTA)

in L(DTA) but not in L(4DFA) (K. Inoue, A. Nakamura 77)

Page 25: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Conclusions

• Tiling Automata necessary: - to use tiling system as computational devices - to introduce a “more computational” notion of determinism

• Tiling Automata reduce to classical string automata in the case of one-row pictures

Page 26: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Grazie

Page 27: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Complexity issue

Proposition: Deterministic TA with

- next-position function in O(1) time,

- data structure occupies space O(m+n) and

supports the operations in time O(1)

parsing in time O(mn) and O(m+n) extra-space.

Page 28: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Baciamo le mani!

Page 29: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Why Tiling Automata?

A Tiling System does not correspond to an effective procedure of recognition.

Page 30: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Θ =

b0# b0 b1 b0 a1 b1 b1

a1 b2 b2 b2a1 a0

b2 a0

b1 a1

a0 b1 a0 a1 b0 #

b1 #a0 #

Θ corresponds to undirected edges!

To use Θ for a computation we need to decide a scanning strategy + variable to keep current local symbol (state)

#0 2

a

a

b bb1 b2

a1

a0#

1b b0

1dim case: “Computing” by a tiling system(from a tiling system to an automaton)

w’= # b0 a1 b2 a0 a1 b2 a0 #

w = b a b a a b a ## a0

Page 31: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Θ corresponds to undirected edges!

To use Θ for a computation we need to decide a scanning strategy + variable to keep current local symbol (state)

#0 2

a

a

b bb1 b2

a1

a0#

1b b0 Θ =

b0# b0 b1 b0 a1 b1 b1

a1 b2 b2 b2a1 a0

b2 a0

b1 a1

a0 b1 a0 a1 b0 #

b1 #a0 #

1dim case: “Computing” by a tiling system(from a tiling system to an automaton)

w = b a b a a b a

w’= # b0 a1 b2 a0 a1 b2 a0 #

Page 32: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

“Computing” by a tiling system(from a tiling system to an automaton)

Remark : Tiling system = “undirectional” transitions

For a 2dim finite tiling automaton we need

Tiling system + scanning strategy + data structure

Local picture is the run of the automaton.

Remark :

All 2dim tiling automata “correspond” to family REC (i.e. scanning procedure does not matter!)

BUT it is necessary to define determinism

(= backtracking 0, where???)

Page 33: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

Definition: String language L is local if all substrings of length 2 are in a finite set Θ. (L=L(Θ) )

Local (string) languages…(TOGLIERE

w with border

# #0 001 1

string w over Γ= {0, 1}

w= 0 001 1

finite set of strings of length 2

over Γ #allowed substrings

Θ =…

0 0 0 0

0

1 1

1# #

Sono equivalenti ai regular

Page 34: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

(Usual) Example1DIM case:“Computing” by a tiling system

(from a tiling system to an automaton)

0 1

a

a

b b

w= a b b a a b a Θ corresponds to

undirected edges!

To use Θ for a computation we need to decide a scanning procedure +variable to keep current local symbol (state)

b0 b1

a1

a0

#

#

#

w’= # a1 b1 b1 a0 a1 b1 a0 #

Θ =b0 b0

b0

b0 b1

a0

#

#

a1#

b0 #

a1a1

a0a1b1b1 a0b1

b0a0 a1a0

Page 35: Tiling Automata: a computational model for recognizable two-dimensional languages Marcella Anselmo Dora Giammarresi Maria Madonia Univ. of Salerno Univ

A second example

Diagonal scanning strategy (“2OTA”)

#######

##

##

##

#######

1 2

3

4

5

6

13

14 15

Filling-all-the-picture

Start in a corner

Comp. next-position function: (i, j) (i+1, j-1)

Mono-directional (tl2br)

Contiguity property