Title: LOTOS
1LOTOS
- Specifikaciju valodu pamati
2LOTOS ievada piezimes
- LOTOS Language of Temporal Ordering
Specification, valoda notikumu temporala
sakartojuma aprakstam - Balstita uz procesu algebras idejam, lidzigi ka
CCS - LOTOS specifikacijas semantika sistemas
komunikacijas speja, formali uzdota ar iezimeto
pareju sistemam - Komunikacija abpuseja atbildiba par notikumu
(handshake) - (Vaja) bisimulacijas ekvivalence ka procesu
vienadiba - Procesu paralela kompozicija vienadu notikumu
sinhronizacija. Iespejama daudzpuseja
sinhronizacija. - Praktiski izmantojama telekomunikaciju protokolu
aprakstam - Ierobežojumu inkrementacija (constraint oriented
spec.) - ISO standarts
- Datu specifikacija ACT ONE, citas pieejas
3Bazes LOTOS darbibas izteiksmes
- B stop iB gB B1 B2 B1 g1,,
gn B2 hide g1,,gn in B Pg1,,gn
exit B1 gtgt B2 B1 gt B2 - G komunikacijas punktu (komunikacijas notikumu)
kopa - B1 B2 B1 B2 nav sinhronizacijas
- B1 B2 B1 G B2 sinhronizacija uz
visiem notikumiem - ? - Veiksmigas beigas (exit izpildes efekts)
Notikumi Lietotaja definetie Lietotaja un sistemas definetie
Redzamie G, g ? G G G ? ?, g ? G
Redzamie un neredzamie M G ? i, m ? M MG?i, ?, m?M
4Bazes LOTOS darbibu semantika (1)
- mB (m)gt B
- B1 (m)-gt B1 ? B1B2 (m)-gt B1
- B2 (m)-gt B2 ? B1B2 (m)-gt B2
- B1 (m)-gt B1, m?S ? B1SB2 (m)-gt B1SB2
- B2 (m)-gt B2, m?S ? B1SB2 (m)-gt B1SB2
- B1 (g)-gt B1, B2 (g)-gt B2, g ? S?? ?
B1SB2 (g)-gt B1SB2 - Sinhronizacija nav uz i
- Neatkariga izpilde nav uz ?
Notikumi Lietotaja definetie Lietotaja un sistemas definetie
Redzamie G, g ? G G G ? ?, g ? G
Redzamie un neredzamie M G ? i, m ? M MG?i, ?, m?M
5Bazes LOTOS darbibu semantika (2)
- B (m)-gt B, m?g1,,gn ?hide g1,,gn in B
(m)-gt hide g1,,gn in B - B (g)-gt B, g?g1,,gn ?hide g1,,gn in B
(i)-gt hide g1,,gn in B - process Pg1,,gn BP endproc,
- BPg1/g1,g2/g2,,gn/gn (m)-gt B
? Pg1,g2,,gn (m)-gt B
Notikumi Lietotaja definetie Lietotaja un sistemas definetie
Redzamie G, g ? G G G ? ?, g ? G
Redzamie un neredzamie M G ? i, m ? M MG?i, ?, m?M
6Bazes LOTOS darbibu semantika (3)
- exit (?)-gt stop
- B1 (m)-gt B1 ? B1gtgtB2 (m)-gt B1gtgtB2
- B1 (?)-gt B1 ? B1gtgtB2 (i)-gt B2
- B1 (m)-gt B1 ? B1gtB2 (m)-gt B1gtB2
- B1 (?)-gt B1 ? B1gtB2 (?)-gt B1
- B2 (m)-gt B2 ? B1gtB2 (m)-gt B2
Notikumi Lietotaja definetie Lietotaja un sistemas definetie
Redzamie G, g ? G G G ? ?, g ? G
Redzamie un neredzamie M G ? i, m ? M MG?i, ?, m?M
7Bazes LOTOS piemers
- process Max3in1, in2, in3, out
- hide mid in
- ( Max2in1, in2, mid
- mid
- Max2mid, in3, out )
- where
- process Max2a, b, c
- a b c stop
-
- b a c stop
- endproc
- endproc
8Piemers komunikacijas protokola fragments
- process SenderConReq,ConCnf,DatReq,DisReq
Connection_PhaseConReq,ConCnf
gtgt Data_PhaseDatReq,DisReq - where process Connection_PhaseConReq,ConCnf
ConReq ConCnf exitendprocprocess
Data_PhaseDatReq,DisReq (DatReq
Data_PhaseDatReq,DisReq DisReq
stop)endproc - endproc
9Datu komunikacija valoda LOTOS ievads
- type Bool is Datu tipi, aprakstiti valoda ACT
ONE (vai cita)sorts boolopns TRUE, FALSE -gt
bool NOT bool -gt bool AND, OR bool,
bool -gt bool, eqns ofsort bool forall bbool
NOT(TRUE) FALSE NOT(NOT(b)) b b AND
TRUE b, - endtype
- g ?xnatxgt3 g1 !x stop
- hide g in g ?xnatxltmax B1(x) g g
?ynatygtmin B2(y) - g a1, a2, an notikums ar atributiem a1, a2,
an - Katrs atributs !E vai ?xt (var but papildus
nosacijumi)
10Datu komunikacija valoda LOTOS
- g a1, a2, an notikums ar atributiem a1, a2,
an - Katrs atributs !E vai ?xt (var but papildus
nosacijumi) - g !E B (gltval(E)gt)-gt B vertibas
deklaracija - g ?xt B(x) (gltvgt)-gt B(v) mainiga
deklaracija - Sinhronizacija, komunikacija
- B1 (gltv1,,vngt)-gt B1, B2 (gltv1,,vngt)-gt B2
- ? B1gB2 (gltv1,,vngt)-gt B1gB2
- Situacija Nosacijums Efekts
- g !E1 g !E2 val(E1)val(E2)
- g !E g ?xt val(E)t xval(E)
- g ?xt g ?yu tu xyvt
11Datu apstrades izteiksmes
- cond_1 -gt process_1 xgt0 -gt process_1
- cond_2 -gt process_2 x5 -gt process_2
- ... xlt9 -gt process_3
- cond_n -gt process_n
- Var izpildit jebkuru vienu no procesiem, kam
speka atbilstošais nosacijums - choice xnat B(x)
- x izvele notiek, veicot pirmo redzamo vai
neredzamo darbibu procesa B(x) - g ?xt B(x) ekvivalents ar choice xt g!x
B(x) - Autonoma x izvele choice xt i B(x)
- Autonoma x izvele choice xt g B(x)
- choice x1t1,,xntn B(x1,,xn) Vairaku
mainigo izvele - choice g in a1,,an Processg() Notikuma
veida izvele, Processg() process ar notikuma
vardu ka parametru
12Datu apstrade piemers, funkcionalitate
- process compare inp, out (min, max int)
noexit inp ?xint(min lt x lt max -gt out !x
compare inp, out (min, max) x lt min
-gt out !min compare inp, out (x, max)
x gt max -gt out !max compare inp, out
(min, x)) endproc - noexit funkcionalitate, procesam nav
paredzeta veiksmigu beigu iespeja - exit procesam ir paredzeta veiksmigu beigu
iespeja - exit(t1,,tn) procesam ir paredzeta veiksmigu
beigu iespeja, nododot parametrus ar tipiem
t1,,tn virkne sekojošam procesam - B1 gtgt accept x1t1,,xntn in B2 virkne nodoto
vertibu pienemšanas konstrukcija Virknes
konstrukcijas gadijuma nepieciešams, lai
funkcionalitates butu atbilstošas.
13Specifikacijas piemers
- Specification Max3in1,in2,in3,out noexittype
natural is sorts nat opns zero -gt
nat succ nat -gt nat largest nat,nat -gt
nateqns ofsort nat forall x,y
nat largest(zero,x)x largest(x,y)
largest(y,x) largest(succ(x),succ(y))succ(larges
t(x,y))endtypebehaviour hide mid in
(Max2in1,in2,mid mid Max2mid,in3,out)
where process Max2a,b,c noexit a
?xnat b ?ynat c !largest(x,y) stop b
?ynat a ?xnat c !largest(x,y) stop
endproc - endspec
- Apstaiga 3 ieejas in1, in2, in3, uz katras no
tam sanem pa skaitlim, pec tam uz out izdod
lielako no Å¡iem skaitliem.
14Specifikacijas struktura (pamats)
- specification specname gate list (parameter
list) functionalitytype definitions Å¡is ir
globalas tipu definicijas, tas var izmantot
specifikacijas parametru tipu noradišanabehaviour
behaviour expression - where type definitions
- process definitions
- endspec
- process procname gate list (parameter
list) functionality behaviour
expressionwhere type definitions process
definitions - endproc
15Specifikacija ierobežojumu pieaugšanas stila,
piemers
- specification Daemon_Game usr noexit
- library Boolean, Set, NaturalNumber endlib
- behaviour Login_Check usr (empty) Sessions
usr - where type Integer is sorts int opns 0 -gt
int inc,dec int -gt int eqns ofsort int
forall nint inc(dec(n))n dec(inc(n))n
endtypetype Signal is Integer sorts sig_sort
opns newgame, endgame, probe, win, lose, result
-gtsig_sort score int -gt sig_sort
endtypetype Identifier is NaturalNumber renamed
by sortnames id-sort for nat endtypetype
Identifier_set is Set actualizedby Identifier
using sortnames id_sort for elem id_set_sort
for setendtype
16Specifikacija ierobežojumu pieaugšanas stila,
piemers
- behaviour Login_Check usr (empty) Sessions
usr - where
- process Login_Checkusr(used_id_set
id_set_sort) noexit - usr ?idid_sort !newgame id NotIn
used_id_set Login_Checkusr
(insert(id,used_id_set)) - usr ?idid_sort !endgame id IsIn
used_id_set Login_Checkusr
(remove(id,used_id_set)) - usr ?idid_sort !probe id IsIn
used_id_set Login_Checkusr (used_id_set) - usr ?idid_sort !win id IsIn used_id_set Logi
n_Checkusr (used_id_set) - usr ?idid_sort !lose id IsIn
used_id_set Login_Checkusr (used_id_set) - usr ?idid_sort !result id IsIn
used_id_set Login_Checkusr (used_id_set) - choice xint usr ?idid_sort !score(x)
id IsIn used_id_set Login_Checkusr
(used_id_set) - endproc
17Specifikacija ierobežojumu pieaugšanas stila,
piemers
- behaviour Login_Check usr (empty) Sessions
usr - where
- process Sessions usr noexit
- (usr ?idid_sort !newgame ( Gameusr(id,0)
gt usr !id !endgame stop)) Sessions usr - where
- process Gameusr(idid_sort, totalint) noexit
- usr !id !probe( i usr !id !win Game usr
(id, inc(total)) i usr !id !lose Game usr
(id, dec(total)) ) - usr !id !resultusr !id !score (total) Game
usr (id, total) - endproc
- endproc ( Sessions )
- endspec