Anda di halaman 1dari 18

Transformation of

Timed Automata into Mixed


Integer Linear Programs

Sebastian Panek
Overview
Motivation
First modeling approach
Syntax
Semantic
MILP-Formulation
Formulation of scheduling problems
Further work

Motivation: What?
What do we want to do?

1. Model an (optimization) problem as Linearly
Priced Timed Automata (LPTA)
2. Transform it into a Mixed-Integer Linear Program
(MILP)
3. Solve it using MILP algorithms
4. Compare the results to other approaches in
terms of computational effort and usability
Motivation: How?
We have some experience in building
optimization models of hybrid systems and
scheduling problems (Engell, Stursberg, Sand)
TA are simpler than hybrid automata, but there
have been some open questions:
how to formulate parallel compositions?
how to formulate synchronization?
how to formulate continuous time?
how to exploit the simpler structure of TA
how to solve MILP models of TA faster?
Motivation: Why TA?
TA allow modeling complex behaviors quite
easily (simple syntax)
Parallel compositions of TA allow the user
specifying decomposed parts of a system
separately
There exist graphical editors and languages for
the modeling of TA
Powerful analysis tools are available
Motivation: Why MILP?
MILP is appropriate for problems in many
application domains
A well-investigated MILP theory is known for
many years
Many different MILP solution algorithms and
heuristics are available
Powerful free and commercial MILP solvers have
been developed

Modeling and debugging is very difficult!

First approach to the
MILP formulation of TA
LPTA (costs on locations and transitions)
Continuous time in the MILP
Finite set of time points at which transitions may
occur
Networks of TA are possible
Bidirectional synchronization using labels
More complex clock constraints for invariants
and guards are supported (arbitrary polyhedra)
Syntax
Syntax of LPTA
Additionally:
Since MILP models are static, the automaton
cant simply stop in the final state
Insert self-loops in all locations
Those loops allow the TA to do nothing without
additional costs


3 s x
Semantics:
transitions
Bounded time horizon (an upper bound for all
clock valuations must exist)
Finite number of time points n in the MILP implies
finite number of transitions 2n in the TA
Each time point in the MILP corresponds with
1 delay transition
1 discrete transition

) , ( ) , ( d u l u l +
) ' , ' ( ) , ( u l d u l +
Semantics:
synchronization
Semantic for synchronization:
Synchronized transitions are taken if there are at
least two automata waiting for the same label
(bidirectional synchronization)
a
1
A
a
2
A
MILP formulation:
variables
Example LPTA (Larsen et al.)





MILP model with n=4 time points
Real variables for clock vectors
Binary variables for locations and
transitions
2 2
3 > y
2
3 < x
3 < x
{ } x
4
4 3 2 1
, , , k k k k k =
) ( ' ), ( k k x x
) ( ), ( ), (
3 2 1
k l k l k l
) ( ),..., ( ), (
6 2 1
k t k t k t
1
t
2
t
3
t
4
t
5
t
6
t
MILP formulation:
constraints on binary variables
Real variables for time delays
Binary product variables for all combinations of
locations and outgoing transitions


At every k the automaton is in one location:


At every k one transition is taken:
) (k u
), ( ), ( ), ( ), ( ), ( ), (
6 3 3 2 5 2 2 2 4 1 1 1
k t l k t l k t l k t l k t l k t l
1 ) ( ) ( ) (
3 2 1
= + + k l k l k l
1 ) ( ) ( ) ( ) ( ) ( ) (
6 5 4 3 2 1
= + + + + + k t k t k t k t k t k t
MILP formulation:
computing products
Real product variables of clocks and locations




Real product variables of clocks and transitions
...
), ( ) ( ' : ) ( ' ), ( ) ( : ) (
1 1 1 1
k l k k k l k k
l l
= = x x x x
...
), ( ) ( ' : ) ( '
1 1
k t k k
t
= x x
MILP formulation:
clock constraints
Use polyhedral description to express clock
constrains, i.e.

Enforce invariants for locations


Enforce guards for transitions

o o
o
s = s b x A b x A ) (
...
), ( ) ( ' ), ( ) (
1 1 1 1 1 1 1 1
k l k k l k
l l l l l l
s s b x A b x A
...
), ( ) ( '
1 1 1 1
k t k
t t t
s b x A
MILP formulation:
evolution
Delay transitions:
Discrete transitions:




Clock resets on transitions:
| |
T
k u k k 1 ... 1 ) ( ) ( ) ( ' + = x x
) ( ) ( ) 1 (
), ( ) ( ) 1 (
), ( ) ( ) 1 (
6 3 3 2 3
5 2 1 1 2
4 1 2 2 1
k t l k t l k l
k t l k t l k l
k t l k t l k l
+ = +
+ = +
+ = +
( )

= +
t
t t
k k r x x ) ( ' ) 1 (
MILP formulation:
objective function
Define start state and final states fixing
corresponding variables:


Define products for the objective function:


Objective function: minmize costs over all runs

|
.
|

\
|
+ =
k t
t
l
l l
k t k u
k t c k u c J ) ( ) ( min
) ( ), (
) ( ) ( : ) ( k l k u k u
l
=
1 ) ( , 1 ) ( , 0 ) (
4 3 1 1 1
= = = k l k l k x
TA formulation of scheduling
problems
According to O. Maler and A. Fehnker
Use additional constraints to assert exclusive
allocation of resources
Example: 2 jobs and 2 resources
1
J
1
R
2
R
2
J
1
R
2
R
{ } x
d x > d x > d x >
{ } x { } x { } x
d x >
Further work
Improve the MILP formulation
Test it on large scale models
Implement other types of TA (i.e. Uppaal-TA)
Build a parser which accepts common TA
description languages and generates MILP code
automatically
Compare the different approaches:
TA model, symbolic solution
MILP model, MILP solution,
TA model, MILP solution