ABSTRACT
We describe PSketch, a program synthesizer that helps programmers implement concurrent data structures. The system is based on the concept of sketching, a form of synthesis that allows programmers to express their insight about an implementation as a partial program: a sketch. The synthesizer automatically completes the sketch to produce an implementation that matches a given correctness criteria.
PSketch is based on a new counterexample-guided inductive synthesis algorithm (CEGIS) that generalizes the original sketch synthesis algorithm from Solar-Lezama et.al. to cope efficiently with concurrent programs. The new algorithm produces a correct implementation by iteratively generating candidate implementations, running them through a verifier, and if they fail, learning from the counterexample traces to produce a better candidate; converging to a solution in a handful of iterations.
PSketch also extends Sketch with higher-level sketching constructs that allow the programmer to express her insight as a "soup" of ingredients from which complicated code fragments must be assembled. Such sketches can be viewed as syntactic descriptions of huge spaces of candidate programs (over 108 candidates for some sketches we resolved).
We have used the PSketch system to implement several classes of concurrent data structures, including lock-free queues and concurrent sets with fine-grained locking. We have also sketched some other concurrent objects including a sense-reversing barrier and a protocol for the dining philosophers problem; all these sketches resolved in under an hour.
- J. R. Allen, K. Kennedy, C. Porterfield, and J. Warren. Conversion of control dependence to data dependence. In POPL ?83: Proceedings of the 10th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 177--189, New York, NY, USA, 1983. ACM. Google Scholar
Digital Library
- D. Amit, N. Rinetzky, T. Reps, M. Sagiv, and E. Yahav. Comparison under abstraction for verifying linearizability. In CAV ?07: 19th International Conference on Computer Aided Verification, volume 4590, pages 477--490. Springer, 2007. Google Scholar
Digital Library
- D. Andre and S. Russell. Programmable reinforcement learning agents. Advances in Neural Information Processing Systems, 13, 2001. MIT Press.Google Scholar
- D. Angluin and C. H. Smith. Inductive inference: Theory and methods. ACM Comput. Surv., 15(3):237--269, 1983. Google Scholar
Digital Library
- Y. Bar-David and G. Taubenfeld. Automatic discovery of mutual exclusion algorithms. In PODC ?03: Proceedings of the twentysecond annual symposium on Principles of distributed computing, pages 305--305, New York, NY, USA, 2003. ACM. Google Scholar
Digital Library
- J. Bilmes, K. Asanovic, C.-W. Chin, and J. Demmel. Optimizing matrix multiply using phipac: A portable, high-performance, ansi c coding methodology. In International Conference on Supercomputing, pages 340--347, 1997. Google Scholar
Digital Library
- S. Burckhardt, R. Alur, and M. M. K. Martin. Checkfence: checking consistency of concurrent data types on relaxed memory models. In PLDI ?07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, volume 42, pages 12--21, New York, NY, USA, 2007. ACM. Google Scholar
Digital Library
- B. Fischer and J. Schumann. Autobayes: a system for generating data analysis programs from statistical models. Journal of Functional Programming, 13(3):483--508, May 2003. Google Scholar
Digital Library
- S. Heller, M. Herlihy, V. Luchangco, M. Moir, W. N. S. III, and N. Shavit. A lazy concurrent list-based set algorithm. In OPODIS ?05: 9th International Conference on Principles of Distributed Systems, volume 3974, pages 3--16. Springer, 2005. Google Scholar
Digital Library
- D. Hensgen, R. Finkel, and U. Manber. Two algorithms for barrier synchronization. International Journal of Parallel Programming, 17(1):1--17, 1988. Google Scholar
Digital Library
- M. Herlihy and N. Shavit. The art of multiprocessor programming. Morgan Kaufmann, 2008. Google Scholar
Digital Library
- M. P. Herlihy and J. M.Wing. Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12(3):463--492, 1990. Google Scholar
Digital Library
- G. J. Holzmann. The model checker SPIN. Software Engineering, 23(5):279--295, 1997. Google Scholar
Digital Library
- R. Kowalski. Algorithm = logic + control. Commun. ACM, 22(7):424--436, 1979. Google Scholar
Digital Library
- L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Transactions on Computers, 28(9):690--691, 1979. Google Scholar
Digital Library
- A. Silberschatz and P. B. Galvin. Operating System Concepts. John Wiley & Sons, Inc., New York, NY, USA, 2000. Google Scholar
Digital Library
- D. R. Smith. KIDS: A semiautomatic program development system. IEEE Transactions on Software Engineering, 16(9):1024--1043, 1990. Google Scholar
Digital Library
- A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Sketching stencils. In PLDI ?07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, volume 42, pages 167--178, New York, NY, USA, 2007. ACM. Google Scholar
Digital Library
- A. Solar-Lezama, R. Rabbah, R. Bodik, and K. Ebcioglu. Programming by sketching for bit-streaming programs. In PLDI ?05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, pages 281--294, New York, NY, USA, 2005. ACM Press. Google Scholar
Digital Library
- A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Combinatorial sketching for finite programs. In ASPLOS ?06, San Jose, CA, USA, 2006. ACM Press. Google Scholar
Digital Library
- A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Combinatorial sketching for finite programs. In 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS 2006), pages 404--415, New York, NY, USA, 2006. ACM Press. Google Scholar
Digital Library
- V. Vafeiadis, M. Herlihy, T. Hoare, and M. Shapiro. Proving correctness of highly-concurrent linearisable objects. In PPoPP ?06: Proceedings of the eleventh ACM SIGPLAN symposium on Principles and practice of parallel programming, pages 129--136, New York, NY, USA, 2006. ACM. Google Scholar
Digital Library
- M. T. Vechev, E. Yahav, and D. F. Bacon. Correctness-preserving derivation of concurrent garbage collection algorithms. In PLDI ?06: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, pages 341--353, New York, NY, USA, 2006. ACM. Google Scholar
Digital Library
- M. T. Vechev, E. Yahav, D. F. Bacon, and N. Rinetzky. Cgcexplorer: a semi-automated search procedure for provably correct concurrent collectors. In PLDI ?07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, pages 456--467, New York, NY, USA, 2007. ACM. Google Scholar
Digital Library
Index Terms
Sketching concurrent data structures
Recommendations
Combinatorial sketching for finite programs
ASPLOS XII: Proceedings of the 12th international conference on Architectural support for programming languages and operating systemsSketching is a software synthesis approach where the programmer develops a partial implementation - a sketch - and a separate specification of the desired functionality. The synthesizer then completes the sketch to behave like the specification. The ...
Combinatorial sketching for finite programs
Proceedings of the 2006 ASPLOS ConferenceSketching is a software synthesis approach where the programmer develops a partial implementation - a sketch - and a separate specification of the desired functionality. The synthesizer then completes the sketch to behave like the specification. The ...
Sketching concurrent data structures
PLDI '08We describe PSketch, a program synthesizer that helps programmers implement concurrent data structures. The system is based on the concept of sketching, a form of synthesis that allows programmers to express their insight about an implementation as a ...







Comments