Abordagem RW - Universidade Federal de Santa Catarina

Download Report

Transcript Abordagem RW - Universidade Federal de Santa Catarina

LOGICAL CONTROL OF
DISCRETE EVENT
SYSTEMS
AN AUTOMATA BASED APPROACH
Jose Eduardo R Cury
OUTLINE:
-Preliminaires
-Basic Control Theory
-Extensions: Modular Control;
Partial Observation;
Hierarchical Control;
1.Preliminaires
Approach introduced by
Ramadge and Wonham (1984)
logical model:
related with the logical behavior of the DES
(possible state/event sequences)
timed and untimed versions
DES are modelled as generators of
formal languages
synthesis-based
limitations: computational complexity
Languages
S = set of symbols = alphabet
Definition: A language L, defined over an
alphabet S, is a set of strings of symbols in S
Example:
S={a,b,g }
L1={e,a,abb}
L2={All possible strings of lenght 3
and beginning with a}
L3={All possible finite lenght
strings and beginning with a}
Regular Expressions
• Concatenation of strings:
u = abb; v = gb
conc.: uv = abbgb
• Operations on Languages:
Let A and B be 2 languages. We have
a) Concatenation:
AB = {w: w=uv, u A, v  B}
b) Kleene closure:
A

A* =
n
n=0
where: A0 = {e}
An = An-1A
c) Usual operations over sets
Example:
S = {a,b,g}
L1 = {e,a,abb}; L2 = {g}
Then:
L1L2 = {g,ag,abbg}
L1*= {e,a,abb,aa,aabb,abba,abbabb,...}
L2*= {e,g,gg,ggg,...}
L1  L2 = L1 + L2 = {e,a,abb,g}
Notation: if u and v are strings
u = {u}
(u+v) = {u,v}={u}  {v}
u* = {e,u,uu,uuu,...}
uv = {uv}
Definition (Regular Expressions):
1) is a regular expression denoting the
empty language),
e is a regular expression denoting {e},
s is a regular expression denoting {s},
 sS;
2) If r and s are regular expressions, then
rs, r*, s*, (r+s) are regular expressions;
3) All regular expressions are obtained by
applying rules 1 and 2 a finite number
of times
Example:
Let S = {a,b,g} be an alphabet; then:
(a+b)g* = {a,b,ag,bg,agg,bgg,aggg,bggg,...}
(ab)*+ g = {e,g,ab,abab,ababab,...}
Definition:
A regular language is any language which
can be represented by a regular expression
Proposition:
If L = {u1, u2,...,un} is a finite language,
then L is a regular language
Prefix of a string:
u  S* is a prefix of v  S* if for some
w  S*, v = uw
Prefix-closure of a Language L:
L is the language composed by all
prefixes of L:
L = { u / uv  L for some v  S*}
Prefix-closed Language:
L  S* is prefix-closed if L =
L
i.e., if v  L and u is a prefix of v then
u L
Finite State Automata
Device which accepts a Language
according to specific rules.
Definition:
A finite state automaton is a 5-tuple
(S,X,f,x0,F) where:
S is a finite alphabet;
X is a set of finite states;
f is a state transition function,
f: X  S  X
x0 is an initial state, x0  X;
F is a set of marked states, F  X
Transition State Diagrams
Directed graphs where the nodes
represent states and the labeled
edges represent state transitions
Example: (S,X,f,x0,F)
S = {a,b,g}
X= {x,y,z}
f(x,a) = x, f(x,b) = f(x,g) = z,
f(y,a) = x, f(y,b) = f(y,g) = y,
f(z,b) = z, f(z,a) = f(z,g) = y,
a
g
a
x
g
y
a
b
g
z
b
b
Language accepted by an automaton
Extended transition function:
f: X  S*  X
f(x,us) = f(f(x,u),s)
u  S* , s  S
In the above example:
f(x,bba) = f(f(x,bb),a) = f(f(f(x,b),b,a)
= f(f(z,b),a) = f(z,a) = y
Definition: A string u is accepted by
a finite state automaton (S,X,f,xo,F),
if f(xo,u) = x, with x  F
Definition: The language accepted by a
finite state automaton (S,X,f,xo,F) is the set
of finite strings {u:f(xo,u)  F}.
If the automaton is denoted by A, then the
language accepted by A é denoted L(A).
Example: Let S = {a1,a2,b} be an alphabet.
Define a task as a sequence of 3 events
beginning with b, followed by a1or a2, and
then b, followed by an arbitrary sequence.
Corresponding language:
L = b(a1+a2)b(a1+a2+b)*
a2
a1
b
5
a2
a1
a2
a1
b
0
2
a1
1
b
a2
a1
a1
b
4
3
a2
b
b
a2
Non-Deterministic Finite State
Automata
Definition: A Non-Deterministic Finite State
is a 5-tuple:
(S,X,f,xo,F)
with S,X,xo,F as before, and f a transition state
function f: X  S  2X
Example:
a
a
0
f(0,a) = {0,1};
f(1,a) = ;
b
1
f(0,b) = 
f(1,b) = {0}
It allows for the expression of incomplete
knowledge of the system and for the expression
of the physically admissible set of events which
follows a state x.
Language accepted by a
non-deterministic automaton
Extended transition function:
f(x,us) = {z: z  f(y,s) para algum
estado y  f(x,s)}
u  S* , s  S
Definition: The language accepted by a nondeterministic finite state automaton (S,X,f,xo,F)
is the set of finite strings {u:f(xo,u)  F  }.
Proposition: If L is the language accepted by
some non-deterministic finite state automaton
thhen there exists a deterministic finite state
automaton which accepts L.
Example: Let (S,X,f,xo,F) be the automaton
of the last example. Let us build a
deterministic automaton (SD,XD,fD,xoD,FD)
which accepts the same language
SD = E
XD = {0,1,01, } (each element of XD corresponds to a subset of X)
xoD = xo = 0;
FD = {0,01}
a
a

b

b
b
a
b
0
1
b
0
a
a
b
a
01
b
a
01
Equivalence between Finite State Automata
and Regular Expressions
Theorem: (Kleene, 1950)
If a language is regular, then it can be
accepted by some finite state automaton;
and if a language is accepted by a finite state
automaton , then it is a regular language.
Example of a non-regular language:
L = {e, ab, aabb, aaabbb, ...}
denoting: an = aaa...aa we have
L={an bn , n = 0, 1, 2, ...}
State Agregation in Automata
In general the number of states in an
automaton is not minimal
Minimization
equals
Identification of equivalent states
Definition: Let (S,X,f,xo,F) be afinite state
automaton and R  X. R is said to be formed
by equivalent states if, for any pair x,y  R,
x  y, and any u  S*
f(x,u)  F if and only if f(y,u)  F
Observações:
a) se x  F e y  F então x e y não podem ser
equivalentes.
b) se f(x,e) = f(y,e) para qualquer e  E (exceto e) então x e y são equivalentes.
c) a propriedade acima se mantém se, para
alguns eventos, f(x,e)=y e f(y,e)=x.
d) em geral, se R é tal que R  F ou
R F = , então R é constituído de estados equivalentes se f(x,e) = z  R implica
que f(y,e) = z, para quaisquer x,y R.
e) se F = X então todos os estados são equivalentes em relação a F.
Example: Detector of the 1,2,3 sequence.
1
1
x0
2
x1
1
3
3
x12
2
1
x123
2
3
2
x3
3
3
x2
2
1
1
2
x1
3
1
1
3
x12
2
xo
2
3
x123
2
3
Algoritmo para a Identificação de
Estados Equivalentes:
1) Marcar (x,y) para todo x  F, y  F
2) Para todo par (x,y) não marcado em 1):
2.1) Se (f(x,e),f(y,e)) está marcado para
algum e  E então:
2.1.1) Marcar (x,y)
2.1.2) Marcar todos os pares não-mar
cados (w,z) na lista de (x,y).
Repetir para cada (w,z) até que
nenhuma marcação seja possível
2.2) Se (f(x,e),f(y,e)) não está marcado
para nenhum e  E então:
2.2.1) Se f(x,e)  f(y,e), então acrescentar (x,y) à lista de (f(x,e),f(y,e))
Generators
Definition:
A Generator is a 5-tuple G = (S, X, f, xo, F)
where S , X, xo, F are defined as for the automata
and f is a partial function f: X  S  X , defined
only for some elements of X  S (notation: f(x,s)!).
Definition fits with the fact that in systems
some transitions are not physically admissible
Notation:
S(x)  S set of admissible events after x  X
Language Generated by G:
L(G) = {u  E* / f(xo,u)!}
Marked Language of G:
Lm(G) = {u  E* / f(xo,u)  F)
Properties:
• L(G) is prefix-closed;
• An automaton A is a generator with
L(A) = S*
•Lm(G)  L(G)
Example: Three state machine
I
s
r
f
W
b
D
S = { s, f, b, r}
L(G) = (sf + sbr)*(e + s + sb)
represents the set of all physically admissible
sequences in the system.
Lm(G) = (sf + sbr)*
represents the set of all completed tasks possible
to occur in the system.
Accessibility and Co-accessibility
of a Generator
Accessible state: A state x  X is accessible
if x = f(xo,u) for some u  S*.
Accessible Generator: A generator is accessible
if every x  X is a reachable state.
Accessible Component of G:
Gac = (Xac, S, fac, xo, Fac)
where:
Xac : set of accessible states of G
Fac : Xr  F
fac : f/ S  Xac
If G is accessible then Gac= G
Co-accessible Generator (non-blocking):
A generator is co-accessible (non-blocking)
if any u  L(G) can be completed into a
string in Lm(G).
If u  L(G), then $w  S* / uw  Lm(G)
Trim Generator: A generator is trim if it is
accessible and co-accessible.
Example:
xo
a
b
x1
a
g
x3
a
b
x2
x5
x4
g
x4 : non accessible state;
x5 : non co-accessible state (blocking state)
Gac: accessible component of G
a
xo
g
x1
x3
a
a
b
x2
x5
g
Gt: Trim generator
xo
a
b
x1
g
x3
a
x2
Property: A generator is co-accessible
(nonblocking) if and only if Lm(G) = L(G)
Composing Generators
Synchronous and Shuffle Product
Natural Projection: Let S and Si be sets of
events with Si  S.
The natural projection Pi: S *  S i* is defined
as:
Pi(e) = e
e if s S i
Pi(s) =
s if s S i
Pi(u s) = Pi(u) Pi(s) onde u  S * ; s  S
The action of Pi over a string corresponds to
deleting events not in Ei.
Extending natural projections to languages:
PiL = Li = {ui  Si* / ui = Piu for some u  L}
Inverse Projection:
Pi-1Li = {u  S* / Piu  Li}
Synchronous Produt:
Let L1  S1* e L2  S2* (with possibly
S1 S 2  ). Let S = S1 S2. The
synchronous produt L1 //s L2  S* is defined as:
L1 //s L2 = P1-1L1  P2-1L2
Observe that u  L1 //s L2 if and only if
P1(u)  L1 and P2(u)  L2
The synchronous product represents a language
generated by a generator which is the result of
the joint action of two other generators
Example: S1 = {a, b};
G1:
S2 = {b, g}
G2:
a
b
b
b
g
G = G1 // G2 :
a
g
g
b
g
L(G) = L(G1) //s L(G)2
b
a
Intersection of languages:
Corresponds to the synchronous product
with S1 = S2 since in this case Pi-1Li = Li
Example:
b
a
a
a
b
b
L1 = (a + b)* = E*
L2 = (ab)*(e + a)
L1 //s L2 = L2
Shuffle Product:
Corresponds to the synchronous product
with S1 S2 = 
The Shuffle Product of two languages L1 and L2
is the language consisting of all possible
interleavings of strings of L1 and L2
Language generated by a generator which is
the result of the independent or asynchronous
action of two other generators
Example: Two independent and assynchronous
users of the same resource
I2
I1
R1
b1
g2
a2
g1
a1
U1
R2
b2
U2
I = idle; R = requiring the resource;
U = using the resource
Assynchronous Composition
G = G1 // G2
States: (x,y), x  G1, y  G2
Transitions: (x,y)  (x’,y) or (x,y)  (x,y’)
g1
I1I2
a1
R1I2
a2
a2
g2
I1R2
b2
I1 U2
R1R2
a1
g2
b1
g1
b1
b2
a1
R1U2
U 1I2
a2
g2
U1R2
b2
b1
U1U2
g1
L(G) = all strings over E1  E2 which
correspond to paths in the graph starting in I1I2
Lm(G) = Idem, but ending in I1I2
G is co-accessible : Lm(G) = L(G)
2. Basic Control Theory
. The Control
- Some events can be disabled by an external
controller
- Events to be disabled depend on the past
behavior of the DES
. Methodology
1. Modeling the OPEN LOOP BEHAVIOR
2. Modeling the SPECIFICATIONS:
Safety, Liveness, Fairness
3. Synthesizing the OPTIMAL CONTROL LAW
. Limitations
- DES, SPEC., CONTROLLERS finite state
machines;
- Algorithms often polynomials in the number of
states of DES, which grows exponentially with
the number of components
Control of DES
Central Idea:
• Control action
some events can be externally disabled
• Measured variables
current state or sequence of past events
Control
DES
Controller
state or
sequence of events
Methodology
1) Specification of the Open-loop behavior.
2) Specification for the Closed-loop behavior.
Typical specifications:
• Safeness
• Liveness
• Fairness
3) Synthesis of the control law 
satisfaction of specifications
in a least restrictive way
Some characteristics of the approach
• The three steps are performed systematically
(including automatic synthesis)
• Plant, closed-loop specifications, and controller
must
be modeled by finite state generators.
• Computational complexity
• polynomial in the number of states
• number of states grows exponentially with
the number of sub-systems.
• research issue
Control Structure
Partition of S:
S = Sc  Su
Sc : set of controllable events
can be disabled
Su : set of uncontrollable events
can not be disabled
Control input:
Subset g  S tal que
If s  g then it is allowed by g,
otherwise s is disabled by g.
 Su  g (uncontrollable events
can not be disabled)
Set of possible control inputs:   2S
DES with control structure:
Generator G and a set of control inputs .
Control is permissive
It doesn’t force but just enables
or disables events
Events are generated by the plant
Example: Three states machine.
Sc={s, r}
I
s
W
 = {g1, g2, g3, g4}
r
f
b
Su={f, b}
D
g1 = {s, f, r, b};
g2 = {s, f, b};
g3 = {r, f, b};
g4 = {f, b}
Supervisor:
Controller which switches the control inputs
g’, g’’, g’’’,... as a function of the measured
sequence of events.
Formally, a function
h: L  
which associates to each possible string
w  L a control input g = h(w)  
System under supervision:
After generating w,
next event is an element of
h(w)  S(f(xo,w))
Closed-loop behavior
Notation:
h/G : G under supervision of h
(closed-loop system)
Closed-loop generated behavior:
The closed-loop behavior of h/G
is defined by the language L(h/G)  L(G):
• e  L(h/G)
• ws  L(h/G) if and only if
w  L(h/G), ws  L(G), s  h(w)
Properties:
• {e }  L(h/G)  L(G)
• L(h/G) is non-empty and prefix-closed
Closed-loop marked behavior:
Lm(h/G) = L(h/G) Lm(G)
Lm(h/G) is the part of Lm(G) which survives
under supervision.
It may represent the set of tasks which
can be performed under supervision.
Property:
 Lm(h/G)  Lm(G)
Definition: h is nonblocking for G if
Lm(h/G) = L(h/G)
every generated sequence of events
can be completed into a marked sequence
State realization of h
Let h be a supervisor defined for
G = (S,X,f,xo,F): h:L  
Let T be an automaton:
(S,Y,g,yo,Y)
Let F be a complete function from Y to
:
F Y  
(T,F) implements the supervisor h if,
for every w  L(h/G):
g = F(y) = F(g(yo,w)) = h(w)
In words, h(w) can be obtained by
i. applying w to the automaton T, leading it
to the state y.
ii. applying g = F(y) such that F(y) = h(w) .
The automaton T has its transitions
driven by the events in G
g
Generator G
F
y
enabled
events
Automaton
T
Realization by a Generator S
Representation of the supervisor by a generator S
control action over G implicit in the
transition structure of S.
• If w  L(h/G) then
w  L(S),
ws  L(S) only if s  h(w) or
ws  L(G);
• If w  L(h/G), ws  L(G), s  h(w)
then ws  L(S)
In words
• transitions disabled by h and
physically possible, don’t appear in the
transition structure of S.
• transitions enabled by h, and physically possible,
must appear in the transition structure of S.
S is the generator
(S,Y,g,yo,Y)
• transitions:
driven by events occured in G in accord to g
• control action:
once in the state y S disables events s  L(G),
such that s  S(y)
h(w)  S(f(xo,w)) 
S(g(yo,w))  S(f(xo,w)) 
h(w)
g
G
S
enabled
events
Closed-loop behavior
The behavior of h/G can be represented
by the generator corresponding to the
composition of S and G (S // G):
h/G = S // G = {S, Y  X, q, (yo, xo), Y  F}
where:
q((y,x),e) = (g(y,e),f(x,e))
if g(y,e)! e f(x,e)!
In the composition S // G only transitions
enabled in both generators can occur.
If the supervisor disables a transition, it doesn’t
occur.
Example: Dinner of two philosophers
P1
P2
G2:
G1:
e2
e1
M
M
E
m1
m2
E
G = G1 // G2
e1
EM
MM
m2
m1
e2
m2 m1
e2
Sc = {e1, e2}
ME
e1
Su = {m1, m2}
EE
Control specification: avoid state EE
Let a supervisor be defined by:
h[((e1m1)+(e2m2))*e1] = {e1, m1, m2}
h[((e1m1)+(e2m2))*e2] = {e2, m1, m2}
for all other strings w  L(G),
h(w) = {e1, e2, m1, m2}
In this case it is easy to see that:
L(h/G) = ((e1m1)+(e2m2))*(e + e1 + e2)
Lm(h/G) = ((e1m1)+(e2m2))*
and the control specification is attained.
Realization by (T,F):
Automaton T:
m1 m2
yo
e1
m2
m1
y1
e2
y2
e1 e2 m1
e1 e2 m2
F(yo) = {e1, e2, m1, m2}
F(y1) = {e1, m1, m2} = h[((e1m1)+(e2m2))*e1]
F(y2) = {e2, m1, m2} = h[((e1m1)+(e2m2))*e2]
F
yo
e1
e2
m1
m2
1
1
1
1
y1
1*
0
1
1
y2
0
1*
1
1
* = irrelevants
Closed-loop system
g 
e1
EM
e2
s S
MM
m2
m1 e2
m m1
2
EE
ME
e1
m1 m2
F e1
yo 1
e2
1
1
1
y1
-
0
1
1
y2
0
-
1
1
m1 m2
e1
y1
e1 e2 m2
yo
m1 e2
m2
y2
e1 e2 m1
Realization by a generator S
S:
e1
y1
Obs.:
L(S) = L(h/G)
yo
m2
e2
m1
y2
Closed-loop system: composition of S and G
S // G:
e1
EMy1
EEyo
m2
m1
L(S//G) = L(h/G)
Lm(S//G) = Lm(h/G)
e2
MEy2
Some questions:
• Some specifications could not be exactly
attained
•Which are the conditions for a specification to
be exactly attained ?
• If there exist several incomplet solutions
which one is the best ?
(in the ex., if F(yo) = {m1, m2} specification is attained,
but the philosophers will eventually die)
• Are there other ways to express specifications
than just by forbidden states?
Controllability
and
Existence of Supervisors
Problem:
Given a DES G with generated behavior L(G)
and marked behavior Lm(G)), which closed-loop
marked behaviors K  Lm are possible to
be obtained by the action of a nonblocking
supervisor ?
Equivalently,
What are the conditions on K  Lm
under which there exists h such that
Lm(h/G) = L(h/G)
Lm(h/G) = K ?
Illustration: Dinner of philosophers
with “sake”
P1
P2
Gi: (i = 1,2)
M
ei
mi
E
Sc = {e1, e2}
di
fi
D
G = G1 // G2:
MM
e1
e2
m1
m2
EM
ME
m2
d1
f1
m1
e2
d2
f2
e1
EE
DM
f1
e2
m2
DE
MD
f2
d1
d2
d2
d1
f2
e1
m1
ED
f1
DD
Control Specification: avoid state DD
Control Specification:
G’:
MM
e1
e2
m1
m2
EM
ME
m2
d1
f1
m1
e2
d2
f2
e1
EE
DM
e2
f1
d1
m2
MD
f2
e1
d2
DE
m1
ED
One must find h such that:
L(h/G) = L(G’) or Lm(h/G) = Lm(G’)
Impossible: observe that e1d1e2 leads to
a state where it is impossible to prevent
the occurrence of d2
Controllability
A language K  S* is said to be controlable
with relation to a language L if
KSu L  K
In words, controlability of K implies that any
prefix w of a string in K, when followed by an
uncontrollable event s such that ws  L, must
remain being a prefix of K (ws  K)
Systemic Interpretation:
If L represents the generated behavior of a
DES G, K is controllable if and only if no
sequences in G which are prefixes of K, when
followed by uncontrollable events in G exit
the prefixes of K
Obs.: , L(G) e S* are controllable w.r.t. L(G)
Example:
2
c
G:
0
a
b
1
d
e
3
L(G) = (abc + ade)* (e + a + ab + ad)
If K = (abc)* ab
then: K = (abc)* (e + a + ab)
If Su = {a, b, c, d, e} and Sc = { } then
K is not controllable w.r.t. L(G)
since KEu L = (abc)*(e + a + ab + ad)
If Su = {a, b, c, e} and Ec = {d } then
K is controllable w.r.t. L(G)
since KEu L = (abc)*(e + a + ab)
Example:
I
s
G:
W
r
f
b
D
L(G) = (sf + sbr)*(e + s + sb)
For: K = (sbr)*
K = (sbr)* (e + s + sb)
KEu L = (sbr)* (sf + sb)
K is not controllable w.r.t. L(G)
For: K = (sf)*
K = (sf)* (e + s)
KEu L = (sf)* (e + sb)
K is not controllable w.r.t. L(G)
For: K = {sf, sb}
K = {e, s, sf, sb}
KEu L = {sf, sb}
K is controllable w.r.t. L(G)
No exemplo do almoço dos filósofos,
tanto L(S//sG) como Lm(S//sG) são controláveis em relação a L(G).
m1 m2
yo
c1
m2
m1
y1
c2
y2
c1 c2 m1
c1 c2 m2
No exemplo do almoço dos filósofos
com vinho, tanto L(G’) como Lm(G’)
não são controláveis em relação a L(G).
c1
CM
b1
BM
m2
m1
MM
c2
m2 MC
m2 m1
b2
d1 c2
d
c
2
CC 1
c2 d1
d2 c MB
1
b1 b2
m1
BC
CB
Objectives of Supervision
Given a specification K  Lm(G) which
represents the tasks we want to be completed
under supervision,
find (if possible) a nonblocking supervisor h
such that the closed loop behavior satisfies
Lm(h/G) = K
L - closure
Def.: Let K and L be languages with
K  L  S*. K is said to be closed w.r.t L
or L-closed if
K = K L
i.e., K is L-closed if every one of its prefixes
that belong to L, are also contained in K.
Example:
G:
a
b
l
l
m
a
Lm(G) = {ab, ablm, alam }
K1 = {ab} is Lm-closed since:
K1  Lm = {e, a, ab} Lm = K1
K2 = {alam} is Lm-closed since:
K2  Lm = {e, a, al, ala, alam} Lm = K2
K3 = {ablm} is not Lm-closed since:
K3  Lm = {a, ab, abl, ablm} Lm K3
Existence of Supervisors
Proposition: Given a generator G, with
marked language Lm(G), and a specification
K  Lm(G), K  , there exists a nonblocking
supervisor h, such that Lm(h/G) = K
if and only if
K is Lm- closed and L- controllable.
Example:
G:
c
x2
b
a
xo
e
x1
d
Eu = {a, c, e}
Ec = {b, d}
x3
L(G) = (abc + ade)*(e + a + ab + ad)
Lm(G) = (abc + ade)*(ab + ad)
G is trim (thus open-loop nonblocking)
(Lm = L)
K = (abcade)*(ab + abcad)  Lm(G)
K Lm(G) = K and
K is controllable
Thus there exists a nonblocking h, such that:
Lm(h/G) = K
Supervisor synthesis:
The solution can be represented by any DES S,
such that L(S) //s L(G) = K
A possible solution is S with L(S) = K
e
S:
c
b
a
a
d
which represents any supervisor h of the form:
h
(abcade)*
( )*a
( )*ab
( )*abc
( )*abca
( )*abcad
a
1
1
1
1
1
1
b
1
0
-
c
1
1
1
1
1
1
d
0
1
-
e
1
1
1
1
1
1
Not the solution with minimal number of states.
Another solution is:
a
d,e
yo
y1
b,c
a
where:
L(S) = [(d + e)*a (b + c)*a]*[e + (d + e)* +
+ (d + e)*a + (d + e)*a (b + c)*]
and L(S) //s L(G) = L(S) L(G) = K
The above DES is a representation of:
h
a
b
c
d
e
(abcade)*(e +
abca + abcad)
1
0
1
1
1
(abcade)*(a +
ab + abc)
1
1
1
0
1
Supremal Controllable Sub-language
(Least restrictrif (optimal) supervisor)
Controllability is necessary for the existence
of supervisors
Question: What to do if K is not controllable ?
We will show that there exists a unique best
approximation of K, the supremal controllable
language contained in K (notation: sup C (K))
Under certain conditions this language satisfies
also the closure conditions which guaranties
the existence of a supervisor. Such supervisor
is the least restrictive or optimal supervisor.
Existence of the supremal controllable
sublanguage of K
Let L(G) (generated by a DES G) and
K  S* (closed-loop specification).
C(K) = {J  K / J is L controllable
i.e.
JEu  L(G)  J}
Proposition: C(K) is non-empty and closed
under the operation of union.
In particular, C(K) contains a unique supremal
element denoted sup C(K).
Proposition: Let K  Lm(G) be Lm-closed
(K = K  Lm). Then sup C(K) is Lm-closed.
Corollary: Let G be a DES with generated
behavior L(G) and marked behavior Lm(G).
We have:
• if K  Lm, K  and K = K  Lm, there exists a
nonblocking supervisor h such that
Lm(h/G) = sup C(K)
Obs.: The above supervisor induces a behavior
within the specifications given by K in the
least possible restrictive way. In this sense it
is optimal.
Synthesis of supC(K)
Let:
K: a regular language
G: a DES with behaviors L(G) and Lm(G)
S: a trim generator with Lm(S) = K Lm(G)
Algorithm 1:
1) Compute Co = G // S; make i=0;
(Observe that:
Lm(Co) = Lm(G)  Lm(S) = K)
2) Identify the bad states in Ci;
states (x,y) s. t. Su(G’)(x)  Su(Ci)(x,y);
3) Obtain Ci’ by eliminating the bad states in Ci and
their associated transitions. Make Ci+1 = trim Ci’
4) If Ci+1 = Ci , stop since sup C(K) = Lm(Ci);
otherwise make i = i+1 and go to step 2.
Algorithm 2:
1) as in the above algorithm;
2) Identify bad states in Ci as in 2 of the above
algorithm. If there is no bad states, go to 6;
3) Build Ci’ by deleting all transitions which
correspond to controllable events in Ci;
4) Determine other bad states, as those which
have paths in Ci’ leading to at least an already
identified bad state;
5) Modify Ci, by deletingthe bad states identified
in steps 3 e 5, and corresponding transitions;
make Ci+1 = trim Ci;
6) If Ci+1 = Ci , stop since sup C(K) = Lm(Ci);
otherwise make i = i+1 and go to 2.
Example:
G:
c
xo
u
x1
a,b
x2
a
Su = {u};
a
L(G) =(a+b)*ca*ua*
K = (ab)*(acu + c)a*
S:
a
yo
y1
c
y2
b
c
Lm(S) = L(S) = K
sup C(K) = (ab)*acua*
u
y3
a
Example:
G:
a1
x1
b
b
x2
x3
b
b
xo
a2
x4
x6
g
x5
g
Su = {b,g}
K = a1 + a1bbb(e + b) + a2g*
S:
a1
y1
b
y2
b
b
y4
b
yo
a2
y3
y6
y5
g
sup C(K) = a2g*