## Combinatorial sketching for finite programs (2006)

### Cached

### Download Links

Venue: | IN 12TH INTERNATIONAL CONFERENCE ON ARCHITECTURAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPERATING SYSTEMS (ASPLOS 2006 |

Citations: | 53 - 14 self |

### BibTeX

@INPROCEEDINGS{Solar-Lezama06combinatorialsketching,

author = {Armando Solar-Lezama and Liviu Tancau and Rastislav Bodik and Vijay Saraswat and Sanjit Seshia},

title = {Combinatorial sketching for finite programs},

booktitle = {IN 12TH INTERNATIONAL CONFERENCE ON ARCHITECTURAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPERATING SYSTEMS (ASPLOS 2006},

year = {2006},

pages = {404--415},

publisher = {ACM Press}

}

### Years of Citing Articles

### OpenURL

### Abstract

Sketching 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 correctness of the synthesized implementation is guaranteed by the compiler, which allows, among other benefits, rapid development of highly tuned implementations without the fear of introducing bugs. We develop SKETCH, a language for finite programs with linguistic support for sketching. Finite programs include many highperformance kernels, including cryptocodes. In contrast to prior synthesizers, which had to be equipped with domain-specific rules, SKETCH completes sketches by means of a combinatorial search based on generalized boolean satisfiability. Consequently, our combinatorial synthesizer is complete for the class of finite programs: it is guaranteed to complete any sketch in theory, and in practice has scaled to realistic programming problems. Freed from domain rules, we can now write sketches as simpleto-understand partial programs, which are regular programs in which difficult code fragments are replaced with holes to be filled by the synthesizer. Holes may stand for index expressions, lookup tables, or bitmasks, but the programmer can easily define new kinds of holes using a single versatile synthesis operator. We have used SKETCH to synthesize an efficient implementation of the AES cipher standard. The synthesizer produces the most complex part of the implementation and runs in about an hour.

### Citations

605 | A transformation system for developing recursive programs
- Burstall, Darlington
- 1977
(Show Context)
Citation Context ...h terminates on all inputs after a bounded number of operations. Many high-performance kernels have this property. On the contrary, systems based on domain-specific rewrite rules are often incomplete =-=[2, 6, 8, 9]-=-. Furthermore, the rules may not easily reveal which implementations they are able to generate. The second benefit is that we can express sketches as genuine partial programs, i.e., programs with “hol... |

513 |
An extensible sat-solver
- Eén, Sörensson
(Show Context)
Citation Context ...e can statically eliminate most of the branches produced when generating functions for loop(t) c. 5.3.3 A Simple Example As an example of the application of these rules, consider the sketch:sdef f(int=-=[4]-=- in){ loop(??) f = f ^ in[??]; } Then, after applying the rules in Figure 3, the function becomes def f(int[4] in, int c1, int c2, int c3, int c4){ let t0 = c1 in if(t0>0) f = f ^ in[c2]; let t1 = t0-... |

329 | StreamIt: A Language for Streaming Applications
- Thies, Karczmarek, et al.
- 2002
(Show Context)
Citation Context ...uence of a baseline compiler. The awareness of the baseline compiler made the meta-level nature of rewrite rules even more confounding. (4) Sketching was embedded into a dataflow programming language =-=[14]-=-. While the dataflow programming model helped synthesis and subsequent parallelization, novice programmers faced sketching simultaneously with another new programming model. We present a combinatorial... |

105 | Programmable reinforcement learning agents
- Andre, Russell
- 2000
(Show Context)
Citation Context ...56] T = ??; int[4] output = 0; bit[32] mask = 0x000000FF; int[4][4] ch = {{0,1,2,3},{1,2,3,0}, {2,3,0,1},{3,0,1,2}}; for(int i=0; i<4; ++i){ int i0 = (int) in[ch[i][0]] & mask; int i1 = (int)(in[ch[i]=-=[1]-=-] >> 8) & mask; int i2 = (int)(in[ch[i][2]] >> 16) & mask; int i3 = (int)(in[ch[i][3]] >> 24) & mask; output[i] = T[0][i0] ^ T[1][i1] ^ T[2][i2] ^ T[3][i3]; output[i] = output[i] ^ rkey[i]; } return o... |

104 | Scalable error detection using boolean satisfiability
- Xie, Aiken
- 2005
(Show Context)
Citation Context ...e can either complete the sketch or show that the sketch is buggy. 5.3 Programs as Boolean Functions Our translation to boolean functions largely follows the standard approach used by other verifiers =-=[3, 17]-=-. Expressions computing kbit integers are modeled as a boolean function that computes a k-bit output vector from the program inputs and controls. To efficiently model array operations and switch state... |

84 | DAG-aware AIG rewriting: a fresh look at combinatorial logic synthesis, DAC’06
- Mishchenko, Chatterjee, et al.
- 2006
(Show Context)
Citation Context ... than what we would need to represent P (x) =S(x, c) for an arbitrary input x. ABC For most SAT problems, we use the MiniSAT [4] solver. However, for the hardest problems our solver can switch to ABC =-=[10]-=-, a system which does logic optimization based on And-Inverter Graphs originally designed for circuit verification and optimization. For the hardest problems we’ve encountered, ABC provides order of m... |

76 | Behavioral consistency of C and Verilog programs using bounded model checking
- Kroening, Clarke, et al.
- 2003
(Show Context)
Citation Context ...e can either complete the sketch or show that the sketch is buggy. 5.3 Programs as Boolean Functions Our translation to boolean functions largely follows the standard approach used by other verifiers =-=[3, 17]-=-. Expressions computing kbit integers are modeled as a boolean function that computes a k-bit output vector from the program inputs and controls. To efficiently model array operations and switch state... |

63 |
Hacker’s Delight
- Warren
- 2003
(Show Context)
Citation Context ...ts until a better implementation of the specification is developed. The function isolate0Fast is such a better implementation; it exploits bit-vector parallelism by relying on a little bit of algebra =-=[15]-=-. (The SKETCH language support arrays and vector operations are provided for arrays of bits, to give access to bitwise integer machine instructions.) bit[W] isolate0Fast (bit[W] x) implements isolate0... |

62 |
AutoBayes: A System for Generating Data Analysis Programs from Statistical Models
- Fischer, Schumann
(Show Context)
Citation Context ...h terminates on all inputs after a bounded number of operations. Many high-performance kernels have this property. On the contrary, systems based on domain-specific rewrite rules are often incomplete =-=[2, 6, 8, 9]-=-. Furthermore, the rules may not easily reveal which implementations they are able to generate. The second benefit is that we can express sketches as genuine partial programs, i.e., programs with “hol... |

49 | Programming by sketching for bit-streaming programs
- Solar-Lezama, Rabbah
- 2005
(Show Context)
Citation Context .... . . $5.00. that may be too tedious to develop and maintain without automatic synthesis of low-level detail. The concept of sketching was introduced in StreamBit, a system for bit-stream programming =-=[13]-=-. In StreamBit, sketching proved to be very effective: in a single afternoon, a sketching programmer implemented a DES cipher that nearly matched the performance of the best public-domain DES implemen... |

38 |
Toward Automatic Program Synthesis
- Manna, Waldinger
- 1971
(Show Context)
Citation Context ...h terminates on all inputs after a bounded number of operations. Many high-performance kernels have this property. On the contrary, systems based on domain-specific rewrite rules are often incomplete =-=[2, 6, 8, 9]-=-. Furthermore, the rules may not easily reveal which implementations they are able to generate. The second benefit is that we can express sketches as genuine partial programs, i.e., programs with “hol... |

34 | Denali: a goal-directed superoptimizer
- Joshi, Nelson, et al.
- 2002
(Show Context)
Citation Context |

29 | Strategic Directions in Constraint Programming
- Hentenryck
- 1996
(Show Context)
Citation Context ...ic branches is defined through learning, a domainspecific approach. The sketch completion problem is a constraint satisfaction problem similar to those studied by the constraint programming community =-=[7]-=-. Schema-based program synthesizers automatically compile a high-level declarative specification into code; an example is the AUTOBAYES system which compiles a statistical model into code [6]. However... |

9 | A Comparative Study of 2QBF Algorithms
- Ranjan, Tang, et al.
(Show Context)
Citation Context ... more than polynomial space but the trade-off is that we can employ the efficient techniques embedded in modern SAT solvers. Others have used two cooperating SAT solvers to solve 2QBF problems before =-=[11]-=-; however, none of the solvers presented in [11] uses counterexamples to guide the synthesis of controls in the way we do. 5.5 Scalability Optimizations In order to improve scalability, our solver per... |

6 |
A technique for counting ones in a binary computer
- Wegner
- 1960
(Show Context)
Citation Context ...storage four-fold. The clever implementation is shown in Figure 1(b). The sketch for this implementation is shown below. bit[64] IPsketched (bit[64] x) implements IP { bit[64] result; bit[32] table[8]=-=[16]-=- = ??; x = permute(x, 2); for (int i=0; i<8; ++i) { result[0:31] |= table[i][x[i*4::4]]; result[32:63] |= table[i][x[32+i*4::4]]; } return result; } The sketch contains two holes, in the arguably hard... |