starling
play

Starling:** simpler*concurrency*proofs* Ma#$Windsor (1),$ Mike$Dodds - PowerPoint PPT Presentation

Starling:** simpler*concurrency*proofs* Ma#$Windsor (1),$ Mike$Dodds (1) ,$$$$$$$Ma#hew$Parkinson (2)$ (1) University$of$York$$$$$$$$$$$$$$$$$$$$$$$$$(2)$Microso>$Research$ Sturnus'vulgaris' (common$starling)$ Ticketed*Lock


  1. Starling:** simpler*concurrency*proofs* Ma#$Windsor (1),$ Mike$Dodds (1) ,$$$$$$$Ma#hew$Parkinson (2)$ (1) University$of$York$$$$$$$$$$$$$$$$$$$$$$$$$(2)$Microso>$Research$

  2. Sturnus'vulgaris' (common$starling)$

  3. Ticketed*Lock global&int&ticket;&&//&The&next&ticket&to&hand&out.& global&int&serving;&//&The&current&ticket&holding&the&lock.& & method&unlock()&{& method&lock()&{& &&<serving++>;& &&<t&=&ticket++>;& } $ &&do&{& &&&&<s&=&serving>;& &&}&while&(s&!=&t);& }& &

  4. Ticketed*Lock method&lock()&{& method&unlock()&{& &&{|&emp&|}& &&{|&holdLock()&|}& &&<t&=&ticket++>;& &&<serving++>;& &&do&{& &&{|&emp&|}& } $ &&&&<s&=&serving>;& &&}&while&(s&!=&t);& &&{|&holdLock()&|}& }& & constraint&holdLock()&&&*&holdLock()&&&G>&false;&

  5. method&lock()&{& method&unlock()&{& &&{|&emp&|}& &&{|&holdLock()&|}& &&<t&=&ticket++>;& &&<serving++>;& &&{|&holdTick(t)&|} ! &&{|&emp&|}& &&do&{& } $ &&&&{|&holdTick(t)&|}& &&&&<s&=&serving>;& &&&&{|&if&s==t&then&holdLock()&else&holdTick(t)&|}& &&}&while&(s&!=&t);& &&{|&holdLock()&|}& }& & constraint&holdLock()&&&*&holdLock()&&&G>&false;& & constraint&emp&&&&&&&&&&&&&&&&&&&&&&&&&G>&ticket&>=&serving;& constraint&holdTick(t)&&&&&&&&&&&&&&&&&G>&ticket&>&t;& constraint&holdLock()&&&&&&&&&&&&&&&&&&G>&ticket&!=&serving;& constraint&holdLock()&&&*&holdTick(t)&&G>&serving&!=&t;& constraint&holdTick(ta)&*&holdTick(tb)&G>&ta&!=&tb;&

  6. Demo

  7. Views Establish$post;$ Context$asserGons$ preserve$context$ ReificaGon$ Program$ Hoare$triples$ semanGcs$

  8. method&unlock()&{& method&lock()&{& &&{|&holdLock()&|}& &&{|&emp&|}& &&<t&=&ticket++>;& &&<serving++>;& &&{|&holdTick(t)&|} ! &&{|&emp&|}& &&do&{& } $ &&&&{|&holdTick(t)&|}& &&&&<s&=&serving>;& &&&&{|&if&s==t&then&holdLock()&else&holdTick(t)&|}& &&}&while&(s&!=&t);& &&{|&holdLock()&|}& }& &

  9. method&unlock()&{& method&lock()&{& &&{|&holdLock()&|}& &&{|&emp&|}& &&<t&=&ticket++>;& &&<serving++>;& &&{|&holdTick(t)&|} ! &&{|&emp&|}& &&do&{& } $ &&&&{|&holdTick(t)&|}& &&&&<s&=&serving>;& &&&&{|&if&s==t&then&holdLock()&else&holdTick(t)&|}& &&}&while&(s&!=&t);& &&{|&holdLock()&|}& }& & Views$= ! {&holdTick(1),&&holdTick(2),&&holdTick(1)*holdTick(2),&...}&& U&{&holdLock(),&&holdLock()*holdLock(),&...}&& $ U&{&holdLock()*holdTick(1),&&holdLock()*holdTick(2),&&...}&& U&{&emp&}&& $

  10. method&unlock()&{& method&lock()&{& &&{|&holdLock()&|}& &&{|&emp&|}& &&<t&=&ticket++>;& &&<serving++>;& &&{|&holdTick(t)&|} ! &&{|&emp&|}& &&do&{& } $ &&&&{|&holdTick(t)&|}& &&&&<s&=&serving>;& &&&&{|&if&s==t&then&holdLock()&else&holdTick(t)&|}& &&}&while&(s&!=&t);& &&{|&holdLock()&|}& }& & Axioms$=$$${$ {|&emp&|}&<t&=&ticket++>&{|&holdTick(t)&|},& ! $ {|&holdLock()&|}&<serving++>&{|&emp&|},&& ... } & {|&holdTick(t)&|}&<s&=&serving>&{|&if&s==t&then&holdLock()&else&holdTick(t)&|},&&

  11. method&unlock()&{& method&lock()&{& &&{|&holdLock()&|}& &&{|&emp&|}& &&<t&=&ticket++>;& &&<serving++>;& &&{|&holdTick(t)&|} ! &&{|&emp&|}& &&do&{& } $ &&&&{|&holdTick(t)&|}& &&&&<s&=&serving>;& &&&&{|&if&s==t&then&holdLock()&else&holdTick(t)&|}& &&}&while&(s&!=&t);& &&{|&holdLock()&|}& }& & ReificaGon$=$$ constraint&holdLock()&&&*&holdLock()&&&G>&false;& constraint&emp&&&&&&&&&&&&&&&&&&&&&&&&&G>&ticket&>=&serving;& constraint&holdTick(t)&&&&&&&&&&&&&&&&&G>&ticket&>&t;& constraint&holdLock()&&&&&&&&&&&&&&&&&&G>&ticket&!=&serving;& constraint&holdLock()&&&*&holdTick(t)&&G>&serving&!=&t;& constraint&holdTick(ta)&*&holdTick(tb)&G>&ta&!=&tb;&

  12. Checking*proof*outline Infinite!!!' Eg.&& holdLock()&*&holdTick(1)&*&holdTick(2)&*&holdTick(3)&*&holdTick(4)& *&holdTick(5)&*&holdTick(6)&*&holdTick(7)&*&holdTick(8)&*& holdTick(9)&*&holdTick(10)&*&holdTick(11)&*&holdTick(12)&*&... $ $ $ $

  13. Defining*views constraint&holdLock()&*&holdLock()&&&G>&&&false; $ MulGset$subset$

  14. Defining*views View$adjoint$ (mulGset$minus)$ finite$ ⇒ =

  15. Example Axiom:$$ {|&emp&|}&<t&=&ticket++>&{|&holdTick(t)&|} $ Defining$view:$$ holdLock() $ Proof$obligaGon:$$ J t = ticket + + K b emp ⇤ ( holdLock () \ m holdTick ( t )) c ✓ D ( holdLock ()) J t = ticket + + K b emp ⇤ holdLock () c ✓ D ( holdLock ()) J t = ticket + + K ( ticket � serving ) ✓ ticket 6 = serving

  16. Making*proofs*simpler! Horn$clause!$

  17. Demo*#2

  18. Synergies • More$powerful$backTend$solvers$ needed$to$verify$heap$programs.$ $ • CounterTexample$finding$needed$if$ Starling$is$to$be$used$for$find/fix$loop.$ $$ • Starling$approach$useful$as$a$backT end$for$other$verificaGon$tools?$$

  19. Open*Development Follow$Starling$on$GitHub:$ $h#p://github.com/septract/starlingTtool/$

  20. Proof*of*approximaHon

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend