Sie sind auf Seite 1von 23

Operac oes com linguagens

Projec ao
E
1
, E
2
: conjunto de eventos
P
i
: (E
1
E
2
)

i
, i {1, 2}
s P
i
(s) tal que
P
i
() =
P
i
(s) =

s, s E
i
, s / E
i
P
i
(st ) = P
i
(s)P
i
(t )
Example
E
1
={a, b}, E
2
={b, c}
E
1
E
2
={a, b, c}
s = abcbb (E
1
E
2
)

P
1
(s) = abbb = abbb
P
2
(s) = bcbb
Operac oes com linguagens
Projec ao inversa
P
1
i
: E

i
(E
1
E
2
)

t P
1
i
(t ) ={s (E
1
E
2
)

: P
i
(s) = t }
Example
E
1
={a, b} e E
2
={b, c}
E
1
E
2
={a, b, c}
t = abbb
P
1
1
(t ) ={c
m
ac
n
bc
p
bc
q
bc
r
, m, n, p, q, r 0}
Projec ao aplicada a linguagens
L (E
1
E
2
)

P
i
(L) ={t E

i
: (s L)[P
i
(s) = t ]}
P
1
1
(L) ={s (E
1
E
2
)

: (t L)[P
i
(s) = t ]}
Operac oes com linguagens
Projec ao inversa
P
1
i
: E

i
(E
1
E
2
)

t P
1
i
(t ) ={s (E
1
E
2
)

: P
i
(s) = t }
Example
E
1
={a, b} e E
2
={b, c}
E
1
E
2
={a, b, c}
t = abbb
P
1
1
(t ) ={c
m
ac
n
bc
p
bc
q
bc
r
, m, n, p, q, r 0}
Projec ao aplicada a linguagens
L (E
1
E
2
)

P
i
(L) ={t E

i
: (s L)[P
i
(s) = t ]}
P
1
1
(L) ={s (E
1
E
2
)

: (t L)[P
i
(s) = t ]}
Operac oes com linguagens
Projec ao inversa
P
1
i
: E

i
(E
1
E
2
)

t P
1
i
(t ) ={s (E
1
E
2
)

: P
i
(s) = t }
Example
E
1
={a, b} e E
2
={b, c}
E
1
E
2
={a, b, c}
t = abbb
P
1
1
(t ) ={c
m
ac
n
bc
p
bc
q
bc
r
, m, n, p, q, r 0}
Projec ao aplicada a linguagens
L (E
1
E
2
)

P
i
(L) ={t E

i
: (s L)[P
i
(s) = t ]}
P
1
1
(L) ={s (E
1
E
2
)

: (t L)[P
i
(s) = t ]}
Operac oes com linguagens
Example
E
1
={a, b} e E
2
={b, c}
L
1
={c, ccb, abc, cacb, cabcbbca}
P
1
(L) ={, b, ab, abbba}
P
2
(L) ={c, ccb, bc, cbcbbc}
Example
L ={a, ba}
P
1
1
(L) ={c}

{a}{c}

{c}

{b}{c}

{a}{c}

Example
E
1
={a} e E
2
={b, c}
E
1
E
2
={a, b, c}
L ={aa}
P
1
1
(L) ={b, c}

{a}{b, c}

{a}{b, c}

Operac oes com linguagens


Example
E
1
={a, b} e E
2
={b, c}
L
1
={c, ccb, abc, cacb, cabcbbca}
P
1
(L) ={, b, ab, abbba}
P
2
(L) ={c, ccb, bc, cbcbbc}
Example
L ={a, ba}
P
1
1
(L) ={c}

{a}{c}

{c}

{b}{c}

{a}{c}

Example
E
1
={a} e E
2
={b, c}
E
1
E
2
={a, b, c}
L ={aa}
P
1
1
(L) ={b, c}

{a}{b, c}

{a}{b, c}

Operac oes com linguagens


Example
E
1
={a, b} e E
2
={b, c}
L
1
={c, ccb, abc, cacb, cabcbbca}
P
1
(L) ={, b, ab, abbba}
P
2
(L) ={c, ccb, bc, cbcbbc}
Example
L ={a, ba}
P
1
1
(L) ={c}

{a}{c}

{c}

{b}{c}

{a}{c}

Example
E
1
={a} e E
2
={b, c}
E
1
E
2
={a, b, c}
L ={aa}
P
1
1
(L) ={b, c}

{a}{b, c}

{a}{b, c}

Operac oes com linguagens


Example
E
1
={a, b} e E
2
={b, c}
L
1
={c, ccb, abc, cacb, cabcbbca}
P
1
(L) ={, b, ab, abbba}
P
2
(L) ={c, ccb, bc, cbcbbc}
Example
L ={a, ba}
P
1
1
(L) ={c}

{a}{c}

{c}

{b}{c}

{a}{c}

Example
E
1
={a} e E
2
={b, c}
E
1
E
2
={a, b, c}
L ={aa}
P
1
1
(L) ={b, c}

{a}{b, c}

{a}{b, c}

Operac oes com linguagens


Example
E
1
={a, b} e E
2
={b, c}
L
1
={c, ccb, abc, cacb, cabcbbca}
P
1
(L) ={, b, ab, abbba}
P
2
(L) ={c, ccb, bc, cbcbbc}
Example
L ={a, ba}
P
1
1
(L) ={c}

{a}{c}

{c}

{b}{c}

{a}{c}

Example
E
1
={a} e E
2
={b, c}
E
1
E
2
={a, b, c}
L ={aa}
P
1
1
(L) ={b, c}

{a}{b, c}

{a}{b, c}

Operac oes com linguagens


Example
E
1
={a, b} e E
2
={b, c}
L
1
={c, ccb, abc, cacb, cabcbbca}
P
1
(L) ={, b, ab, abbba}
P
2
(L) ={c, ccb, bc, cbcbbc}
Example
L ={a, ba}
P
1
1
(L) ={c}

{a}{c}

{c}

{b}{c}

{a}{c}

Example
E
1
={a} e E
2
={b, c}
E
1
E
2
={a, b, c}
L ={aa}
P
1
1
(L) ={b, c}

{a}{b, c}

{a}{b, c}

Operac oes com linguagens


Example
E
1
={a, b} e E
2
={b, c}
L
1
={c, ccb, abc, cacb, cabcbbca}
P
1
(L) ={, b, ab, abbba}
P
2
(L) ={c, ccb, bc, cbcbbc}
Example
L ={a, ba}
P
1
1
(L) ={c}

{a}{c}

{c}

{b}{c}

{a}{c}

Example
E
1
={a} e E
2
={b, c}
E
1
E
2
={a, b, c}
L ={aa}
P
1
1
(L) ={b, c}

{a}{b, c}

{a}{b, c}

Operac oes com linguagens


Observac ao
P
i
[P
1
i
(L)] = L
P
1
i
[P
i
(L)] L
linguagens conitantes
L
1
,L
2
: linguagens denidas sobre E
L
1
eL
2
s ao n ao conitantes L
1
L
2
= L
1
L
2
Example
L
1
={, a, ab}
L
2
={, abc}
L
1
L
2
={} L
1
L
2
={}
L
1
={, a, ab}, L
2
={, a, ab, abc}
L
1
L
2
={, a, ab} = L
1
L
2
L
1
e L
2
s ao conitantes
Operac oes com linguagens
Observac ao
P
i
[P
1
i
(L)] = L
P
1
i
[P
i
(L)] L
linguagens conitantes
L
1
,L
2
: linguagens denidas sobre E
L
1
eL
2
s ao n ao conitantes L
1
L
2
= L
1
L
2
Example
L
1
={, a, ab}
L
2
={, abc}
L
1
L
2
={} L
1
L
2
={}
L
1
={, a, ab}, L
2
={, a, ab, abc}
L
1
L
2
={, a, ab} = L
1
L
2
L
1
e L
2
s ao conitantes
Operac oes com linguagens
Example
L
1
={, ab, ac}
L
2
={, ac, bc}
L
1
L
2
={, ac} L
1
L
2
={, a, ac}
L
1
={, a, ab, ac}, L
2
={, a, ac, b, bc}
L
1
L
2
={, a, ac} =L
1
L
2
L
1
e L
2
s ao n ao conitantes
Operac oes com linguagens
Example
L
1
={, ab, ac}
L
2
={, ac, bc}
L
1
L
2
={, ac} L
1
L
2
={, a, ac}
L
1
={, a, ab, ac}, L
2
={, a, ac, b, bc}
L
1
L
2
={, a, ac} =L
1
L
2
L
1
e L
2
s ao n ao conitantes
Aut omatos
Aut omatos
Aut omatos determinsticos
G = (X, E, f , , x
0
, X
m
)
X: espaco de estados
E: conjunto de eventos (nitos) associados ` as transic oes
de G
f : X E X : func ao de transic ao de estados
(x, e) y = f (x, e)
: X 2
E
: func ao de eventos ativos
x (x) ={x X : ((y, e) X E)[y = f (x, e)]}
x
0
: estado inicial
X
m
: conjunto de estados marcados
Aut omatos determinsticos
Conjunto pot encia de E
2
E
E ={a, b} 2
E
={/ 0, {a}, {b}, {a, b}}
Diagrama de trasic ao de estados
Notac ao:
: estado
: transic ao rotulada pelo evento a
: estado marcado
: estado inicial
Aut omatos determinsticos
Example
G = (X, E, f , , x
0
, X
m
)
X ={x, y, z}
E ={a, b, g}
f (x, a) = x, f (y, a) = x, f (z, b) = z, f (x, g) = z, f (y, b) = y,
f (z, a) = f (z, g) = y
(x) ={a, g}, (y) ={a, b}, (z) ={a, b, g}
x
0
= x
X
m
={x, z}
DESLab
Observac ao
1
f (x, g) = z : se G estiver em x e ocorrer o evento g, G
mudar a para o estado z.
2
f (x, a) = x : autolaco
3
f (z, a) = y, f (z, g) = y : a e g n ao podem ocorrer
simultaneamente.
4
f : func ao parcial no seu domnio
(z) ={a, g} E
5
Estados marcados: est ao associados a um determinado
signicado. Por exemplo, conclus ao de uma tarefa.
6
G: m aquina de estados/ aut omatos.
7
f e em geral, estendida do domnio E para E

.
f (x, a) = x(a E)
f (x, ga) = f [f (x, g), a] = y(ga E

)
8
X n ao e necessariamente nito
X nito aut omato de estados nitos
Exemplos
C elula de manufatura
1
N ao existe um local para armazenar as pecas em espera
nas m aquina M
1
e M
2
M
1
ocupada peca de entrada rejeitada
M
2
ocupada rob o segura a peca na entrada de M
2
2
Caso a m aquina M
1
termine um processamento enquanto
o rob o est a ocupado, ela deve reter essa peca e n ao
receber nenhuma outra peca.
M aquina M
1
G
1
= (X
1
, E
1
, f
1
,
1
, x
0,1
, X
m,1
)
X
1
={D
1
, P
1
, H
1
}
E
1
={a
1
, f
1
, e
1
}
x
0,1
={D
1
}
X
m,1
={D
1
}
Exemplos
Rob o G
R
G
R
= (X
R
, E
R
, f
R
,
R
, x
0,R
, X
m,R
)
X
R
={D
R
, T
12
, H
2
, R}
E
R
={d
1
, c
2
, a
2
, c
1
}
x
0,R
={D
R
}
X
m,R
={D
R
}
M aquina M
2
G
2
= (X
2
, E
2
, f
2
,
2
, x
0,2
, X
m,2
)
X
2
={D
2
, P
2
}
E
2
={a
2
, f
2
}
x
0,2
={D
2
}
X
m,2
={D
2
}
Exemplos
Sistema de las
Modelo I: baseado no comprimento da la
G
1
= (X
1
, E
1
, f
1
,
1
, x
0,1
, X
m,1
)
X
1
={0, 1, 2, 3}
E
1
={a, d}
a: chegada de cliente; d: sada de clientes
x
0,1
={0}
X
m,1
={0}
Observac ao
Se n ao h a restric ao em relac ao ao comprimento da la, G
1
tem innitos estados.
Restric ao: la tem no m aximo comprimento 3
Exemplos
Modelo II: baseado no estado do servidor
G
2
= (X
2
, E
2
, f
2
,
2
, x
0,2
, X
m,2
)
X
2
={D, T, Q}
D: disponvel; T: trabalhando; Q: quebrado
E
2
={a, d, g, r }
q: servidor quebra; r: servidor reparado
x
0,2
= D
X
m,2
={D}
Hip otese
(i) O servidor somente quebra quando est a trabalhando.
(ii) Quando o servidor for consertado, ele volta para o estado
disponvel.

Das könnte Ihnen auch gefallen