Real-Time Systems Lecture 05: Duration Calculus III 2013-05-07 05 - - PowerPoint PPT Presentation

real time systems
SMART_READER_LITE
LIVE PREVIEW

Real-Time Systems Lecture 05: Duration Calculus III 2013-05-07 05 - - PowerPoint PPT Presentation

Real-Time Systems Lecture 05: Duration Calculus III 2013-05-07 05 2013-05-07 main Dr. Bernd Westphal Albert-Ludwigs-Universit at Freiburg, Germany Contents & Goals Last Lecture: DC Syntax and Semantics: Terms,


slide-1
SLIDE 1

Real-Time Systems

Lecture 05: Duration Calculus III

2013-05-07

  • Dr. Bernd Westphal

Albert-Ludwigs-Universit¨ at Freiburg, Germany

– 05 – 2013-05-07 – main –

slide-2
SLIDE 2

Contents & Goals

Last Lecture:

  • DC Syntax and Semantics: Terms, Formulae

This Lecture:

  • Educational Objectives: Capabilities for following tasks/questions.
  • Read (and at best also write) Duration Calculus formulae – including

abbreviations.

  • What is Validity/Satisfiability/Realisability for DC formulae?
  • How can we prove a design correct?
  • Content:
  • Duration Calculus Abbreviations
  • Basic Properties
  • Validity, Satisfiability, Realisability

– 05 – 2013-05-07 – Sprelim –

2/36

slide-3
SLIDE 3

Duration Calculus Cont’d

– 05 – 2013-05-07 – main –

3/36

slide-4
SLIDE 4

Duration Calculus: Overview

We will introduce three (or five) syntactical “levels”: (i) Symbols: f, g, true, false, =, <, >, ≤, ≥, x, y, z, X, Y, Z, d (ii) State Assertions: P ::= 0 | 1 | X = d | ¬P1 | P1 ∧ P2 (iii) Terms: θ ::= x | ℓ | ∫ P | f(θ1, . . . , θn) (iv) Formulae: F ::= p(θ1, . . . , θn) | ¬F1 | F1 ∧ F2 | ∀ x • F1 | F1 ; F2 (v) Abbreviations: ⌈ ⌉, ⌈P⌉, ⌈P⌉t, ⌈P⌉≤t, ♦F, F

– 05 – 2013-05-07 – Sdcform –

4/36

slide-5
SLIDE 5

Formulae: Remarks

Remark 2.10. [Rigid and chop-free] Let F be a duration formula, I an interpretation, V a valuation, and [b, e] ∈ Intv.

  • If F is rigid, then

∀ [b′, e′] ∈ Intv : IF(V, [b, e]) = IF(V, [b′, e′]).

  • If F is chop-free or θ is rigid,

then in the calculation of the semantics of F, every occurrence of θ denotes the same value.

– 05 – 2013-05-07 – Sdcform –

5/36

slide-6
SLIDE 6

Substitution Lemma

Lemma 2.11. [Substitution] Consider a formula F, a global variable x, and a term θ such that F is chop-free or θ is rigid. Then for all interpretations I, valuations V, and intervals [b, e], IF[x := θ](V, [b, e]) = IF(V[x := d], [b, e]) where d = Iθ(V, [b, e]).

  • F := ℓ = x ; ℓ = x =

⇒ ℓ = 2 · x, θ := ℓ

– 05 – 2013-05-07 – Sdcform –

6/36

slide-7
SLIDE 7

Duration Calculus: Overview

We will introduce three (or five) syntactical “levels”: (i) Symbols: f, g, true, false, =, <, >, ≤, ≥, x, y, z, X, Y, Z, d (ii) State Assertions: P ::= 0 | 1 | X = d | ¬P1 | P1 ∧ P2 (iii) Terms: θ ::= x | ℓ | ∫ P | f(θ1, . . . , θn) (iv) Formulae: F ::= p(θ1, . . . , θn) | ¬F1 | F1 ∧ F2 | ∀ x • F1 | F1 ; F2 (v) Abbreviations: ⌈ ⌉, ⌈P⌉, ⌈P⌉t, ⌈P⌉≤t, ♦F, F

– 05 – 2013-05-07 – Sdcform –

7/36

slide-8
SLIDE 8

Duration Calculus Abbreviations

– 05 – 2013-05-07 – main –

8/36

slide-9
SLIDE 9

Abbreviations

  • ⌈⌉ := ℓ = 0

(point interval)

  • ⌈P⌉ := ∫ P = ℓ ∧ ℓ > 0

(almost everywhere)

  • ⌈P⌉t := ⌈P⌉ ∧ ℓ = t

(for time t)

  • ⌈P⌉≤t := ⌈P⌉ ∧ ℓ ≤ t

(up to time t)

  • ♦F := true ; F ; true

(for some subinterval)

  • F := ¬♦¬F

(for all subintervals)

– 05 – 2013-05-07 – Sdcabbrev –

9/36

slide-10
SLIDE 10

Abbreviations: Examples

Time 1 LI 2 4 6 8

I ∫ L = 0 (V, [0, 2] ) = I ∫ L = 1 (V, [2, 6] ) = I ∫ L = 0 ; ∫ L = 1 (V, [0, 6] ) = I ⌈¬L⌉ (V, [0, 2] ) = I ⌈L⌉ (V, [2, 3] ) = I ⌈¬L⌉ ; ⌈L⌉ (V, [0, 3] ) = I ⌈¬L⌉ ; ⌈L⌉ ; ⌈¬L⌉ (V, [0, 6] ) = I ♦⌈L⌉ (V, [0, 6] ) = I ♦⌈¬L⌉ (V, [0, 6] ) = I ♦⌈¬L⌉2 (V, [0, 6] ) = I ⌈¬L⌉2 ; ⌈¬L⌉1 ; ⌈¬L⌉3 (V, [0, 6] ) = I ⌈¬L⌉2 ; ⌈L⌉1 ; ⌈¬L⌉3 (V, [0, 6] ) =

– 05 – 2013-05-07 – Sdcabbrev –

10/36

slide-11
SLIDE 11

Duration Calculus: Looking back

  • Duration Calculus is an interval logic.
  • Formulae are evaluated in an (implicitly given) interval.

Back to our gas burner:

  • G, F, I, H,

D(G) = · · · = D(H) = {0, 1}

gas valve flame sensor ignition

  • Define L as G ∧ ¬F.

Strangest operators:

  • everywhere — Example: ⌈G⌉

(Holds in a given interval [b, e] iff the gas valve is open almost everywhere.)

  • chop — Example: (⌈¬I⌉ ; ⌈I⌉ ; ⌈¬I⌉) =

⇒ ℓ ≥ 1

(Ignition phases last at least one time unit.)

  • integral — Example: ℓ ≥ 60 =

⇒ ∫ L ≤

ℓ 20

(At most 5% leakage time within intervals of at least 60 time units.)

– 05 – 2013-05-07 – Sdcpreview –

11/36

slide-12
SLIDE 12

DC Validity, Satisfiability, Realisability

– 05 – 2013-05-07 – main –

12/36

slide-13
SLIDE 13

Validity, Satisfiability, Realisability

Let I be an interpretation, V a valuation, [b, e] an interval, and F a DC formula.

  • I, V, [b, e] |

= F (“F holds in I, V, [b, e]”) iff IF(V, [b, e]) = tt.

  • F is called satisfiable iff it holds in some I, V, [b, e].
  • I, V |

= F (“I and V realise F”) iff ∀ [b, e] ∈ Intv : I, V, [b, e] | = F.

  • F is called realisable iff some I and V realise F.
  • I |

= F (“I realises F”) iff ∀ V ∈ Val : I, V | = F.

  • |

= F (“F is valid”) iff ∀ interpretation I : I | = F.

– 05 – 2013-05-07 – Sdcsat –

13/36

slide-14
SLIDE 14

Validity vs. Satisfiability vs. Realisability

Remark 2.13. For all DC formulae F,

  • F is satisfiable iff ¬F is not valid,

F is valid iff ¬F is not satisfiable.

  • If F is valid then F is realisable, but not vice versa.
  • If F is realisable then F is satisfiable, but not vice versa.

– 05 – 2013-05-07 – Sdcsat –

14/36

slide-15
SLIDE 15

Examples: Valid? Realisable? Satisfiable?

  • I, V, [b, e] |

= F (“F holds in I, V, [b, e]”) iff IF(V, [b, e]) = tt.

  • F is called satisfiable iff it holds in some I, V, [b, e].
  • I, V |

= F (“I and V realise F”) iff ∀ [b, e] ∈ Intv : I, V, [b, e] | = F.

  • F is called realisable iff some I and V realise F.
  • I |

= F (“I realises F”) iff ∀ V ∈ Val : I, V | = F.

  • |

= F (“F is valid”) iff ∀ interpretation I : I | = F.

Satisfiable Realisable Valid ℓ ≥ 0 ℓ = ∫ 1 ℓ = 30 ⇐ ⇒ ℓ = 10 ; ℓ = 20 ((F ; G) ; H) ⇐ ⇒ (F ; (G ; H)) ∫ L ≤ x ℓ = 2

– 05 – 2013-05-07 – Sdcsat –

15/36

slide-16
SLIDE 16

Initial Values

  • I, V |

=0 F (“I and V realise F from 0”) iff ∀ t ∈ Time : I, V, [0, t] | = F.

  • F is called realisable from 0 iff some I and V realise F from 0.
  • Intervals of the form [0, t] are called initial intervals.
  • I |

=0 F (“I realises F from 0”) iff ∀ V ∈ Val : I, V | =0 F.

  • |

=0 F (“F is valid from 0”) iff ∀ interpretation I : I | =0 F.

– 05 – 2013-05-07 – Sdcsat –

16/36

slide-17
SLIDE 17

Initial or not Initial...

For all interpretations I, valuations V, and DC formulae F, (i) I, V | = F implies I, V | =0 F, but not vice versa, (ii) if F is realisable then F is realisable from 0, but not vice versa, (iii) F is valid iff F is valid from 0.

– 05 – 2013-05-07 – Sdcsat –

17/36

slide-18
SLIDE 18

Specification and Semantics-based Correctness Proofs of Real-Time Systems with DC

– 05 – 2013-05-07 – main –

18/36

slide-19
SLIDE 19

Methodology: Ideal World...

(i) Choose a collection of observables ‘Obs’. (ii) Provide the requirement/specification ‘Spec’ as a conjunction of DC formulae (over ‘Obs’). (iii) Provide a description ‘Ctrl’

  • f the controller in form of a DC formula (over ‘Obs’).

(iv) We say ‘Ctrl’ is correct (wrt. ‘Spec’) iff | =0 Ctrl = ⇒ Spec.

– 05 – 2013-05-07 – Sdcmeth –

19/36

slide-20
SLIDE 20

Gas Burner Revisited

gas valve flame sensor ignition

(i) Choose observables:

  • two boolean observables G and F

(i.e. Obs = {G, F}, D(G) = D(F) = {0, 1})

  • G = 1: gas valve open

(output)

  • F = 1: have flame

(input)

  • define L := G ∧ ¬F (leakage)

(ii) Provide the requirement: Req : ⇐ ⇒ (ℓ ≥ 60 = ⇒ 20 · ∫ L ≤ ℓ)

– 05 – 2013-05-07 – Sdcgasburner –

20/36

slide-21
SLIDE 21

Gas Burner Revisited

(iii) Provide a description ‘Ctrl’

  • f the controller in form of a DC formula (over ‘Obs’).

Here, firstly consider a design:

  • Des-1 : ⇐

⇒ (⌈L⌉ = ⇒ ℓ ≤ 1)

  • Des-2 : ⇐

⇒ (⌈L⌉ ; ⌈¬L⌉ ; ⌈L⌉ = ⇒ ℓ > 30) (iv) Prove correctness:

  • We want (or do we want |

=0...?): | = (Des-1 ∧ Des-2 = ⇒ Req) (Thm. 2.16)

– 05 – 2013-05-07 – Sdcgasburner –

21/36

slide-22
SLIDE 22

Gas Burner Revisited

(iii) Provide a description ‘Ctrl’

  • f the controller in form of a DC formula (over ‘Obs’).

Here, firstly consider a design:

  • Des-1 : ⇐

⇒ (⌈L⌉ = ⇒ ℓ ≤ 1)

  • Des-2 : ⇐

⇒ (⌈L⌉ ; ⌈¬L⌉ ; ⌈L⌉ = ⇒ ℓ > 30) (iv) Prove correctness:

  • We want (or do we want |

=0...?): | = (Des-1 ∧ Des-2 = ⇒ Req) (Thm. 2.16)

  • We do show

| = Req-1 = ⇒ Req (Lem. 2.17) with the simplified requirement Req-1 := (ℓ ≤ 30 = ⇒ ∫ L ≤ 1),

  • and we show

| = (Des-1 ∧ Des-2) = ⇒ Req-1. (Lem. 2.19)

– 05 – 2013-05-07 – Sdcgasburner –

21/36

slide-23
SLIDE 23

References

– 05 – 2013-05-07 – main –

35/36

slide-24
SLIDE 24

References

[Olderog and Dierks, 2008] Olderog, E.-R. and Dierks, H. (2008). Real-Time Systems

  • Formal Specification and Automatic Verification. Cambridge University Press.

– 05 – 2013-05-07 – main –

36/36