Control from Computer Science Oded Maler CNRS-VERIMA G - - PDF document

control from computer science oded maler cnrs verima g
SMART_READER_LITE
LIVE PREVIEW

Control from Computer Science Oded Maler CNRS-VERIMA G - - PDF document

Control from Computer Science Oded Maler CNRS-VERIMA G Grenoble, F rance Control from Computer Science Oded Maler Mo del-based System Design Experiments World Formal Model Thinking I O Analysis Design Implementation


slide-1
SLIDE 1 Control from Computer Science Oded Maler CNRS-VERIMA G Grenoble, F rance
slide-2
SLIDE 2 Control from Computer Science Oded Maler Mo del-based System Design

World Formal Model Analysis Design Abstract Controller Experiments Thinking Implementation O I Controller

1
slide-3
SLIDE 3 Control from Computer Science Oded Maler The Coee Machine Physics-Info rmation Info rmation Pro cessing Buttons Coins Coins Drinks M 1 5 4 6 M 2 drink-ready st-tea st-coffee 3 2 1 coin-in cancel coin-out 7 8 9 req-coffee req-tea reset
  • k
done P
  • rt
F rom!T
  • Event
t yp es Meaning 1 E ! M 1 coin-in a coin w as inserted 2 E ! M 1 cancel cancel button p ressed 3 M 1 ! E coin-out release the coin 4 M 1 ! M 2
  • k
sucient money inserted 5 M 1 ! M 2 reset money returned to user 6 M 2 ! M 1 done drink distribution ended 7 E ! M 2 req-coffee coee button p ressed req-tea tea button p ressed 8 E ! M 2 drink-ready drink p repa ration ended 9 M 2 ! E st-coffee sta rt p repa ring coee st-tea sta rt p repa ring tea 2
slide-4
SLIDE 4 Control from Computer Science Oded Maler The Tw
  • Sub-Machines
done/ 1 coin-in/
  • k
cancel/coin-out, reset drink-ready/done drink-ready/done A C B D
  • k/
reset/ M 2 req-coffee/st-coffee req-tea/st-tea M 1 3
slide-5
SLIDE 5 Control from Computer Science Oded Maler The Global Mo del 0A 1B drink-ready/ drink-ready/ 1C 1D 0C 0D cancel/coin-out cancel/coin-out req-tea/st-tea req-coffee/st-coffee cancel/coin-out coin-in/ No rmal b ehavio rs: 0A coin-in 1B cancel coin-out 0A 0A coin-in 1B req-coffee st-coffee 1C drink-ready 0A 4
slide-6
SLIDE 6 Control from Computer Science Oded Maler An Unexp ected Behavio r 0A 1B drink-ready/ drink-ready/ 1C 1D 0C 0D cancel/coin-out cancel/coin-out req-tea/st-tea req-coffee/st-coffee cancel/coin-out coin-in/ 0A coin-in 1B req-coffee st-coffee 1C cancel coin-out 0C drink-ready 0A 5
slide-7
SLIDE 7 Control from Computer Science Oded Maler Fixing the Bug drink-ready/done drink-ready/done A C B D reset/ req-coffee/st-coffee,lock req-tea/st-tea,lock M 2
  • k/
M 1 1 coin-in/
  • k
2 lock/ cancel/coin-out, reset done/ 6
slide-8
SLIDE 8 Control from Computer Science Oded Maler Fixing the Bug { the Global Mo del 0A 1B drink-ready/ 2C 2D coin-in/ cancel/coin-out req-tea/st-tea req-coffee/st-coffee drink-ready/ 7
slide-9
SLIDE 9 Control from Computer Science Oded Maler The Mo ral
  • f
the Sto ry 1) Many systems can b e mo deled as a comp
  • sition
  • f
interacting automata (transition systems, discrete event systems). 2) P
  • tential
b ehavio rs
  • f
the system co rresp
  • nd
to paths in the global transition graph
  • f
the system. 3) These paths a re lab eled b y input events. Each input sequence might generate a dierent b ehavio r. 4) W e w ant to mak e sure that a system resp
  • nds
co rrectly to all conceivable inputs. 5) F
  • r
every individual input sequence w e can simulate the reaction
  • f
the system. But w e cannot do it exhaustively due to the huge numb er
  • f
input sequences. 6) V erication is a collection
  • f
automatic and semi- automatic metho ds to analyze all the paths in the graph. 7) This is ha rd fo r humans to do and even fo r computers. 8
slide-10
SLIDE 10 Control from Computer Science Oded Maler Mo del I: Closed Systems A transition system is S = (X ;
  • )
where X is nite and
  • :
X ! X is the transition function. The state-space X has no numerical meaning and no interesting structure. X k is the set
  • f
all sequences
  • f
length k ; X
  • the
set
  • f
all sequences. Behavio r: The b ehavio r
  • f
S sta rting from an initial state x 2 X , is
  • =
  • [0];
  • [1];
: : : 2 X
  • s.t.
  • [0]
= x and fo r every i,
  • [i
+ 1] =
  • (
[i]) Basic Reachabilit y Problem: Given x and a set P
  • X
, do es the b ehavio r
  • f
S sta rting at x reach P ? 9
slide-11
SLIDE 11 Control from Computer Science Oded Maler Solution b y F
  • rw
a rd Simulation
  • [0]:=x
F := fx g rep eat
  • [k
+ 1]:= ( [k ]) F k +1 := F k [ f [i + 1]g until F k +1 = F k F
  • :=F
k x 1 x 2 x 3 x 4 x 5 fx 1 g; fx 1 ; x 2 g; fx 1 ; x 2 ; x 3 g; fx 1 ; x 2 ; x 3 ; x 5 g Ho w to do it fo r continuous system dened b y _ x = f (x) ? 10
slide-12
SLIDE 12 Control from Computer Science Oded Maler Mo del I I: Systems with One Input A
  • ne-input
transition system is S = (X ; V ;
  • )
where X and V a re nite
  • :
X
  • V
! X is the transition function. Behavio r Induced b y Input: Given an input sequence 2 V
  • ,
the b ehavio r
  • f
S sta rting from x 2 X in the p resence
  • f
is a sequence
  • (
) =
  • [0];
  • [1];
: : : 2 X
  • suc
h that
  • [i
+ 1] =
  • (
[i]; [i]): v 1 v 2 v 2 v 1 v 1 v 1 v 2 v 2 x 1 x 2 x 3 x 4 x 5 v 1 ; v 2 x 1 v 1
  • !
x 2 v 2
  • !
x 3 v 2
  • !
x 5 v 1
  • !
x 2 v 1
  • !
x 4 11
slide-13
SLIDE 13 Control from Computer Science Oded Maler Reachabilit y fo r Op en Systems The reachabilit y p roblem: Is there some input sequence 2 V
  • such
that
  • (
) reaches P ? F
  • r
every given w e can use the p revious algo rithm, simulate and
  • btain
F
  • (
). F
  • r
an automaton with n states all states a re reachable b y sequences
  • f
length < n. F
  • =
[
  • 2V
n F
  • (
) v 1 v 2 x 4 x 5 x 5 v 2 v 1 x 3 x 4 x 5 v 1 v 2 v 1 v 2 v 1 v 2 v 1 v 2 v 1 v 2 x 3 x 1 x 2 x 3 x 5 x 2 x 1 x 2 x 5 12
slide-14
SLIDE 14 Control from Computer Science Oded Maler A Mo re Ecient W a y Many dierent inputs lead to the same state. Immediate successo rs:
  • (x)
= fx : 9u
  • (x;
u) = x g Successo rs
  • f
a set F :
  • (F
) = f (x) : x 2 F g F
  • rw
a rd reachabilit y algo rithm (b readth-rst): F := fx g rep eat F k +1 := F k [
  • (F
k ) until F k +1 = F k F
  • :=F
k v 1 v 2 v 1 v 2 v 1 v 2 x 3 x 5 x 2 x 1 x 2 x 5 v 1 v 2 x 4 x 5 x 5 x 3 x 1 v 1 v 2 Complexit y:
  • nly
O (n
  • log
n
  • jV
j) 13
slide-15
SLIDE 15 Control from Computer Science Oded Maler V a riations: Depth-First and Backw a rds Depth-rst: v 1 v 1 x 3 x 2 v 1 v 2 x 4 x 5 x 5 v 2 v 1 x 3 x 4 x 5 v 1 v 2 x 5 x 2 x 5 x 1 v 2 Backw a rds: nd all states from which there is an input leading to P . Immediate p redecesso rs:
  • 1
(x) = fx : 9u
  • (x
; u) = xg F := P rep eat F k +1 := F k [
  • 1
(F k ) until F k +1 = F k F
  • :=F
k 14
slide-16
SLIDE 16 Control from Computer Science Oded Maler Admissible Inputs So fa r w e have assumed that the external environment can generate all sequences in V
  • .
Sometimes w e have a mo re restricted environment, e.g. it will never p ro duce v 1 v 1 . W e can build an automaton which mo dels the environment and comp
  • se
it with the mo del
  • f
the system. v 1 v 2 v 2 v 1 v 1 v 1 v 2 v 2 x 1 x 2 x 3 x 4 x 5 v 1 ; v 2 v 1 v 2 v 2 v 1 v 1 v 2 v 2 x 1 x 2 x 3 x 5 v 1 v 2 v 2 15
slide-17
SLIDE 17 Control from Computer Science Oded Maler V erication: The State-of-the-Art There a re algo rithms that tak e a description
  • f
any
  • p
en system and verify whether any
  • f
the admissible inputs drives the system into a set P . Such algo rithms alw a ys terminate after a nite numb er
  • f
steps. This is essentially what verication is all ab
  • ut.
The result is general: it is valid fo r every discrete nite-state system. Of course, nite systems can b e very la rge and sp ecial tricks a re needed to verify them. The analogue fo r continuous systems: do the same fo r a system dened b y _ x = f (x; u). 16
slide-18
SLIDE 18 Control from Computer Science Oded Maler Systems with t w
  • Inputs
A t w
  • -input
transition system is S = (X ; U ; V ;
  • )
where X , U and V a re nite sets and
  • :
X
  • U
  • V
! X is the transition function. u 1 u 1 u 1 u 2 u 2 u 2 v 1 v 2 v 2 v 1 v 2 v 2 v 1 v 2 v 1 v 2 v 2 v 1 u 2 v 1 u 1 v 1 ; v 2 v 1 x 2 x 3 x 5 x 4 x 1
  • (x
1 ; u 1 ; v 1 ) = x 1
  • (x
1 ; u 1 ; v 2 ) = x 2
  • (x
1 ; u 2 ; v 1 ) = x 2
  • (x
1 ; u 2 ; v 2 ) = x 4 The b ehavio r in the p resence
  • f
t w
  • inputs,
  • 2
U
  • and
2 V
  • :
a sequence
  • (
; ) s.t.
  • [i
+ 1] =
  • (
[i];
  • [i];
[i]) 17
slide-19
SLIDE 19 Control from Computer Science Oded Maler Games and Strategies Interp retation
  • f
inputs: U : w e, the go
  • d
guys, the controller. V : they , the bad guys, disturbances. An antagonist game situation. Our goal is to cho
  • se
each time an element
  • f
U such that the b ehavio rs induces b y all p
  • ssible
disturbances a re go
  • d.
Strategy: a function c : X
  • !
U State strategy: a function c : X ! U . Each strategy c converts a t yp e I I I system into a t yp e I I system S c = (X ; V ;
  • c
) s.t.
  • c
(x; v ) =
  • (x;
c(x); v ). Synthesis fo r Reachabilit y: Let S = (X ; U ; V ;
  • )
let P
  • X
b e a set
  • f
\bad" states. The controller synthesis p roblem is: nd a strategy c such that all the b ehavio rs
  • f
the derived system S c = (X ; V ;
  • c
) never reach P . 18
slide-20
SLIDE 20 Control from Computer Science Oded Maler Finding Winning States and Strategies Controllable Predecesso rs: F
  • r
S = (X ; U ; V ;
  • )
and F
  • X
, the set
  • f
controllable p redecesso rs
  • f
F is
  • (F
) = fx : 9u 2 U 8v 2 V
  • (x;
u; v ) 2 F g The states from which the controller, b y p rop erly selecting u, can fo rce the system into P in the next step. The follo wing backw a rd algo rithm nds the set F
  • f
\winning states" from which P can b e avoided fo rever. F := X
  • P
rep eat F k +1 := F k \
  • (F
k ) until F k +1 = F k F
  • :=F
k Rema rk: this is simila r to the Ramadge-W
  • nham
theo ry
  • f
discrete event control. 19
slide-21
SLIDE 21 Control from Computer Science Oded Maler Synthesis Example u 1 u 1 u 1 u 2 u 2 v 1 v 2 v 2 v 1 v 2 v 2 v 1 v 2 v 1 v 2 v 2 v 1 u 2 v 1 u 1 v 1 ; v 2 v 1 x 2 x 3 x 5 x 4 x 1 u 2 W e w ant to avoid x 5 . F = fx 1 ; x 2 ; x 3 ; x 4 g F 1 = fx 1 ; x 2 ; x 3 g = F
  • The
resulting \closed-lo
  • p"
system alw a ys remains in fx 1 ; x 2 ; x 3 g. u 1 v 1 v 2 v 1 v 2 u 1 v 1 ; v 2 x 2 x 3 x 1 u 2 20
slide-22
SLIDE 22 Control from Computer Science Oded Maler Discrete Innite-State Systems Computer p rogram a re syntactic rep resentation
  • f
dynamical systems with innite state-space. rep eat y :=y + 1 until y = 4 State space: fx 1 ; x 2 g
  • Z
x 1 x 2 4 6 : : : 5 4 3 2 y 6= 4/y :=y + 1 x 1 y = 4 x 2 : : : F
  • rw
a rd reachabilit y algo rithm will terminate if sta rted from (x 1 ; 2) but not from (x 1 ; 5). The reachabilit y p roblem is unsolvable: there is no general algo rithm that solves every instance
  • f
it. \Deductive" app roach: p rove p rop erties \analytically". \Symb
  • lic"
app roach: reachabilit y using fo rmulae to rep resent sets
  • f
states, e.g. x = x 1 ^ y
  • 5.
21
slide-23
SLIDE 23 Control from Computer Science Oded Maler Continuous (and Hyb rid) Systems Why? ... Problems: state space R n , innite even when b
  • unded,
time domain R . Mathematical R vs. numerical R in the computer. Reachabilit y fo r _ x = f (x): When w e have a closed- fo rm solution, e.g. fo r _ x = Ax, the reachable set can b e written as F
  • =
fx e At : t
  • 0g
but ho w to test whether F
  • \
P = ;? F
  • rw
a rd simulation: discretize time and replace the system with
  • [(n
+ 1)] =
  • [n]
+ h( [n]; ): P x
  • This
is not the \real" thing and it is not gua ranteed to converge but that's life. 22
slide-24
SLIDE 24 Control from Computer Science Oded Maler Continuous Systems with Input Systems
  • f
the fo rm _ x = f (x; v ). Admissible inputs a re signals
  • f
the fo rm : T ! V . Problem: sho w that no admissible input drives the system into a set P . F
  • r
every w e can simulate and \compute" F
  • (
), but there is no nite subset
  • f
inputs that covers all reachable states. The set
  • f
all inputs is a doubly-dense tree, b
  • th
vertically (time) and ho rizontally (V ). x x 23
slide-25
SLIDE 25 Control from Computer Science Oded Maler Incremental Reachabilit y Computation Breadth-rst computation
  • f
reachable states. x t
  • !
x denotes the existence
  • f
an input signal : [0; t] ! V that drives the system from x to x in t time. Let F b e a subset
  • f
X and let I b e a time interval. The I
  • successo
rs
  • f
F a re all the states that can b e reached from F within that time interval, i.e.
  • I
(F ) = fx : 9x 2 F 9t 2 I x t
  • !
x g: Semigroup p rop ert y:
  • [0;r
2 ] ( [0;r 1 ] (F )) =
  • [0;r
1 +r 2 ] (F ): F := fx g rep eat F k +1 := F k [
  • [0;r
] (F k ) until F k +1 = F k F
  • :=F
k 24
slide-26
SLIDE 26 Control from Computer Science Oded Maler App ro ximate Reachabilit y Computation But
  • [0;r
] (F ) cannot b e computed exactly . W e can
  • ver-app
ro ximate it b y
  • such
that fo r every F
  • [0;r
] (F )
  • [0;r
] (F ) and
  • [0;r
] (F ) b elongs to some eective sub-class
  • f
R n , e.g. pp
  • lyhedra.
The result
  • f
the algo rithm is a set F
  • s.t.
F
  • F
  • and
hence F
  • \
P = ; implies the co rrectness
  • f
the system. x x 25
slide-27
SLIDE 27 Control from Computer Science Oded Maler Conclusion W e have develop ed a system called d/dt which accepts as input a description
  • f
a continuous
  • r
a hyb rid system and computes automatically an
  • ver-
app ro ximation
  • f
the reachable states. Mo re ab
  • ut
it in the sp ecial session
  • n
reachabilit y . Challenge: use mo re kno wledge
  • n
the system dynamics in
  • rder
to increase the p erfo rmance and treat systems with higher dimensions. Challenge: develop algo rithms fo r automatic synthesis
  • f
strategies fo r systems with t w
  • inputs,
_ x = f (x; u; v ). 26