Top Banner
1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione Prin. Varese, luglio 2006
35

1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

Jan 13, 2016

Download

Documents

Roxanne Watts
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

1

Dal non-determinismo al determinismo

( nei linguaggi 2dim ): alcune riflessioni

Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo

Riunione Prin. Varese, luglio 2006

Page 2: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

2

finite alphabet ** all 2dim rectangular words (pictures) over • L ** 2dim language• p L has size (m,n)

• Column concatenation

• Row concatenation

• Column/Row star

2dim Languages

p qp q =

p q =p

q

Page 3: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

3

Local 2dim Languages

L is local if there exists a finite set of tiles that contains all allowed subpictures of size (2,2,), i.e.

p L if and only if any 22 sub-picture of is in p

• tile: a square picture of size (2,2)

• bordered picture p:

p =

Page 4: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

4

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 5: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

5

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

Recognizable 2dim Languages

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

REC is closed almost under all operations but it is not closed under complement

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

Page 6: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

6

(Usual) Example

LSq = all squares over = {a}.

LSq is recognizable by tiling system.

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

100

010

001 Ld

aaa

aaa

aaa

Page 7: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

7

# ###

(Usual) Example

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

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

First, decide a scanning strategy!

Page 8: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

8

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

Remark :Tiling system = “undirectional” transitions

Definition: A 2dim finite automaton is

Tiling system + scanning procedure

Local picture is the run of the automaton.

Remark :

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

Ex: 2OTA (2dim on-line tesselation automata)

Page 9: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

9

Scanning strategies (I)

# # # # # # # #

# #

# #

# #

# #

# #

# #

# # # # # # # #

1 2

3

4

5

6

7

8

9

10

34

35 36

Diagonal (“2OTA”)

# # # # # # # #

# #

# #

# #

# #

# #

# #

# # # # # # # #

By column

1

2

3

4

5

6

7

8

9

10

11

12

31

32

33

34

35

36

Page 10: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

10

Scanning strategies (II)

# # # # # # # #

# #

# #

# #

# #

# #

# #

# # # # # # # #

Snake-like

1 2 3 4 5 6

789101112

1314

343536

Free

# # # # # # # #

# #

# #

# #

# #

# #

# #

# # # # # # # #

12

3

4

5

6

7

8

9

36

Page 11: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

11

A remark about REC

• A tiling system (= local language + projection) “generalizes” to 2 dim a non-deterministic finite automaton.• Family REC is not closed under complement

Definition of REC is intrinsically non-deterministic and it is not possible to eliminate non-determinism without getting a smaller class!

Page 12: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

12

From non-determinism to determinism.. ..

• Non-determinism • Possible accepting computations: “several” • Possible backtracking steps at each step of

computation: linear in the size of input

[if pictures: =O(mn)]

• Determinism • Possible accepting computations: 1 • Possible backtracking steps at each step of

computation: 0

Page 13: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

13

Remark on 1DIM case :

In string languages 2 definitions possible:

- Determinism from left to right

- Co-determinism from right to left

Correspond to same class!....choose one definition…

??

??

Remark: Languages recognized by automata that are both deterministic and co-deterministic are smaller class!

Page 14: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

14

A tiling system is Top-Left-deterministic if a,b,c and s unique tile such that (s)=d.a b

c d

(Analogously TR-,BL-,BR-deterministic tiling system)

??

There is an unique way to fill this position with a symbol of

L is deterministic if it has a TL- or TR- or BL- or BR-

deterministic tiling system

Deterministic Recognizable Languages (DREC)

Classical definition (only a bit extended)

Page 15: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

15

• Lcol-1n REC

aababaaa

bbbbabbb

aaaaaaaa

bbabbbbb

p’=

Lcol-1n = {p | first col = last col }{a,b}**

New Example

Local alphabet: = {xy}

Projection “erase” subscripts: (xy) = x

• Lcol-1n DREC

Lcol-1i = {p | 1<in , first col = col i}DREC

Page 16: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

16

From non-determinism to determinism:what can we define in beetween?

• Non-determinism

• Possible accepting computations: “several”

• Possible backtracking steps at each step of computation: linear in the size of p (mn)

• Determinism

• Possible accepting computations: 1

• Possible backtracking steps at each step of computation: 0

• Unambiguity

one

Page 17: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

17

Unambiguous Recognizable Languages (UREC)

Def [GR92] A tiling system (, , , ) is unambiguous for L ** if the projection π is injective on L() (i.e. for any pL there is a unique p’ L’ such that (p’)=p).

UREC: all unambiguous recognizable 2dim languages.

L ** is unambiguous if it admits an unambiguous tiling system.

• UREC REC • Generalization in 2dims of unambiguous automata

for strings

Page 18: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

18

UREC and REC

Lcol-ij REC Lcol-ij UREC

Lcol-ij = ** Lcol-1n ** and

REC is closed with respect to

• UREC REC

Lcol-ij =

i j

i,j:

col i = col j

Necess. Cond. for UREC

Page 19: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

19

Properties of UREC

Proposition UREC is not closed under row/column concatenation/closure.

Proposition UREC is closed under intersection and rotation operations.

Page 20: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

20

From non-determinism to determinism:what can we define in beetween? (2)

• Non-determinism

• Possible accepting computations: “several”

• Possible backtracking steps at each step of computation: linear in the size of p (mn)

• Determinism

• Possible accepting computations: 1

• Possible backtracking steps at each step of computation: 0

one dimension of p (m or n)

• “line”-unambiguity

one

Page 21: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

21

A tiling system is Left-Right Column-Unambiguous if, after having computed the local symbols in an entire column, the local symbols on the next column are univocally determined.

??

??

??

??

L is Col-UREC if L has a tiling system that is LR- or RL- column unambiguous.

Column-Unambiguos Languages (Col-UREC)

Remark: Backtracking at each step of possibly O(m) steps.

Page 22: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

22

A tiling system is Top-Down Row-Unambiguous if, after having computed the local symbols in an entire row of a picture, the local symbols on the next row are univocally determined.

?? ???? ??

L is Row-UREC if L has a tiling system that is TD- or DT- column unambiguous.

Row-Unambiguos Languages (Row-UREC)

Remark: Backtracking at each step of possibly O(n) steps.

Page 23: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

23

(A new) Example

= {a, b}

LSq-cent-a = odd-side squares with a in

center positionabbabbabaaaababb

b b

b

ba

aa aa

a0b0b0a2

b1b0a2b0

a0a1a0a0

b2a0b1b0

b1 b0

b0

b1

a0

a0

a0 a2a0 LSq-cent-a Col-UREC, Row-UREC

LSq-cent-a DRECBy an “old” proof

by Inoue et al.

Page 24: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

24

Col-UREC and UREC

Lcol-1ij n UREC Lcol-1ijn Col-UREC

Lcol-1ijn = Lcol-1j Lcol-in and

UREC is closed with respect to

• Col-UREC UREC

i,j:

col 1 = col j

col i = col nLcol-1ij n=

1 i j n

Necess. Cond. for Col-UREC

Page 25: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

25

A necessary condition for unambiguity

Theorem Let L **. There is a k such that, for all m,

1. If L Col-UREC then Row(ML(m)) km

2. If L UREC then RankQ(ML(m)) km

L(m) L is the subset of all pictures with m rows. It can be viewed as a string language over the columns alphabet.

S*, regular string language. MS is the boolean matrix MS=|a| *, * where a= 1 iff L. The number of different rows , Row(MS ), is finite.

Idea of ProofUse Matz’s Theorem and Hromkovic et al. Theorem

Page 26: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

26

From 2dim to 1dim

Theorem [Matz 97] Let L **. If L REC, then there is a k such that, for all m, there is a finite string automaton Am with km states for L(m).

Fact

If L UREC, then Am is an unambiguous automaton with km states for L(m).

If L Col-UREC, then Am is a deterministic automaton with km states for L(m).

Page 27: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

27

Theorem of Hromkovic et al.

Theorem (Hromkovic et al.) For every regular string language S*,

d(S) = Row(MS)

uns(S) RankQ(MS).

d(S) the size of the minimal deterministic automaton accepting S

uns(S) the size of a minimal unambiguous non-deterministic automaton accepting S.

Page 28: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

28

The following inclusions are all strict:

DREC Col-UREC UREC REC

Collecting all classes…

a

1 i j n

i j

Page 29: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

29

A separation result

Theorem

Whatever we choose a definition of deterministic 2dim finite automaton, the family of corresponding languages is strictly included in UREC.

Proof: By previous strict inclusions results (Col-UREC UREC )

Det-REC is strictly included in UREC , for any definition of Det-REC we choose.

Page 30: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

30

An undecidability result for UREC

Theorem

Given a tiling system (, , , ) for L **, it is undecidable whether it is unambiguous.

Proof: By reduction from the undecidable 2dimensional Unique Decipherability Problem.

Page 31: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

31

A decidability result for Col-UREC

(Row-UREC)Theorem Given a tiling system T = ( , , , ) for

L **, it is decidable whether it is col-unambiguous.

Proof: Let M=Card {(,) : , }.

T col-unambiguous

No pair of pictures

sp with • p, s, t n,1

• s t (s) = (t)• Any 22 sub-picture of p s,

p t in • n M

tp

Page 32: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

32

A tiling system is Top-Left Diagonal-Unambiguous if, after having computed the local symbols in an entire diagonal of a picture, the local symbols on the next diagonal are univocally determined.

??

??

??

??

L is Diag-UREC if L has a tiling system that is TL-, TD-, BL- or BR- diagonal unambiguous.

REMARK: Diag-Unambiguos Languages

Remark: NO backtracking at each step

Page 33: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

33

Conjecture: If L REC\UREC then L REC

• Is UREC largest subset in REC closed under complement?

• Is UREC (Col-UREC) closed under complement?

Open Problems

• Is L(4NFA) UREC?

Page 34: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

34

Conclusioni alle riflessioni…

Tiling systems are a “compact” way to represent classes of finite state automata on 2 dims.

Unambiguos languages are a strict intermediate class between non-deterministic and deterministic families.

Page 35: 1 Dal non-determinismo al determinismo ( nei linguaggi 2dim ): alcune riflessioni Marcella Anselmo, Dora Giammarresi, Maria Madonia, Antonio Restivo Riunione.

35

riflettere a mente fresca…