Veri fi cation of Erlang-style Concurrency Emanuele D’Osualdo , Jonathan Kochems and Luke Ong Department of Computer Science University of Oxford 11 September 2012
1 The goal Automatic Veri fi cation
1 The goal Automatic Veri fi cation of
1 The goal Automatic Veri fi cation of Properties
1 The goal Automatic Veri fi cation of Properties of
1 The goal Automatic Veri fi cation of Properties of Concurrent Systems
1 The goal Automatic Veri fi cation of Properties of Concurrent Systems based on Message Passing
1 The goal Automatic Veri fi cation of Properties of Concurrent Systems based on the Actor Model
1 The goal Automatic Veri fi cation of Properties of Erlang programs functional sequential fragment dynamic process creation asynchronous message passing
1 The goal E ff ective Sound Approximation of Properties of Erlang programs functional sequential fragment dynamic process creation asynchronous message passing
1 The goal E ff ective Sound Approximation of Reachability of Erlang programs functional sequential fragment dynamic process creation asynchronous message passing
2 Example: Erathostene’s sieve Running Example: a concurrent version of Erathostene’s sieve Inspired by: Rob Pike. Concurrency and message passing in Newsqueak. Google Tech Talks , 2007.
❝❧✐❡♥t 3 Example: Erathostene’s sieve ❝♦✉♥t❡r✭◆✮ 1 ❝♦✉♥t❡r✭◆✮ → r❡❝❡✐✈❡ ④♣♦❦❡✱ ❋r♦♠⑥ → 2 ❋r♦♠✦④❛♥s✱ ◆⑥✱ 3 ❝♦✉♥t❡r✭◆✰✶✮ 4 ❡♥❞✳ 5
3 Example: Erathostene’s sieve ❝♦✉♥t❡r✭◆✮ 1 ❝♦✉♥t❡r✭◆✮ → r❡❝❡✐✈❡ ④♣♦❦❡✱ ❋r♦♠⑥ → 2 ❋r♦♠✦④❛♥s✱ ◆⑥✱ poke 3 ❝♦✉♥t❡r✭◆✰✶✮ 4 ❡♥❞✳ 5 ❝❧✐❡♥t
3 Example: Erathostene’s sieve ❝♦✉♥t❡r✭◆✮ poke 1 ❝♦✉♥t❡r✭◆✮ → r❡❝❡✐✈❡ ④♣♦❦❡✱ ❋r♦♠⑥ → 2 ❋r♦♠✦④❛♥s✱ ◆⑥✱ 3 ❝♦✉♥t❡r✭◆✰✶✮ 4 ❡♥❞✳ 5 ❝❧✐❡♥t
3 Example: Erathostene’s sieve ❝♦✉♥t❡r✭◆✮ poke 1 ❝♦✉♥t❡r✭◆✮ → r❡❝❡✐✈❡ ④♣♦❦❡✱ ❋r♦♠⑥ → 2 ❋r♦♠✦④❛♥s✱ ◆⑥✱ poke 3 ❝♦✉♥t❡r✭◆✰✶✮ 4 ❡♥❞✳ 5 ❝❧✐❡♥t
3 Example: Erathostene’s sieve ❝♦✉♥t❡r✭◆✮ poke 1 ❝♦✉♥t❡r✭◆✮ → poke r❡❝❡✐✈❡ ④♣♦❦❡✱ ❋r♦♠⑥ → 2 ❋r♦♠✦④❛♥s✱ ◆⑥✱ 3 ❝♦✉♥t❡r✭◆✰✶✮ 4 ❡♥❞✳ 5 ❝❧✐❡♥t
3 Example: Erathostene’s sieve ❝♦✉♥t❡r✭◆✰✶✮ 1 ❝♦✉♥t❡r✭◆✮ → poke r❡❝❡✐✈❡ ④♣♦❦❡✱ ❋r♦♠⑥ → 2 ❋r♦♠✦④❛♥s✱ ◆⑥✱ N 3 ❝♦✉♥t❡r✭◆✰✶✮ 4 ❡♥❞✳ 5 ❝❧✐❡♥t
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✷✮ 1 ♠❛✐♥✭✮ → ▼ ❂ s❡❧❢✭✮✱ 2 ❈ ❂ s♣❛✇♥✭❝♦✉♥t❡r✱❬✷❪✮✱ 3 s♣❛✇♥✭s✐❡✈❡✱ ❬❈✱▼❪✮✳ 4 s✐❡✈❡✭❈✱▼✮ ❙ ♠❛✐♥ ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✷✮ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❈✱▼✮ ❙ ♠❛✐♥ ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✷✮ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 poke r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❈✱▼✮ ❙ ♠❛✐♥ ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✷✮ poke 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❈✱▼✮ ❙ ♠❛✐♥ ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✸✮ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❈✱▼✮ ❙ ♠❛✐♥ ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✸✮ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 2 ❡♥❞✳ 9 s✐❡✈❡✭❈✱▼✮ ❙ ♠❛✐♥ ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✸✮ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❈✱▼✮ ❙ prime 2 ♠❛✐♥ ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ ❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✸✮ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❈✱▼✮ ❙ ♠❛✐♥ 2 ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✸✮ ❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❋✶✱▼✮ ❙ ♠❛✐♥ 2 ▼
❢✐❧t❡r✭❞✐✈❴❜②✭✸✮✳✳ ❋✷ ❢✐❧t❡r✭❞✐✈❴❜②✭✺✮✳✳ ❋✸ 4 Example: Erathostene’s sieve ❈ ❝♦✉♥t❡r✭✸✮ ❢✐❧t❡r✭❞✐✈❴❜②✭✷✮✳✳ ❋✶ 1 s✐❡✈❡✭■♥✱ ❖✉t✮ → ■♥✦④♣♦❦❡✱ s❡❧❢✭✮⑥✱ 2 r❡❝❡✐✈❡ ④❛♥s✱❳⑥ → 3 ❖✉t✦④♣r✐♠❡✱❳⑥✱ 4 poke ❋ ❂ s♣❛✇♥✭❢✉♥✭✮ → 5 ❢✐❧t❡r✭❞✐✈❴❜②✭❳✮✱ ■♥✮ 6 ❡♥❞✮✱ 7 s✐❡✈❡✭❋✱❖✉t✮ 8 ❡♥❞✳ 9 s✐❡✈❡✭❋✶✱▼✮ ❙ ♠❛✐♥ 2 ▼
Recommend
More recommend