15.07.2013 Views

Duration Calculus

Duration Calculus

Duration Calculus

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Duration</strong> <strong>Calculus</strong><br />

A formal approach to real-time systems<br />

Lecture 1: Introduction<br />

Michael R. Hansen<br />

mrh@imm.dtu.dk<br />

Informatics and Mathematical Modelling<br />

Technical University of Denmark<br />

Tallinn, November 17- 21, Michael R. Hansen – p.1/29


Plan for this week<br />

Monday: Introduction to Interval Logic and <strong>Duration</strong> <strong>Calculus</strong>.<br />

Overview.<br />

Tuesday: <strong>Duration</strong> <strong>Calculus</strong>: Discrete and Continuous time.<br />

Decidability and undecidability results. Modelchecking.<br />

Wednesday: Deadline-Driven Scheduling.<br />

Modelling and Correctness.<br />

Thursday: Neighbourhood Logic.<br />

Security Protocols. Availability.<br />

Tallinn, November 17- 21, Michael R. Hansen – p.2/29


Overview: Today<br />

• Basic <strong>Duration</strong> <strong>Calculus</strong><br />

• Extensions<br />

• An Application: Security<br />

Tallinn, November 17- 21, Michael R. Hansen – p.3/29


Overview: Today<br />

• Basic <strong>Duration</strong> <strong>Calculus</strong><br />

• Background<br />

• Introduction<br />

• Decidability, Undecidability, Model-checking<br />

• Extensions<br />

• An Application: Security<br />

Tallinn, November 17- 21, Michael R. Hansen – p.3/29


Overview: Today<br />

• Basic <strong>Duration</strong> <strong>Calculus</strong><br />

• Extensions<br />

• Mean Value <strong>Calculus</strong><br />

• Real-state model<br />

• Super-dense computations<br />

• Expanding modalities<br />

• An Application: Security<br />

Tallinn, November 17- 21, Michael R. Hansen – p.3/29


Overview: Today<br />

• Basic <strong>Duration</strong> <strong>Calculus</strong><br />

• Extensions<br />

• An Application: Security<br />

• Availability<br />

• Multi-threaded servers<br />

• Security Protocols<br />

Tallinn, November 17- 21, Michael R. Hansen – p.3/29


Background<br />

• Provable Correct Systems (ProCoS, ESPRIT BRA 3104)<br />

Bjørner Langmaack Hoare Olderog<br />

• Project case study: Gas Burner Sørensen Ravn Rischel<br />

Tallinn, November 17- 21, Michael R. Hansen – p.4/29


Background<br />

• Provable Correct Systems (ProCoS, ESPRIT BRA 3104)<br />

Bjørner Langmaack Hoare Olderog<br />

• Project case study: Gas Burner Sørensen Ravn Rischel<br />

Intervals properties<br />

Timed Automata, Real-time Logic, Metric Temporal Logic,<br />

Explicit Clock Temporal, . . ., Alur, Dill, Jahanian, Mok,<br />

Koymans, Harel, Lichtenstein, Pnueli, . . .<br />

Tallinn, November 17- 21, Michael R. Hansen – p.4/29


Background<br />

• Provable Correct Systems (ProCoS, ESPRIT BRA 3104)<br />

Bjørner Langmaack Hoare Olderog<br />

• Project case study: Gas Burner Sørensen Ravn Rischel<br />

Intervals properties<br />

Timed Automata, Real-time Logic, Metric Temporal Logic,<br />

Explicit Clock Temporal, . . ., Alur, Dill, Jahanian, Mok,<br />

Koymans, Harel, Lichtenstein, Pnueli, . . .<br />

<strong>Duration</strong> of states<br />

<strong>Duration</strong> <strong>Calculus</strong> Zhou Hoare Ravn 91<br />

Tallinn, November 17- 21, Michael R. Hansen – p.4/29


Background<br />

• Provable Correct Systems (ProCoS, ESPRIT BRA 3104)<br />

Bjørner Langmaack Hoare Olderog<br />

• Project case study: Gas Burner Sørensen Ravn Rischel<br />

Intervals properties<br />

Timed Automata, Real-time Logic, Metric Temporal Logic,<br />

Explicit Clock Temporal, . . ., Alur, Dill, Jahanian, Mok,<br />

Koymans, Harel, Lichtenstein, Pnueli, . . .<br />

<strong>Duration</strong> of states<br />

<strong>Duration</strong> <strong>Calculus</strong> Zhou Hoare Ravn 91<br />

— an Interval Temporal Logic Halpern Moszkowski Manna<br />

Tallinn, November 17- 21, Michael R. Hansen – p.4/29


Background<br />

• Provable Correct Systems (ProCoS, ESPRIT BRA 3104)<br />

Bjørner Langmaack Hoare Olderog<br />

• Project case study: Gas Burner Sørensen Ravn Rischel<br />

Intervals properties<br />

Timed Automata, Real-time Logic, Metric Temporal Logic,<br />

Explicit Clock Temporal, . . ., Alur, Dill, Jahanian, Mok,<br />

Koymans, Harel, Lichtenstein, Pnueli, . . .<br />

<strong>Duration</strong> of states<br />

<strong>Duration</strong> <strong>Calculus</strong> Zhou Hoare Ravn 91<br />

— an Interval Temporal Logic Halpern Moszkowski Manna<br />

• Logical Calculi, Applications, Mechanical Support<br />

• <strong>Duration</strong> <strong>Calculus</strong>: A formal approach to real-time systems<br />

Zhou Chaochen and Michael R. Hansen<br />

Springer. To appear one of these days<br />

Tallinn, November 17- 21, Michael R. Hansen – p.4/29


Gas Burner example<br />

State variables G, F : Time → {0, 1} state expression L = G ∧ ¬F<br />

Requirement Gas must at most be leaking 1/20 of the elabsed time<br />

Design decisions<br />

(e − b) ≥ 60 s ⇒ 20 e L(t)dt ≤ (e − b)<br />

b<br />

Leaks are detectable and stoppable within 1s:<br />

∀c, d : b ≤ c < d ≤ e.(L[c, d] ⇒ (d − c) ≤ 1 s)<br />

At least 30s between leaks:<br />

∀c, d, r, s : b ≤ c < r < s < d ≤ e.<br />

(L[c, r] ∧ ¬L[r, s] ∧ L[s, d]) ⇒ (s − r) ≥ 30 s<br />

where P [c, d] = d P (t) = (d − c) > 0 “P holds throughout [c, d]”<br />

c<br />

Tallinn, November 17- 21, Michael R. Hansen – p.5/29


Interval Logic [Halpern Moszkowski Manna 83]<br />

Terms: θ ::= x | v | θ1 + θn | . . . Temporal Variable<br />

Formulas: φ ::= θ1 = θn | ¬φ | φ ∨ ψ | φ ⌢ ψ | (∃x)φ | . . . chop<br />

Tallinn, November 17- 21, Michael R. Hansen – p.6/29


Interval Logic [Halpern Moszkowski Manna 83]<br />

Terms: θ ::= x | v | θ1 + θn | . . . Temporal Variable<br />

v : Intv → R<br />

Formulas: φ ::= θ1 = θn | ¬φ | φ ∨ ψ | φ ⌢ ψ | (∃x)φ | . . . chop<br />

φ : Intv → {tt,ff}<br />

Tallinn, November 17- 21, Michael R. Hansen – p.6/29


Interval Logic [Halpern Moszkowski Manna 83]<br />

Terms: θ ::= x | v | θ1 + θn | . . . Temporal Variable<br />

v : Intv → R<br />

Formulas: φ ::= θ1 = θn | ¬φ | φ ∨ ψ | φ ⌢ ψ | (∃x)φ | . . . chop<br />

Chop:<br />

φ ⌢ ψ<br />

<br />

b m e<br />

<br />

φ<br />

<br />

ψ<br />

φ : Intv → {tt,ff}<br />

for some m : b ≤ m ≤ e<br />

Tallinn, November 17- 21, Michael R. Hansen – p.6/29


Interval Logic [Halpern Moszkowski Manna 83]<br />

Terms: θ ::= x | v | θ1 + θn | . . . Temporal Variable<br />

v : Intv → R<br />

Formulas: φ ::= θ1 = θn | ¬φ | φ ∨ ψ | φ ⌢ ψ | (∃x)φ | . . . chop<br />

Chop:<br />

φ ⌢ ψ<br />

<br />

b m e<br />

<br />

φ<br />

<br />

ψ<br />

φ : Intv → {tt,ff}<br />

for some m : b ≤ m ≤ e<br />

In DC: Intv = { [a, b] | a, b ∈ R ∧ a ≤ b}<br />

Tallinn, November 17- 21, Michael R. Hansen – p.6/29


<strong>Duration</strong> <strong>Calculus</strong> [Zhou Hoare Ravn 91]<br />

State variables P : Time → {0, 1} Finite Variablilty<br />

State expressions S ::= 0 | 1 | P | ¬S | S1 ∨ S2<br />

Tallinn, November 17- 21, Michael R. Hansen – p.7/29


<strong>Duration</strong> <strong>Calculus</strong> [Zhou Hoare Ravn 91]<br />

State variables P : Time → {0, 1} Finite Variablilty<br />

State expressions S ::= 0 | 1 | P | ¬S | S1 ∨ S2<br />

S : Time → {0, 1} pointwise defined from P<br />

Tallinn, November 17- 21, Michael R. Hansen – p.7/29


<strong>Duration</strong> <strong>Calculus</strong> [Zhou Hoare Ravn 91]<br />

State variables P : Time → {0, 1} Finite Variablilty<br />

State expressions S ::= 0 | 1 | P | ¬S | S1 ∨ S2<br />

S : Time → {0, 1} pointwise defined from P<br />

<strong>Duration</strong>s S : Intv → R defined on [b, e] by<br />

e<br />

b<br />

S(t)dt<br />

– Temporal variables with a structure<br />

Tallinn, November 17- 21, Michael R. Hansen – p.7/29


Example: Gas Burner<br />

Requirement<br />

Design decisions<br />

ℓ ≥ 60 ⇒ 20 L ≤ ℓ<br />

( ⌈L ⌉ ⇒ ℓ ≤ 1)<br />

(( ⌈L ⌉ ⌢ ⌈¬L ⌉ ⌢ ⌈L ⌉) ⇒ ℓ ≥ 30)<br />

where ℓ denotes the length of the interval, and<br />

♦φ = true ⌢ φ ⌢ true “for some sub-interval: φ”<br />

φ = ¬♦¬φ “for all sub-intervals: φ”<br />

⌈P ⌉ = P = ℓ ∧ ℓ > 0 “P holds throughout a non-point interval”<br />

Tallinn, November 17- 21, Michael R. Hansen – p.8/29


Example: Gas Burner<br />

Requirement<br />

Design decisions<br />

ℓ ≥ 60 ⇒ 20 L ≤ ℓ<br />

( ⌈L ⌉ ⇒ ℓ ≤ 1)<br />

(( ⌈L ⌉ ⌢ ⌈¬L ⌉ ⌢ ⌈L ⌉) ⇒ ℓ ≥ 30)<br />

where ℓ denotes the length of the interval, and<br />

♦φ = true ⌢ φ ⌢ true “for some sub-interval: φ”<br />

φ = ¬♦¬φ “for all sub-intervals: φ”<br />

⌈P ⌉ = P = ℓ ∧ ℓ > 0 “P holds throughout a non-point interval”<br />

succinct formulation — no interval endpoints<br />

Tallinn, November 17- 21, Michael R. Hansen – p.8/29


Interval Logic: Proof System 1 [Dutertre 1995]<br />

The axioms of IL are:<br />

A0 ℓ ≥ 0<br />

A1 ((φ ⌢ ψ) ∧ ¬(φ ⌢ ϕ)) ⇒ (φ ⌢ (ψ ∧ ¬ϕ))<br />

A2 ((φ ⌢ ψ) ⌢ ϕ) ⇐⇒ (φ ⌢ (ψ ⌢ ϕ))<br />

R (φ ⌢ ψ) ⇒ φ if φ is a rigid formula<br />

E (∃x.φ ⌢ ψ) ⇒ ∃x.(φ ⌢ ψ) if x is not free in ψ.<br />

L1 ((ℓ = x) ⌢ φ) ⇒ ¬((ℓ = x) ⌢ ¬φ)<br />

L2 (x ≥ 0 ∧ y ≥ 0) ⇒ ((ℓ = x + y) ⇐⇒ ((ℓ = x) ⌢ (ℓ = y)))<br />

L3 φ ⇒ (φ ⌢ (ℓ = 0))<br />

Tallinn, November 17- 21, Michael R. Hansen – p.9/29


Interval Logic: Proof System 2 [Dutertre 1995]<br />

The inference rules of IL are:<br />

MP if φ and φ ⇒ ψ then ψ modus ponens<br />

G if φ then (∀x)φ generalisation<br />

N<br />

M<br />

if φ then ¬(¬φ ⌢ ψ)<br />

if φ then ¬(ψ ⌢ ¬φ)<br />

if φ ⇒ ψ then (φ ⌢ ϕ) ⇒ (ψ ⌢ ϕ)<br />

if φ ⇒ ψ then (ϕ ⌢ φ) ⇒ (ϕ ⌢ ψ)<br />

Necessity<br />

Monotonicity<br />

Tallinn, November 17- 21, Michael R. Hansen – p.10/29


Interval Logic: Proof System 2 [Dutertre 1995]<br />

The inference rules of IL are:<br />

MP if φ and φ ⇒ ψ then ψ modus ponens<br />

G if φ then (∀x)φ generalisation<br />

N<br />

M<br />

if φ then ¬(¬φ ⌢ ψ)<br />

if φ then ¬(ψ ⌢ ¬φ)<br />

if φ ⇒ ψ then (φ ⌢ ϕ) ⇒ (ψ ⌢ ϕ)<br />

if φ ⇒ ψ then (ϕ ⌢ φ) ⇒ (ϕ ⌢ ψ)<br />

Complete wrt abstract value and time domain<br />

Necessity<br />

Monotonicity<br />

Tallinn, November 17- 21, Michael R. Hansen – p.10/29


<strong>Duration</strong> <strong>Calculus</strong>: Proof System [ZHR 1991]<br />

Axioms reflecting the structure of temporal variables:<br />

DCA1<br />

DCA2<br />

DCA3<br />

DCA4<br />

<br />

0 = 0<br />

<br />

1 = ℓ<br />

<br />

S ≥ 0<br />

<br />

S1 + S2 = (S1 ∨ S2) + (S1 ∧ S2)<br />

DCA5 (( S = x) ⌢ ( S = y)) ⇒ ( S = x + y)<br />

DCA6<br />

S1 = S2 if S1 ⇐⇒ S2 in propositional logic<br />

Tallinn, November 17- 21, Michael R. Hansen – p.11/29


<strong>Duration</strong> <strong>Calculus</strong>: Induction Rules<br />

Formalize Finite Variability of States<br />

IR1 If H( ⌈ ⌉) and H(X) ⇒ H(X ∨ n<br />

i=1 (X ⌢ ⌈Si ⌉))<br />

then H(true)<br />

• H( ⌈ ⌉) – the base case<br />

• H(X) – the induction hypothesis<br />

• S1, S2, ..., Sn — a complete collection of state expressions<br />

(<br />

n<br />

i=1<br />

Si) ⇐⇒ 1<br />

Tallinn, November 17- 21, Michael R. Hansen – p.12/29


<strong>Duration</strong> <strong>Calculus</strong>: Induction Rules<br />

Formalize Finite Variability of States<br />

IR1 If H( ⌈ ⌉) and H(X) ⇒ H(X ∨ n<br />

i=1 (X ⌢ ⌈Si ⌉))<br />

then H(true)<br />

• H( ⌈ ⌉) – the base case<br />

• H(X) – the induction hypothesis<br />

• S1, S2, ..., Sn — a complete collection of state expressions<br />

(<br />

n<br />

i=1<br />

Si) ⇐⇒ 1<br />

DC is relative complete wrt Interval Logic [Hansen Zhou 92]<br />

DC is complete wrt abstract domain [Guelev 98]<br />

Tallinn, November 17- 21, Michael R. Hansen – p.12/29


Induction rule: Intuition<br />

• H( ⌈ ⌉) H holds on point intervals<br />

Tallinn, November 17- 21, Michael R. Hansen – p.13/29


Induction rule: Intuition<br />

• H( ⌈ ⌉) H holds on point intervals<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉)<br />

H holds on intervals with at most 0 state changes<br />

Tallinn, November 17- 21, Michael R. Hansen – p.13/29


Induction rule: Intuition<br />

• H( ⌈ ⌉) H holds on point intervals<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉)<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉ ∨ n<br />

i=1<br />

H holds on intervals with at most 0 state changes<br />

n<br />

j=1 ⌈Si ⌉ ⌢ ⌈Sj ⌉)<br />

H holds on intervals with at most 1 state change<br />

Tallinn, November 17- 21, Michael R. Hansen – p.13/29


Induction rule: Intuition<br />

• H( ⌈ ⌉) H holds on point intervals<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉)<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉ ∨ n<br />

i=1<br />

H holds on intervals with at most 0 state changes<br />

n<br />

j=1 ⌈Si ⌉ ⌢ ⌈Sj ⌉)<br />

H holds on intervals with at most 1 state change<br />

• ... H holds on intervals with at most n state change<br />

Tallinn, November 17- 21, Michael R. Hansen – p.13/29


Induction rule: Intuition<br />

• H( ⌈ ⌉) H holds on point intervals<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉)<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉ ∨ n<br />

i=1<br />

H holds on intervals with at most 0 state changes<br />

n<br />

j=1 ⌈Si ⌉ ⌢ ⌈Sj ⌉)<br />

H holds on intervals with at most 1 state change<br />

• ... H holds on intervals with at most n state change<br />

H(true) H holds on any interval<br />

Tallinn, November 17- 21, Michael R. Hansen – p.13/29


Induction rule: Intuition<br />

• H( ⌈ ⌉) H holds on point intervals<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉)<br />

• H( ⌈ ⌉ ∨ n<br />

i=1 ⌈Si ⌉ ∨ n<br />

i=1<br />

H holds on intervals with at most 0 state changes<br />

n<br />

j=1 ⌈Si ⌉ ⌢ ⌈Sj ⌉)<br />

H holds on intervals with at most 1 state change<br />

• ... H holds on intervals with at most n state change<br />

H(true) H holds on any interval<br />

S<br />

<br />

rejects Zeno behaviour like:<br />

¬S<br />

<br />

S<br />

¬S<br />

<br />

0 4 6 7 8<br />

Tallinn, November 17- 21, Michael R. Hansen – p.13/29


Decidability [Zhou Hansen Sestoft 93]<br />

Restricted <strong>Duration</strong> <strong>Calculus</strong> :<br />

• ⌈S ⌉<br />

• ¬φ, φ ∨ ψ, φ ⌢ ψ<br />

Tallinn, November 17- 21, Michael R. Hansen – p.14/29


Decidability [Zhou Hansen Sestoft 93]<br />

Restricted <strong>Duration</strong> <strong>Calculus</strong> :<br />

• ⌈S ⌉<br />

• ¬φ, φ ∨ ψ, φ ⌢ ψ<br />

Satisfiability is reduced to emptiness of regular languages<br />

Idea: a ∈ Σ describes a piece of an interpretation, e.g. P1 ∧ ¬P2 ∧ P3<br />

Tallinn, November 17- 21, Michael R. Hansen – p.14/29


Decidability [Zhou Hansen Sestoft 93]<br />

Restricted <strong>Duration</strong> <strong>Calculus</strong> :<br />

• ⌈S ⌉<br />

• ¬φ, φ ∨ ψ, φ ⌢ ψ<br />

Satisfiability is reduced to emptiness of regular languages<br />

Idea: a ∈ Σ describes a piece of an interpretation, e.g. P1 ∧ ¬P2 ∧ P3<br />

Discrete time — one letter corresponds to one time unit<br />

L( ⌈S ⌉) = (DNF (S)) +<br />

L(ϕ ∨ ψ) = L(ϕ) ∪ L(ψ)<br />

L(¬ϕ) = Σ ∗ \ L(ϕ)<br />

L(ϕ ⌢ ψ) = L(ϕ) L(ψ)<br />

Tallinn, November 17- 21, Michael R. Hansen – p.14/29


Decidability [Zhou Hansen Sestoft 93]<br />

Restricted <strong>Duration</strong> <strong>Calculus</strong> :<br />

• ⌈S ⌉<br />

• ¬φ, φ ∨ ψ, φ ⌢ ψ<br />

Satisfiability is reduced to emptiness of regular languages<br />

Idea: a ∈ Σ describes a piece of an interpretation, e.g. P1 ∧ ¬P2 ∧ P3<br />

Discrete time — one letter corresponds to one time unit<br />

L( ⌈S ⌉) = (DNF (S)) +<br />

L(ϕ ∨ ψ) = L(ϕ) ∪ L(ψ)<br />

L(¬ϕ) = Σ ∗ \ L(ϕ)<br />

L(ϕ ⌢ ψ) = L(ϕ) L(ψ)<br />

Continuous time — Closure property<br />

Tallinn, November 17- 21, Michael R. Hansen – p.14/29


Decidability [Zhou Hansen Sestoft 93]<br />

Restricted <strong>Duration</strong> <strong>Calculus</strong> :<br />

• ⌈S ⌉<br />

• ¬φ, φ ∨ ψ, φ ⌢ ψ<br />

Satisfiability is reduced to emptiness of regular languages<br />

Idea: a ∈ Σ describes a piece of an interpretation, e.g. P1 ∧ ¬P2 ∧ P3<br />

Discrete time — one letter corresponds to one time unit<br />

L( ⌈S ⌉) = (DNF (S)) +<br />

L(ϕ ∨ ψ) = L(ϕ) ∪ L(ψ)<br />

L(¬ϕ) = Σ ∗ \ L(ϕ)<br />

L(ϕ ⌢ ψ) = L(ϕ) L(ψ)<br />

Continuous time — Closure property<br />

Skakkebæk Sestoft 94, Pandya 01, Fränzle 02, Gomez Bowman 03<br />

Tallinn, November 17- 21, Michael R. Hansen – p.14/29


Undecidability<br />

Even small extensions give undecidable subsets<br />

RDC1 cont. time RDC2 RDC3<br />

• ℓ = r, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• S1 = S2<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• ℓ = x, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ, (∃x)φ<br />

Reduce halting problem (2-counter machines) to satisfiability<br />

Tallinn, November 17- 21, Michael R. Hansen – p.15/29


Undecidability<br />

Even small extensions give undecidable subsets<br />

RDC1 cont. time RDC2 RDC3<br />

• ℓ = r, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• S1 = S2<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• ℓ = x, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ, (∃x)φ<br />

Reduce halting problem (2-counter machines) to satisfiability<br />

RDC 2: c1 encoded by C + 1 − C − 1 , where C+ 1 , C − 1 : Time → {0, 1}<br />

In qi decrement c1 (if c1 > 0) and go to qj:<br />

Tallinn, November 17- 21, Michael R. Hansen – p.15/29


Undecidability<br />

Even small extensions give undecidable subsets<br />

RDC1 cont. time RDC2 RDC3<br />

• ℓ = r, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• S1 = S2<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• ℓ = x, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ, (∃x)φ<br />

Reduce halting problem (2-counter machines) to satisfiability<br />

RDC 2: c1 encoded by C + 1 − C − 1 , where C+ 1 , C − 1 : Time → {0, 1}<br />

In qi decrement c1 (if c1 > 0) and go to qj:<br />

current state qi<br />

true ⌢ ⌈qi ⌉<br />

Tallinn, November 17- 21, Michael R. Hansen – p.15/29


Undecidability<br />

Even small extensions give undecidable subsets<br />

RDC1 cont. time RDC2 RDC3<br />

• ℓ = r, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• S1 = S2<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• ℓ = x, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ, (∃x)φ<br />

Reduce halting problem (2-counter machines) to satisfiability<br />

RDC 2: c1 encoded by C + 1 − C − 1 , where C+ 1 , C − 1 : Time → {0, 1}<br />

In qi decrement c1 (if c1 > 0) and go to qj:<br />

current state qi<br />

c1 > 0<br />

true ⌢ ⌈qi ⌉<br />

C + 1 = C − 1<br />

Tallinn, November 17- 21, Michael R. Hansen – p.15/29


Undecidability<br />

Even small extensions give undecidable subsets<br />

RDC1 cont. time RDC2 RDC3<br />

• ℓ = r, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• S1 = S2<br />

• ¬φ, φ∨ψ, φ ⌢ ψ<br />

• ℓ = x, ⌈S ⌉<br />

• ¬φ, φ∨ψ, φ ⌢ ψ, (∃x)φ<br />

Reduce halting problem (2-counter machines) to satisfiability<br />

RDC 2: c1 encoded by C + 1 − C − 1 , where C+ 1 , C − 1 : Time → {0, 1}<br />

In qi decrement c1 (if c1 > 0) and go to qj:<br />

current state qi true ⌢ ⌈qi ⌉ ⌢ true<br />

c1 > 0 ∧ C + 1 = C − 1 ⌢ true<br />

next state qj, decrement c1 ⇒ true ⌢ ⌈qj ∧ C − 1 ⌉<br />

Tallinn, November 17- 21, Michael R. Hansen – p.15/29


Model-checking [Zhou Zhang Lu Li 94]<br />

Linear <strong>Duration</strong> Invariants cmin ≤ ℓ ⇒ n i=1 ci<br />

<br />

Pi ≤ c<br />

are checked with respect to real-time automata.<br />

Gas Burner requirement 60 ≤ ℓ ⇒ (19 Leak − NonLeak) ≤ 0<br />

Gas Burner design<br />

f<br />

[30, ∞)<br />

NonLeak Leak<br />

❨<br />

[0, 1]<br />

r<br />

❥<br />

Tallinn, November 17- 21, Michael R. Hansen – p.16/29


Model-checking 2<br />

• Each run is reduced to a linear programming problem.<br />

Constraints for run: f r f (t1 NonLeak, t2 Leak, t3 NonLeak)<br />

t1 ≥ 30, 0 ≤ t2 ≤ 1, t3 ≥ 30 and (t1 + t2 + t3) ≥ 60<br />

Objective function: 19t2 − (t1 + t3)<br />

The linear duration invariant is satisfied<br />

iff the maximal value of the objective function is ≤ 0.<br />

Tallinn, November 17- 21, Michael R. Hansen – p.17/29


Model-checking 2<br />

• Each run is reduced to a linear programming problem.<br />

Constraints for run: f r f (t1 NonLeak, t2 Leak, t3 NonLeak)<br />

t1 ≥ 30, 0 ≤ t2 ≤ 1, t3 ≥ 30 and (t1 + t2 + t3) ≥ 60<br />

Objective function: 19t2 − (t1 + t3)<br />

The linear duration invariant is satisfied<br />

iff the maximal value of the objective function is ≤ 0.<br />

• An infinite set of runs can be reduced to a finite set<br />

– timing constraints and coefficients of durations<br />

Implemented by Li, Tao, Dang ...<br />

Tallinn, November 17- 21, Michael R. Hansen – p.17/29


Some Extensions – a brief survey<br />

• Mean Value <strong>Calculus</strong><br />

• Real State Model<br />

• Super-dense computations<br />

• Expanding Modalities<br />

• Some other work<br />

Tallinn, November 17- 21, Michael R. Hansen – p.18/29


Mean Value <strong>Calculus</strong> [Zhou Li 94]<br />

Captures point properties<br />

Use mean values rather than durations<br />

where<br />

Extends DC<br />

P ([b, e]) =<br />

P : Intv → [0, 1]<br />

e P (t)dt/(e − b) b if e > b<br />

P (e) if e = b<br />

P = P · ℓ<br />

Tallinn, November 17- 21, Michael R. Hansen – p.19/29


Real State Model [Zhou Ravn Hansen 93]<br />

Hybrid Systems: Discrete and continuous components<br />

Predicates like<br />

g, ˙<br />

f : Time → R<br />

⌈P(g, ˙<br />

f) ⌉ control law P holds on an interval<br />

e.f = v ⌢ b.g = v + 1<br />

Case studies<br />

Auto pilot, water level monitor, hydraulic actuator system, inverted<br />

pendulum, ...<br />

Ravn, Engel, Dang, Widjaja, He, Chen Zhou, ...<br />

Tallinn, November 17- 21, Michael R. Hansen – p.20/29


Super-dense computations<br />

Program semantics: Time and Timeless actions<br />

. . . ; x:= 3 ; y := f(x,y) ; wait 7 ; . . .<br />

• Super-dense chop Zhou Hansen 96<br />

• Combination of Linear Time Temporal Logic and Interval Logic<br />

Barua, Qui, Zhou, Pandya, Dang, Liu, Ravn, Li 1998<br />

• Visible and invisible states Guelev Dang 02<br />

Generalizes of the projection operator of ITL Moszkowski 95<br />

• Temporal logic for ordered trees ? Endriss Gabbay 03<br />

Tallinn, November 17- 21, Michael R. Hansen – p.21/29


Expanding Modalities 1<br />

To capture (abstract) liveness properties<br />

Venema’s propositional modal logic with modalities ⌢ , T and D<br />

φTψ<br />

<br />

<br />

b e c<br />

<br />

ψ<br />

φ<br />

<br />

<br />

φ<br />

φDψ<br />

a b e<br />

<br />

ψ<br />

for some c ≥ e<br />

for some a ≤ b<br />

Completeness, Venema 90<br />

Railway crossing, Skakkebæk 94<br />

Tallinn, November 17- 21, Michael R. Hansen – p.22/29


Expanding Modalities 2<br />

Neighbourhood Logic Zhou Hansen 98<br />

A first order logic with two modalities<br />

φ<br />

♦lφ<br />

<br />

<br />

a b e<br />

♦rφ<br />

<br />

<br />

b e c<br />

φ<br />

for some a ≤ b<br />

for some c ≥ e<br />

Completeness Barua Roy Zhou 2000<br />

Tallinn, November 17- 21, Michael R. Hansen – p.23/29


Signed Interval Logic [Engel Rischel 94]<br />

Intervals with a direction<br />

i<br />

φ ⌢ ψ<br />

> j<br />

Tallinn, November 17- 21, Michael R. Hansen – p.24/29


Signed Interval Logic [Engel Rischel 94]<br />

Intervals with a direction<br />

i<br />

i<br />

φ ⌢ <br />

ψ<br />

<br />

> j<br />

<br />

φ<br />

<br />

> k for some k<br />

< <br />

ψ<br />

Tallinn, November 17- 21, Michael R. Hansen – p.24/29


Signed Interval Logic [Engel Rischel 94]<br />

Intervals with a direction<br />

i<br />

i<br />

φ ⌢ <br />

ψ<br />

<br />

> j<br />

<br />

φ<br />

<br />

> k for some k<br />

< <br />

ψ<br />

Proof theory and Theorem Proving Rasmussen 02<br />

• Proof systems encoded in Isabelle/HOL<br />

• Encoding of Neighbourhood Logic (+ DC)<br />

• Example: Gas burner, Scheduling, Availability Pilegaard 02<br />

Tallinn, November 17- 21, Michael R. Hansen – p.24/29


Some other work<br />

• Probabilistic <strong>Duration</strong> <strong>Calculus</strong> Liu Ravn Sørensen Zhou 93,<br />

Dang Zhou 99, Guelev 00<br />

• Circuits and controllers Hansen Zhou Staunstrup 92,<br />

Kääramees 95, Fränzle 96, Dierks 98<br />

• Program Semantics: SDL, OCCAM, Esterel, Constraint<br />

Diagrams, ...<br />

• Integration with other formalism: CSP [He], RAISE [He Li], CSP<br />

& Object Z [Hoenicke Olderog], ...<br />

• Refinement Ravn, Olderog, Schenke, ...<br />

• Theorem Provers: PVS [Skakkebæk], Isabelle [Heilmann]<br />

• Decision Procedures: DCVALID [Pandya], [Kersten PSY]]<br />

• Higher-order operators: State quantifiers, µ-operator [Guelev,<br />

Dang, Pandya, ...]<br />

• Case Studies: a huge amount<br />

Tallinn, November 17- 21, Michael R. Hansen – p.25/29


Availability Pilegaard Hansen Sharp 02<br />

Clients C1, C2, . . . exchange messages with a server S<br />

C1<br />

.<br />

Cn<br />

.<br />

Ci → S : M<br />

S → Ci : M ′<br />

• Good clients i ∈ γ requests δi of the server’s time<br />

• Bad clients j ∈ β waste the server’s time<br />

How to formalize requirements about the availability?<br />

S<br />

Tallinn, November 17- 21, Michael R. Hansen – p.26/29


Availability Pilegaard Hansen Sharp 02<br />

Clients C1, C2, . . . exchange messages with a server S<br />

C1<br />

.<br />

Cn<br />

.<br />

Ci → S : M<br />

S → Ci : M ′<br />

• Good clients i ∈ γ requests δi of the server’s time<br />

• Bad clients j ∈ β waste the server’s time<br />

How to formalize requirements about the availability?<br />

• E.g., Available for good clients x% of the time<br />

Under which assumptions are these requirements to be met?<br />

• strength of bad clients Operational cost model Meadows 01<br />

S<br />

Tallinn, November 17- 21, Michael R. Hansen – p.26/29


Multi-threaded Server<br />

Rdy i : Time → {0, 1}<br />

Runi : Time → {0, 1}<br />

Only ready processes are running ⌈Runi ⌉ ⇒ ⌈Rdy i ⌉<br />

At most one process is running ⌈Runi ⌉ ⇒ <br />

∧ ⌈Runi ⌉<br />

∧ ♦r ⌈¬Runi ∧ Rdy i ⌉<br />

i=j ⌈¬Runj ⌉<br />

Round-Robin Scheduling with time slice τ<br />

⎛<br />

⎜<br />

⎝<br />

♦l ⌈¬Runi ⌉<br />

⎞<br />

⎟<br />

⎠ ⇒ ℓ = τ<br />

Hansen Zhou Ravn Rischel 92<br />

Yuhua Zhou 94<br />

Chan Dang 95<br />

Tallinn, November 17- 21, Michael R. Hansen – p.27/29


Modelling Availability<br />

• Normal service for trusted clients x% of the time<br />

(ℓ > T ⇒ ( <br />

Runi) ≤ (1 − x) · ℓ)<br />

i∈γ<br />

• Request of ci completed within p · ci<br />

∀i ∈ γ.♦r(ℓ ≤ p · ci ⇒ Runi = ci)<br />

Assumptions about the strength of bad clients can be modelled<br />

using similar techniques<br />

Is availability guaranteed under the assumptions?<br />

(Scheduler ∧ Ass γ ∧ Assβ ∧ R(¯x)) ⇒ Availability<br />

a first attemp Hansen Sharp 03<br />

Tallinn, November 17- 21, Michael R. Hansen – p.28/29


Events in security protocols A → B : M<br />

Use traces as functions of time Tr : Time → Event ∗<br />

finite variability<br />

Ravn Rischel Hansen 93<br />

Occurrence of an event<br />

Occurs(e) = ℓ = 0 ∧ ∃h ∈ Event ∗ .<br />

<br />

♦l ⌈Tr = h ⌉<br />

∧ ♦r ⌈Tr = h · e ⌉<br />

Link between external actions and the server’s activity<br />

• Occurs(Ai → S : M) ⇒ ♦r ⌈Rdyi ⌉<br />

<br />

Runi = ci<br />

•<br />

∧ true ⌢ <br />

⌈Rdyi ⌉<br />

⇒ true ⌢ Occurs(S → Ai : Ms)<br />

<br />

Tallinn, November 17- 21, Michael R. Hansen – p.29/29


Events in security protocols A → B : M<br />

Use traces as functions of time Tr : Time → Event ∗<br />

finite variability<br />

Ravn Rischel Hansen 93<br />

Occurrence of an event<br />

Occurs(e) = ℓ = 0 ∧ ∃h ∈ Event ∗ .<br />

<br />

♦l ⌈Tr = h ⌉<br />

∧ ♦r ⌈Tr = h · e ⌉<br />

Link between external actions and the server’s activity<br />

• Occurs(Ai → S : M) ⇒ ♦r ⌈Rdyi ⌉<br />

<br />

Runi = ci<br />

•<br />

∧ true ⌢ <br />

⌈Rdyi ⌉<br />

⇒ true ⌢ Occurs(S → Ai : Ms)<br />

Verification in Isabelle/HOL Pilegaard 02<br />

— Separation of interval from timeless reasoning Tallinn, November 17- 21, Michael R. Hansen – p.29/29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!