Verification of Specifications in Modeling Languages using Basic Protocols
description
Transcript of Verification of Specifications in Modeling Languages using Basic Protocols
27.08.2007
Stepan Potiyenko
Verification of Specifications in Modeling Languages using Basic Protocols
27.08.20072
Technology overview
Basic Protocols(Hoare triples)
Specialized verification tools (static checking, model checking, …)
manualformalization
Requirements SpecificationsEnglish text
Formal ModelMSC, SDL, UML, ...
automatictranslation
27.08.20073
Agents and Environment
Environment with attributes ab
x
Agent• states• local attributes• behavior
27.08.20074
Basic Protocols
Basic Protocol is a triple
where: x is a list of parameters, – is a precondition, u – process (action), – post condition
)( ux
Forall ms;
27.08.2007
MSC usage
27.08.20076
MSC diagram
alt
loop i=0,i<N
opt
Basic protocols
27.08.20077
alt
loop i=0,i<N
opt
MSC diagram Basic protocols
27.08.20078
alt
loop i=0,i<N
opt
MSC diagram Basic protocols
27.08.20079
alt
loop i=0,i<N
opt
MSC diagram Basic protocols
27.08.200710
Basic Protocols for the MSC diagram
MSC usage
27.08.2007
SDL usage
27.08.200712
SDL in terms of BP
System specification – ENVIRONMENT
Process, functional system component - AGENT
Signals, timers – EVENTS
SDL usage
27.08.200713
system
block 1
e e
n
n
vv II r r o
o
n
n
m
m
e e
nn tt
block 2
block 3
process 2
process 3
process 1
process 4
process 5
Example of structure description of SDL model
Structure linearization
system
process 1(block 1)
process 2(block 1,2)
process 4(block 3)
process 3(block 1,2)
process 5(block 3)
e n v i r o n m e n te n v i r o n m e n t
Linearized structure
SDL usage
27.08.200714
p_1:
state s1;
input i;
p_1_s_1:
task x:=x+y;
p_1_s_2:
task
call prc(x);
p_1_s_3:
nextstate s2;
p_1:
state s2 ...
Control flow label is
agent state expression
state s1;
input i;
task x:=x+y;
task
call prc(x);
nextstate s2;
state s2 ...
s1
i
x := x+y;
call prc(x);
s2
SDL usage Control flow labeling
27.08.200715
task x:=x+y;
p_1_s_2:
task call prc(x);
p_1_s_3:
nextstate s2;
States processing
ProcP(p, p_1 );(ProcP p.state = s1) &get_head(p.queue) = i
ProcP(p, p_1_s_1 );last_signal := i;
SENDER := sender(i);remove_head(p.queue)
ProcP#pp_1:
state s1;
input i;
p_1_s_1:
p_1: state s2; ProcP(p, p_1);(ProcP p.state = s2) &
...
SDL usage
27.08.200716
SDL usage Input and save processing
state s1;
save k;
input i;
...
input j;
...
s1
i jk
ProcP(p, p_1 );(ProcP p.state = s1) &get_head(p.queue) = k
ProcP(p, p_1 );add_tail(p.saved, k);
remove_head(p.queue)
ProcP#p
ProcP(p, p_1 );(ProcP p.state = s1) &
~(get_head(p.queue) = i) &~( … = j) & ~( … = k)
ProcP(p, p_1_s_1 );remove_head(p.queue)
ProcP#pProcP(p, p_1 );
(ProcP p.state = s1) &get_head(p.queue) = i
ProcP(p, p_1_s_1 );last_signal := i;
SENDER := sender(i);remove_head(p.queue);
copy_head(p.queue, p.saved);
ProcP#p
27.08.200717
decision x;
(1): task t1:=1;
(<0): output sig;
enddecision;
...
Decision processing (labeling)
t1 := 1;
x
sig
1 <0
p_1_d_1:
decision x;
(x=1):(task t1:=1;
join p_1_d_2);
(x<0): (output sig;
join p_1_d_2);
enddecision;
p_1_d_2: ...
SDL usage
27.08.200718
Decision processing (BP)
p_1_d_1:
decision x;
(x=1):(task t1:=1;
join p_1_d_2 );
(x<0): (output sig;
join p_1_d_2 );
enddecision;
p_1_d_2: ...
ProcP(p, p_1_d_2 );t1 := 1
ProcP(p, p_1_d_1 );(x = 1)
ProcP#p
ProcP(p, p_1_d_2 );add_tail(T1 P1.queue, sig)
ProcP(p, p_1_d_1 );(x < 0)
ProcP#p
SDL usage
27.08.200719
PROCEDURE fun_name FPAR loc_v;
Local variables declaration
start:
desicion (loc_v)
(1): task u:=1;
(<0): task u:=0;
enddecision;
return;
ENDPROCEDURE;
task t1:=1;
p_7:
task
call fun_name(t1);
p_8:
Procedure calls processingSDL usage
ProcP(p, fun_name );add_head(return_seq, p_8);
loc_v := t1
ProcP(p, p_7 )
ProcP#p
ProcP(p, head(return_seq))
ProcP(p, return )
ProcP#p
ProcP(p, return );[ret values];
[flush loc vars]
return_seq: (ret_control_flow, …, Nil)return_val: (values_set, …, Nil)
stack
27.08.2007
UML usage
27.08.200721
Diagram types and perspectives
Sequence diagrams – analogously to MSC. Architecture diagrams, state chart diagrams –
analogously to SDL system with blocks, processes and state transitions.
Packages and classes structure is linearized (multiplicity, generalization).
UML usage
27.08.200722
Plans
It would be great completely to specify subset of UML notations that are translated to BPSL.
The problem of N instances should be resolved.