– 09 – 2015-06-11 – main –
Softwaretechnik / Software-Engineering
Lecture 09: Live Sequence Charts
2015-06-11
- Prof. Dr. Andreas Podelski, Dr. Bernd Westphal
Albert-Ludwigs-Universit¨ at Freiburg, Germany
Lecture 09: Live Sequence Charts 2015-06-11 Prof. Dr. Andreas - - PowerPoint PPT Presentation
Softwaretechnik / Software-Engineering Lecture 09: Live Sequence Charts 2015-06-11 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal 09 2015-06-11 main Albert-Ludwigs-Universit at Freiburg, Germany Contents & Goals Last
– 09 – 2015-06-11 – main –
Albert-Ludwigs-Universit¨ at Freiburg, Germany
– 09 – 2015-06-11 – Sprelim –
2/50 Last Lecture:
This Lecture:
– 09 – 2015-06-11 – main –
3/50
– 08 – 2015-06-08 – Slscsyn –
29/78
l1,2 ≺ l1,4, l2,0 ≺ l2,1 ≺ l2,2 ≺ l2,3, l3,0 ≺ l3,1 ≺ l3,2, l1,1 ≺ l2,1, l2,2 ≺ l1,2, l2,3 ≺ l1,3, l3,2 ≺ l1,4, l2,2 ∼ l3,1,
I1 I2 c2 ∧ c3 I3 A B C D E c1
– 09 – 2015-06-11 – main –
4/50
– 09 – 2015-06-11 – Slsc –
5/50
T = {σ0
α1
− → σ1
α2
− → σ2 · · · | · · · } is a set of computation paths.
– 09 – 2015-06-11 – Slsc –
5/50
T = {σ0
α1
− → σ1
α2
− → σ2 · · · | · · · } is a set of computation paths.
But We Want A Software Specification, Don’t We...?
– 07 – 2015-05-21 – Set –16/54
– 09 – 2015-06-11 – Slsc –
5/50
T = {σ0
α1
− → σ1
α2
− → σ2 · · · | · · · } is a set of computation paths.
But We Want A Software Specification, Don’t We...?
– 07 – 2015-05-21 – Set –16/54
– 09 – 2015-06-11 – Slsc –
5/50
T = {σ0
α1
− → σ1
α2
− → σ2 · · · | · · · } is a set of computation paths.
But We Want A Software Specification, Don’t We...?
– 07 – 2015-05-21 – Set –16/54
The language (or semantics) of L is the set of comp. paths accepted by B(L ). Thus an LSC is also software.
– 09 – 2015-06-11 – Slsc –
5/50
T = {σ0
α1
− → σ1
α2
− → σ2 · · · | · · · } is a set of computation paths.
But We Want A Software Specification, Don’t We...?
– 07 – 2015-05-21 – Set –16/54
The language (or semantics) of L is the set of comp. paths accepted by B(L ). Thus an LSC is also software.
uchi acceptance.
– 09 – 2015-06-11 – main –
6/50
– 09 – 2015-06-11 – Stba –
7/50 q1 q2 1 A: Σ = {0, 1} q1 q2 1 B: Σ = {0, 1} q1 q2 1 1 B′: Σ = {0, 1} q1 q2 even(x)
Asym: Σ = ({x} → N) q1 q2 even(x)
Bsym: Σ = ({x} → N) B¨ uchi infinite words symbolic symbolic B¨ uchi infinite words
– 09 – 2015-06-11 – Stba –
8/50
Definition. A Symbolic B¨ uchi Automaton (TBA) is a tuple B = (C, Q, qini, →, QF ) where
Each transitions (q, ψ, q′) ∈ → from state q to state q′ is labelled with a formula ψ ∈ Φ(C).
– 09 – 2015-06-11 – Stba –
9/50
w = σ1, σ2, σ3, · · · ∈ (C → B)ω an infinite word, each letter is a valuation of CB. An infinite sequence ̺ = q0, q1, q2, . . . ∈ Qω
= ψi. Example:
q1 q2 even(x)
Bsym: Σ = ({x} → N)
– 09 – 2015-06-11 – Stba –
10/50
Definition. We say TBA B = (C, Q, qini, →, QF ) accepts the word w = (σi)i∈N0 ∈ (C → B)ω if and only if B has a run ̺ = (qi)i∈N0
̺, i.e., such that ∀ i ∈ N0 ∃ j > i : qj ∈ QF . We call the set Lang(B) ⊆ (C → B)ω of words that are accepted by B the language of B.
– 09 – 2015-06-11 – Stba –
11/50 run: ̺ = q0, q1, q2, . . . ∈ Qω s.t. σi | = ψi, i ∈ N0.
¬a a ¬b b ∧ φ ¬(c ∨ e) c ∧ e ¬(d ∨ f) d ∧ ¬f f ∧ ¬d ¬f f ¬d d d ∧ f true b ∧ ¬φ
– 09 – 2015-06-11 – main –
12/50
– 09 – 2015-06-11 – Scutfire –
13/50
– 09 – 2015-06-11 – Scutfire –
13/50
Definition. Let ((L, , ∼), I, Msg, Cond, LocInv, Θ) be an LSC body. A non-empty set ∅ = C ⊆ L is called a cut of the LSC body iff C
∀ l, l′ ∈ L • l′ ∈ C ∧ l l′ = ⇒ l ∈ C,
∀ l, l′ ∈ L • l′ ∈ C ∧ l ∼ l′ = ⇒ l ∈ C, and
∀ I ∈ I • C ∩ I = ∅.
– 09 – 2015-06-11 – Scutfire –
13/50
Definition. Let ((L, , ∼), I, Msg, Cond, LocInv, Θ) be an LSC body. A non-empty set ∅ = C ⊆ L is called a cut of the LSC body iff C
∀ l, l′ ∈ L • l′ ∈ C ∧ l l′ = ⇒ l ∈ C,
∀ l, l′ ∈ L • l′ ∈ C ∧ l ∼ l′ = ⇒ l ∈ C, and
∀ I ∈ I • C ∩ I = ∅.
The temperature function is extended to cuts as follows: Θ(C) =
, if ∃ l ∈ C • (∄ l′ ∈ C • l ≺ l′) ∧ Θ(l) = hot cold , otherwise that is, C is hot if and only if at least one of its maximal elements is hot.
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
14/50 ∅ = C ⊆ L — downward closed — simultaneity closed — at least one loc. per instance line
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
15/50
The partial order “” and the simultaneity relation “∼” of locations induce a direct successor relation on cuts of L as follows: Definition. Let C ⊆ L bet a cut of LSC body ((L, , ∼), I, Msg, Cond, LocInv, Θ). A set ∅ = F ⊆ L is called fired-set F of C if and only if
∀ l ∈ F ∃ l′ ∈ C • l′ ≺ l ∧ (∄ l′′ ∈ C • l′ ≺ l′′),
∀ l = l′ ∈ F • (∃ I ∈ I • {l, l′} ⊆ I) = ⇒ l l′ ∧ l′ l,
already in C, ∀ (l, E, l′) ∈ Msg • l′ ∈ F = ⇒ l ∈ C. The cut C′ = C∪F is called direct successor of C via F, denoted by C F C′.
– 09 – 2015-06-11 – Scutfire –
16/50
C ∩ F = ∅ — C ∪ F is a cut — only direct ≺-successors — same instance line on front pairwise unordered — sending of asynchronous reception already in
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
16/50
C ∩ F = ∅ — C ∪ F is a cut — only direct ≺-successors — same instance line on front pairwise unordered — sending of asynchronous reception already in
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Scutfire –
17/50
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
q1 q2 q3 q4 q5 q6 q7
¬E! E! ¬E? E? ∧ φ F! F! ¬(F? ∨ G! ∨ G?) G! ∧ G? ∧ ¬F? F? ∧ ¬(G! ∧ G?) ¬F? F? ¬(G! ∧ G?) G! ∧ G? G! ∧ G? ∧ F? true E? ∧ ¬φ
The TBA B(L ) of LSC L over C and E is (C, Q, qini, →, QF ) with
– 09 – 2015-06-11 – Scutfire –
18/50 Recall: The TBA B(L ) of LSC L is (C, Q, qini, →, QF ) with
→= {(q, , q) | q ∈ Q} ∪ {(q, , q′) | q F q′} ∪ {(q, , L) | q ∈ Q}
– 09 – 2015-06-11 – Scutfire –
18/50 Recall: The TBA B(L ) of LSC L is (C, Q, qini, →, QF ) with
So in the following, we “only” need to construct the transitions’ labels:
→= {(q, , q) | q ∈ Q} ∪ {(q, , q′) | q F q′} ∪ {(q, , L) | q ∈ Q}
– 09 – 2015-06-11 – Scutfire –
18/50 Recall: The TBA B(L ) of LSC L is (C, Q, qini, →, QF ) with
So in the following, we “only” need to construct the transitions’ labels:
→= {(q, ψloop(q), q) | q ∈ Q} ∪ {(q, ψprog(q, q′), q′) | q F q′} ∪ {(q, ψexit(q), L) | q ∈ Q}
– 09 – 2015-06-11 – Scutfire –
18/50 Recall: The TBA B(L ) of LSC L is (C, Q, qini, →, QF ) with
So in the following, we “only” need to construct the transitions’ labels:
→= {(q, ψloop(q), q) | q ∈ Q} ∪ {(q, ψprog(q, q′), q′) | q F q′} ∪ {(q, ψexit(q), L) | q ∈ Q}
q . . .
ψloop(q): “what allows us to stay at cut q” “. . . F1” ψprog(q, q′): “characterisation
ψexit(q): “what allows us to legally exit” true
I1 I2 c2 ∧ c3 I3 A B C D E c1
– 09 – 2015-06-11 – Slscsem –
19/50 So in the following, we “only” need to construct the transitions’ labels:
→= {(q, ψloop(q), q) | q ∈ Q} ∪ {(q, ψprog(q, q′), q′) | q F q′} ∪ {(q, ψexit(q), L) | q ∈ Q}
q q1 . . . qn
ψloop(q) =
=:ψhot
loop(q)
hot
(q) ∧ψLocInv
cold
(q) ψexit(q) = ψhot
loop(q) ∧ ¬ψLocInv cold
(q) ∨
1≤i≤n ψhot prog(q, qi) ∧
cold
(q, qi) ∨ ¬ψCond
cold (q, qi)
ψhot
prog(q, qn) ∧ ψCond cold (q, qn) ∧ ψLocInv,• cold
(q, qn) ψhot
prog(q, qn) = ψMsg(q, qn)
∧ ψCond
hot (q, qn) ∧ ψLocInv,• hot
(q, qn) true
I1 I2 c2 ∧ c3 I3 A B C D E c1
– 09 – 2015-06-11 – Slscsem –
20/50
ψloop(q) = ψMsg(q) ∧ ψLocInv
hot
(q) ∧ ψLocInv
cold
(q)
1≤i≤n ψMsg(q, qi) ∧
⇒
ψ∈E!?∩Msg(L) ¬ψ
θ
(q) =
ℓ=(l,ι,φ,l′,ι′)∈LocInv, Θ(ℓ)=θ, ℓ active at q φ
A location l is called front location of cut C if and only if ∄ l′ ∈ L • l ≺ l′. Local invariant (l0, ι0, φ, l1, ι1) is active at cut (!) q if and only if l0 l l1 for some front location l of cut (!) q.
1≤i≤n Msg(Fi)
I1 I2 c2 ∧ c3 I3 A B C D E c1
– 09 – 2015-06-11 – Slscsem –
21/50
ψhot
prog(q, qi) = ψMsg(q, qn) ∧ ψCond hot (q, qn) ∧ ψLocInv,• hot
(qn)
ψ∈Msg(qi\q) ψ ∧ j=i
∧
⇒
ψ∈(E!?∩Msg(L))\Msg(Fi) ¬ψ
θ
(q, qi) =
γ=(L,φ)∈Cond, Θ(γ)=θ, L∩(qi\q)=∅ φ
θ
(q, qi) =
λ=(l,ι,φ,l′,ι′)∈LocInv, Θ(λ)=θ, λ •-active at qi φ
Local invariant (l0, ι0, φ, l1, ι1) is •-active at q if and only if
for some front location l of cut (!) q.
I1 I2 c2 ∧ c3 I3 A B C D E c1
– 09 – 2015-06-11 – Slscsem –
22/50
q1 q2 q3 q4 q5 q6 q7
true I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
Concrete syntax:
LSC: L1 AC: c1 AM: initial I: permissive
I1 I2 I3
E F G
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
A set of words W ⊆ (C → B)ω is accepted by L if and only if
ΘL am = initial am = invariant cold hot where ac = ac0 ∧ ψCond
cold (∅, C0) ∧ ψMsg(∅, C0); C0 is the minimal (or instance heads) cut.
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
A set of words W ⊆ (C → B)ω is accepted by L if and only if
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
hot where ac = ac0 ∧ ψCond
cold (∅, C0) ∧ ψMsg(∅, C0); C0 is the minimal (or instance heads) cut.
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
A set of words W ⊆ (C → B)ω is accepted by L if and only if
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∃ w ∈ W ∃ k ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
hot where ac = ac0 ∧ ψCond
cold (∅, C0) ∧ ψMsg(∅, C0); C0 is the minimal (or instance heads) cut.
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
A set of words W ⊆ (C → B)ω is accepted by L if and only if
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∃ w ∈ W ∃ k ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
hot ∀ w ∈ W • w0 | = ac = ⇒ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
where ac = ac0 ∧ ψCond
cold (∅, C0) ∧ ψMsg(∅, C0); C0 is the minimal (or instance heads) cut.
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
A set of words W ⊆ (C → B)ω is accepted by L if and only if
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∃ w ∈ W ∃ k ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
hot ∀ w ∈ W • w0 | = ac = ⇒ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∀ w ∈ W ∀ k ∈ N0 • wk | = ac = ⇒ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
where ac = ac0 ∧ ψCond
cold (∅, C0) ∧ ψMsg(∅, C0); C0 is the minimal (or instance heads) cut.
– 09 – 2015-06-11 – Slscsem –
24/50
LSC: L1 AC: c1 AM: initial I: permissive
I1 I2 I3
E F G
LSC: L1 AM: initial I: permissive
I1 I2 I3
E F G c1
– 09 – 2015-06-11 – main –
25/50
– 09 – 2015-06-11 – Sswlsc –
26/50 Let S be a software with S = {π = σ0
α1
− − → σ1
α2
− − → σ2 · · · | · · · }. S is called compatible with LSC L over C and E is if and only if
– 09 – 2015-06-11 – Sswlsc –
26/50 Let S be a software with S = {π = σ0
α1
− − → σ1
α2
− − → σ2 · · · | · · · }. S is called compatible with LSC L over C and E is if and only if
Construct letters by joining σi and αi+1 (viewed as a valuation of E!, E?): w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . .
– 09 – 2015-06-11 – Sswlsc –
26/50 Let S be a software with S = {π = σ0
α1
− − → σ1
α2
− − → σ2 · · · | · · · }. S is called compatible with LSC L over C and E is if and only if
Construct letters by joining σi and αi+1 (viewed as a valuation of E!, E?): w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . We say S satisfies LSC L (e.g. universal, invariant), denoted by S | = L , if and only if ∀ π ∈ S ∀ k ∈ N0 • w(π)k | = ac = ⇒ w(π)k | = ψCond
hot (∅, C0) ∧ w(π)/k + 1 ∈ Lang(B(L ))
– 09 – 2015-06-11 – Sswlsc –
26/50 Let S be a software with S = {π = σ0
α1
− − → σ1
α2
− − → σ2 · · · | · · · }. S is called compatible with LSC L over C and E is if and only if
Construct letters by joining σi and αi+1 (viewed as a valuation of E!, E?): w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . We say S satisfies LSC L (e.g. universal, invariant), denoted by S | = L , if and only if ∀ π ∈ S ∀ k ∈ N0 • w(π)k | = ac = ⇒ w(π)k | = ψCond
hot (∅, C0) ∧ w(π)/k + 1 ∈ Lang(B(L ))
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∃ w ∈ W ∃ k ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
hot ∀ w ∈ W • w0 | = ac = ⇒ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∀ w ∈ W ∀ k ∈ N0 • wk | = ac = ⇒ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
– 09 – 2015-06-11 – Sswlsc –
26/50 Let S be a software with S = {π = σ0
α1
− − → σ1
α2
− − → σ2 · · · | · · · }. S is called compatible with LSC L over C and E is if and only if
Construct letters by joining σi and αi+1 (viewed as a valuation of E!, E?): w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . We say S satisfies LSC L (e.g. universal, invariant), denoted by S | = L , if and only if ∀ π ∈ S ∀ k ∈ N0 • w(π)k | = ac = ⇒ w(π)k | = ψCond
hot (∅, C0) ∧ w(π)/k + 1 ∈ Lang(B(L ))
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∃ w ∈ W ∃ k ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
hot ∀ w ∈ W • w0 | = ac = ⇒ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∀ w ∈ W ∀ k ∈ N0 • wk | = ac = ⇒ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
Software S satisfies a set of LSCs L1, . . . , Ln if and only if S | = Li for all 1 ≤ i ≤ n.
– 09 – 2015-06-11 – Sswlsc –
27/50
(Σ × A)ω
?!
Customer Analyst
requirements analysis
One quite effective approach: try to approximate the requirements with positive and negative scenarios.
“If the system is not at all able to do this, then it’s not what I want.”
“If the system does this, then it’s not what I want.”
what about exceptional cases? what about corner-cases? etc.
– 09 – 2015-06-11 – Sswlsc –
28/50 LSC: buy softdrink AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT
– 09 – 2015-06-11 – Sswlsc –
29/50 LSC: get change AC: true AM: invariant I: permissive
User
C50 E1 pSOFT SOFT chg-C50
– 09 – 2015-06-11 – Sprechart –
30/50
– 09 – 2015-06-11 – Sprechart –
30/50 LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
– 09 – 2015-06-11 – Sprechart –
31/50
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
A full LSC L = (PC, MC, ac0, am, ΘL ) actually consist of
– 09 – 2015-06-11 – Sprechart –
32/50
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
ΘL am = initial am = invariant cold
∃ w ∈ W ∃ m ∈ N0 • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∃ w ∈ W ∃ k < m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
hot
∀ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∀ w ∈ W ∀ k ≤ m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
– 09 – 2015-06-11 – Sprechart –
33/50
LSC: buy softdrink AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT
LSC: get change AC: true AM: invariant I: permissive
User
C50 E1 pSOFT SOFT chg-C50
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
(∗: as well as (positive) scenarios in general, like use-cases)
– 09 – 2015-06-11 – Sprechart –
33/50
LSC: buy softdrink AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT
LSC: get change AC: true AM: invariant I: permissive
User
C50 E1 pSOFT SOFT chg-C50
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
(∗: as well as (positive) scenarios in general, like use-cases)
– 09 – 2015-06-11 – Sprechart –
33/50
LSC: buy softdrink AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT
LSC: get change AC: true AM: invariant I: permissive
User
C50 E1 pSOFT SOFT chg-C50
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
(∗: as well as (positive) scenarios in general, like use-cases)
(Because they require that the software never ever exhibits the unwanted behaviour.)
– 09 – 2015-06-11 – Sprechart –
34/50
(Σ × A)ω
Customer Analyst
requirements analysis
– 09 – 2015-06-11 – Sprechart –
34/50
(Σ × A)ω
(Σ × A)ω
Customer Analyst
requirements analysis
– 09 – 2015-06-11 – Sprechart –
35/50
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 pWATER water in stock dWATER OK
– 09 – 2015-06-11 – Sprechart –
35/50
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 pWATER
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!
water in stock dWATER OK
– 09 – 2015-06-11 – Sprechart –
35/50
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 pWATER
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!
water in stock dWATER OK
¬(dSoft! ∨ dTEA!)
– 09 – 2015-06-11 – Sprechart –
36/50
LSC: buy water AC: true AM: invariant I: strict
User CoinValidator ChoicePanel Dispenser C 5 pWATER
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!
water in stock dWATER OK
¬(dSoft! ∨ dTEA!)
LSC: buy water AC: true AM: invariant I: strict
User CoinValidator ChoicePanel Dispenser C 5 p W A T E R water in stock dWATER OK
– 09 – 2015-06-11 – Sprechart –
37/50
LSC: L AM: invariant I: permissive
I1 I2 I3 I4
E F
LSC: L AM: invariant I: permissive
I1 I2 I3 I4
E F
true
– 09 – 2015-06-11 – Sprechart –
38/50
– 05 – 2015-05-11 – Sre –
22/90
A requirements specification should be
— it correctly represents the wishes/needs of the customer,
— all requirements (existing in somebody’s head, or a document, or . . . ) should be present,
— things which are not relevant to the project should not be constrained,
— each requirement is compatible with all other requirements; otherwise the requirements are not realisable,
— a requirements specification does not constrain the realisation more than necessary,
— the sources of requirements are documented, requirements are uniquely identifiable,
— the final product can objectively be checked for satisfying a requirement.
– 09 – 2015-06-11 – Sprechart –
39/50
customer” → still difficult;
relative completeness in the sense of “did we cover all (exceptional) cases?”;
→ still difficult; But LSCs tend to support abstract specifications; specifying technical details is tedious.
meta-properties, need to be established separately;
using LSCs, is immediately
For Decision Tables, we formally defined additional quality criteria:
What about LSCs?
– 09 – 2015-06-11 – main –
40/50
– 09 – 2015-06-11 – Sdrawbacks –
41/50
Recall: Most severe drawbacks of, e.g., MSCs:
msc event_ordering
proc_a proc_b proc_c m1
m2 m3 m4
(a)
(ITU-T, 2011)
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 p W A T E R
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!
water in stock dWATER OK
¬(dSoft! ∨ dTEA!)
– 09 – 2015-06-11 – Sdrawbacks –
42/50
(Harel and Marelly, 2003)
– 09 – 2015-06-11 – main –
43/50
– 09 – 2015-06-11 – Swrapup –
44/50
http://commons.wikimedia.org (CC-by-sa 4.0, Dirk Ingo Franke)
Alphabet:
– dispense cash only,
– return card only,
C
– dispense cash and return card.
C
(M.C) or (C.M)
(C.M)
– 09 – 2015-06-11 – Swrapup –
45/50
Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)} Design S2 = {(M.TM.C, · 1), (C.TC.M, · 1)} Implementation S = {σ0
τ
− → σ1
τ
− → σ2 · · · , . . . } Development Process/ Project Management
– 09 – 2015-06-11 – Swrapup –
45/50
Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)} Design S2 = {(M.TM.C, · 1), (C.TC.M, · 1)} Implementation S = {σ0
τ
− → σ1
τ
− → σ2 · · · , . . . } Development Process/ Project Management
elicit req.(in.) analyst customer
elicitation
req.(in.) formalise req.(fo.) analyst
formalisation
req.(fo.) verify req.(fo.) ✔/✘ analyst
verification
req.(fo.) ✘ fix req.(fo.) analyst
repair
req.(fo.) ✔ validate req.(in.) analyst customer
validation
– 09 – 2015-06-11 – Swrapup –
46/50
One sometimes distinguishes:
Requirements typically stated in terms of system observables (“press WATER button”), needs to be mapped to terms of the software!
Requirements stated in terms of the software.
We touched a bit of both, aimed at a general discussion.
Distinguish domain elements and software elements and (try to) keep them apart to avoid confusion.
– 09 – 2015-06-11 – Swrapup –
47/50
– 03 – 2015-04-30 – Sprocedure –
32/77
Lehmann (Lehman, 1980; Lehman and Ramil, 2001) distinguishes three classes of software (my interpretation, my examples):
be specified; tend to be small; can be developed once and for all. Examples: sorting, compiler (!), compute π or √ · , cryptography, textbook examples, . . .
in feedback loop; specification needs domain model (cf. Bjørner (2006), “A tryptich software development paradigm”); formal specification (today) possible, in terms of domain model, yet tends to be expensive Examples: cruise control, autopilot, traffic lights controller, plant automatisation, . . .
specification often not clear, not even known; can grow huge; delivering the software induces new needs Examples: basically everything else; word processor, web-shop, game, smart-phone apps, . . .
– 09 – 2015-06-11 – Swrapup –
48/50
(Rupp and die SOPHISTen, 2014)
– 09 – 2015-06-11 – main –
49/50
– 09 – 2015-06-11 – main –
50/50
Harel, D. and Marelly, R. (2003). Come, Let’s Play: Scenario-Based Programming Using LSCs and the Play-Engine. Springer-Verlag. ITU-T (2011). ITU-T Recommendation Z.120: Message Sequence Chart (MSC), 5 edition. Ludewig, J. and Lichter, H. (2013). Software Engineering. dpunkt.verlag, 3. edition. Rupp, C. and die SOPHISTen (2014). Requirements-Engineering und -Management. Hanser, 6th edition.