• No results found

Straight-line and Recursive Program Synthesis

The earliest work that we are aware of in the area of synthesizing straight-line program fragments is the extensive work on what was then called “super-optimizations”. The original problem was formulated by Massalin [Mas87], and the objective was to deduce thesmallest

possible program that was behaviorally identical to another, possibly longer and less efficient, program. The approach presented by Massalin [Mas87] could only scale to a programs with a very few instructions. Since then, more scalable algorithms have emerged [JNR02, JNZ06] and superoptimizers have also been applied in peephole optimizations and binary translation [BA06, BA08, SSCA15]. More recently, stochastic approaches have been successfully applied to yield scalable superoptimization algorithms [SSA13, SSA14]. Stochastic techniques techniques have also been applied to synthesize loop invariants [SA14].

Significant inroads have been made in the last decade or so in the area of synthesizing small program fragments to perform various tasks, starting from some form of formal specifications. The research on thesketchframework [SLRBE05] perhaps reinvigorated research in the area of program synthesis. The idea of using an unoptimized program as a specification for a more optimized version which is to be synthesized was novel. Although the initial system was for synthesis of bit-streaming programs [SLRBE05], the techniques were later adapted to sketching finite programs [STB+06], stencils computations [SAT+07], concurrent

data structures [SLJB08] as well as to synthesize code for data structure manipulations via storyboards [SS11]. Synthesis of data structure manipulation routines has also been explored in other recent work [FCD15, AGK13]. Other recent work has viewed the problem of synthesizing straight-line code as that of component-based synthesis [GJTV11, JGST10]. Enumerative approaches to synthesizing code fragments that are vectorized equivalents of unoptimized code has also been explored in recent work [BCG+13].

More recently, the FlashFill algorithm [Gul11] was one of the first to leverage the notion of aninductivespecification, which has been described in Chapter 5. The original FlashFill

algorithm was designed for synthesizing string transformations in spreadsheets based on a few input-output examples demonstrating the desired transformation [Gul11]. However, since then, the techniques have been applied to a variety of different domains [KG15, BGHZ15, LG14, GKT11, SG12, PGGP14, PGBG12]. A framework called FlashMeta [PG15], which unifies the domain-specific inductive synthesis algorithms implemented in the rest of the Flash algorithms using a common abstract algorithm has also been recently developed.

Program Synthesis techniques have also recently been used to synthesize loop invariants. The ICE [GLMN14] and Alchemist [SGM15] are prime examples, along with algorithms that use a stochastic search [SA14]. A tool based on the Alchemist [SGM15] algorithm participated in the 2015SyGuScompetition in the invariant synthesis track. Decision trees based learners have also been explored recently forSyGuSsolvers [GNMR15], where they have been primarily used to learn thresholds for affine classifiers. Type directed approaches to program synthesis from input-output examples have also recently been a subject of study [OZ15, Ose15, FOWZ16].

10

Conclusions

This chapter concludes this dissertation by first providing a brief summary of the research that has been described in this dissertation, followed by an orthogonal exploration of the themes that have been prevalent throughout this dissertation. We then highlight some avenues along which the work described in this dissertation can be improved and extended, and conclude with the author’s opinions and outlook about research in the area of verification and program synthesis.

10.1

Summary of the Dissertation

This dissertation approached the problem of synthesizing a distributed reactive synthesis from the direction ofcompletingan incomplete description of the protocol. Apart from the inherent

difficulty of developing such protocols, our primary motivation for this approach was that it was not clear if describing the protocol purely using a temporal logic is necessarily easier than describing it operationally. Furthermore, the complexity of distributed reactive synthesis from temporal logic descriptions made it all the more appealing to view the synthesis problem as a fruitful interaction between a synthesis tool and a programmer.

We formalized the problem of protocol completion, and described our experience with using a theoretically elegant, but practically ineffective, symbolic algorithm to solve the protocol completion problem.

We then described a tool calledtransitwhere the programmer would symbolically codify the parts of the protocol that are well understood. The programmer would then describe fixes to counterexamples presented by the tooltransitusingconcolic snippets, which were a

is intended to be derived from a concrete erroneous execution. The programmer is a part of the synthesis loop intransit. Our prototype oftransitwas able to assist the programmer in describing a complex industrial cache coherence protocol, demonstrating the scalability of the proposed techniques.

We then made a brief digression to describe the SyGuS problem that came about as a generalization of the core computational problem solved withintransit. TheSyGuSeffort was successful and annualSyGuScontests are conducted with participation growing each year. We described an enumerative strategy to solve instances of theSyGuSproblems, studied the limitations of purely enumerative approaches, and proposed an improved algorithm that is enumerative in spirit, but demonstrates enhanced scalability. We empirically evaluated a tool based on this algorithm, calledeusolver, and found it to be able to solve a set of benchmarks that no existingSyGuSsolver had been able to solve, to the best of our knowledge.

We then concluded our excursion into the world of syntax-guided synthesis and developed algorithms for distributed protocol synthesis that eliminated the programmer from the synthesis loop by automatically analyzing counterexamples and suitably constraining future solution candidates. We evaluated these algorithms on a variety of benchmarks, and observed that while they scaled to moderately complex protocols, their scalability was nonetheless lower than that oftransit. We also described a model checking and synthesis framework, calledkinara, that we developed as part of this effort, and which has now been released as an open-source project.