Upload
thiendao123
View
228
Download
0
Embed Size (px)
Citation preview
8/10/2019 Uppaal Intro
1/23
Intro toUPPAAL
Gerd BehrmannKim Larsen
BRICS & Aalborg University
Intro to UPPAAL p.1/2
8/10/2019 Uppaal Intro
2/23
Plan of the Lecture
1. UPPAALArchitecture
2. UPPAALFeatures
3. Train Gate Example4. Demonstration of Uppaal
Intro to UPPAAL p.2/2
8/10/2019 Uppaal Intro
3/23
UPPAALs Architecture
Intro to UPPAAL p.3/2
8/10/2019 Uppaal Intro
4/23
Short view ofUPPAAL
Intro to UPPAAL p.4/2
8/10/2019 Uppaal Intro
5/23
Declarations
Clocks
clock x1, x2,...,xn;
Bounded Integer Variables
int[0,5] i1, i2,... in;Constants
const delay 5, true 1, false 0;
Arraysint x[4] := { 1, 4, 7, 2 }
Intro to UPPAAL p.5/2
8/10/2019 Uppaal Intro
6/23
Expressions
Expression
::= ID
| NAT
| Expression [ Expression ]| ( Expression )
| Expression ++ | ++ Expression
| Expression -- | -- Expression
| Expression AssignOp Expression| UnaryOp Expression
| Expression BinOp Expression
| Expression ? Expression : Expressi
| ID . IDIntro to UPPAAL p.6/2
8/10/2019 Uppaal Intro
7/23
Operators
Unary
- | ! | not
Binary
+ | - | * | / | % | &
| | | | && | ||
and | or | imply
Assignment
:= | += | -= | *= | /= | %=
|= | &= | = | =
Intro to UPPAAL p.7/2
8/10/2019 Uppaal Intro
8/23
Guards
Any expression satisfying the followingconditions is a guard:
It is side effect free, type correct and evaluates to a
boolean.
Only clock variables, integer variables and constants
are referenced (or arrays of these types).
Clocks and differences between clocks are onlycompared to integer expressions (no inequallity).
Guards over clocks are essentially conjunctions (i.e.
disjunctions are only allowed over integer conditions).
Intro to UPPAAL p.8/2
8/10/2019 Uppaal Intro
9/23
Assignments
Any expression satisfying the followingconditions is an assignment:
It has a side effect and is type correct.
Only clock variables, integer variables and constants
are referenced (or arrays of these types).
Only integers are assigned to clocks.
Intro to UPPAAL p.9/2
8/10/2019 Uppaal Intro
10/23
Invariants
Any expression satisfying the followingconditions is an invariant:
It is side effect free and is type correct.
Only clock variables, integer variavles and constants
are referenced (or arrays of these types).
It forms a conjunction of conditions on the form x < e
orx
8/10/2019 Uppaal Intro
11/23
Binary Synchronisation
Channels can be declared like:
chan a, b, c[3];
Ifais channel, then:
a! = Emission
a? = Reception
Two edges in different processes can synchronise
if one is emitting and the other is receiving on the
same channel.
Intro to UPPAAL p.11/2
8/10/2019 Uppaal Intro
12/23
Broascast Synchronization
Broadcast channels can be de declared like:
broadcast chan a, b, c[2];
Ifais a broadcast channel, then:
a! = Emission of a broadcast
a? = Reception of a broadcast
A set of edges in different processes can synchro-
nise if one is emitting and the others are receiving
on the same broadcast channel. A process can
always emit on a broadcast channel. Intro to UPPAAL p.12/2
8/10/2019 Uppaal Intro
13/23
Urgent Channels
No delay if the synchronising edges can betaken!
Restriction: No clock guard allowed on theedges.
Allowed: Guards on data-variables.
Urgent channels can be declared like:urgent chan a,b,c[3];
Intro to UPPAAL p.13/2
8/10/2019 Uppaal Intro
14/23
Urgent Location
No delay in urgent location!
Time is freezed.
Remark: The use of the urgent location reduces
the number of clocks in a model, and thus the
complexity of the analysis.
Intro to UPPAAL p.14/2
8/10/2019 Uppaal Intro
15/23
Committed Location
No delay pass in committed location!
Next transition must involve an edge in one of the
processes in a committed location.
Remark: The use of the committed location con-
siderably reduces the state space.
Intro to UPPAAL p.15/2
8/10/2019 Uppaal Intro
16/23
Templates
Templates can be instantiated to form processes.
Templates are parameterised.
Example of parameter declaration of a template A:(int v, const min, const max)
Example of instantiation:
P := A(i, 1, 5);
Q := A(j, 0, 4);
Example of system declaration:
system P, Q;
Intro to UPPAAL p.16/2
8/10/2019 Uppaal Intro
17/23
Syntax of Properties
A[] ExpressionE ExpressionA Expression
E[] ExpressionExpression --> ExpressionA[] not deadlock
The expressions must be type safe, side effectfree, and evaluate to a boolean. Only references
to integers variables, constants, clocks, and loca-
tions are allowed (and arrays of these). Intro to UPPAAL p.17/2
8/10/2019 Uppaal Intro
18/23
Operators A[] and A
A[]
A
Intro to UPPAAL p.18/2
8/10/2019 Uppaal Intro
19/23
Operators E[] and E
E[]
E
Remark
(A[])=E()and(E[])=A()Intro to UPPAAL p.19/2
8/10/2019 Uppaal Intro
20/23
Operator --> (leads to)
--> def A[](A)
Intro to UPPAAL p.20/2
8/10/2019 Uppaal Intro
21/23
State Property: deadlock
A deadlock is a state in which no action transitionwill ever be enabled again.
In other words(l, u)|=deadlockiff:
d 0, a Act: (l, u+d) a
Checking for absence of deadlocks:A[] not deadlock
Intro to UPPAAL p.21/2
8/10/2019 Uppaal Intro
22/23
Bounded Liveness: Decoration
AG(a = tb)
A[] (B implies x
8/10/2019 Uppaal Intro
23/23
Test Automata
AG(a = tb)
A[] (not T.BAD)
Intro to UPPAAL p.23/2