Lecture01 Overview
Lecture01 Overview
1
Instructor
Sankha Narayan Guria
2
Logistics
• Lectures:
• Mon Wed Fri: 3:00 - 3:50pm LEEP2 G411 But you already knew that!
• Office Hours:
• Wed: 4:00 - 5:00pm Eaton 2034
• Course Website:
• https://sankhs.com/eecs700/
• Communications through Canvas and Discord
3
Objectives
1. Understand what program • Lectures
synthesis can do and how • Read and discuss research papers
4
Evaluation
• Class Participation
• Ask/answer questions in class
• Participate in discussions on Discord
• Paper Reviews
• 9 papers, 5% each
• Final Project
• Team formed by deadline: 5%
• 1 page project proposal: 15%
• Project presentation: 15%
• Final report: 15%
5
Paper Reviews
• Due on Thursday, by end of day
• First review is due next week!
• Will be posted on website a week before due date
• Reviews submitted via Canvas
• Link on website
• Website has details of review guidelines
• Discussion:
• Before review is due: discuss on Discord
• After review is due: discuss in class (Friday)
6
Project
• Kinds of projects:
• Re-implement techniques from a paper
• Apply existing synthesis framework to a new domain
• Extend/improve existing synthesis algorithm or tool
• Develop a new synthesis algorithm or tool
• …
• Judged in terms of
• Quality of execution
• Originality
• Scope
7
Project
Team forming • Teams of 2-3
• Pick a project:
• List of suggested projects coming soon on
website
• Please talk to me!
• One page: explain what you plan to do
Proposal and give some evidence that you’ve
started to work on it
• Presentations in last few classes
Presentation • ~10-15 min per project
• 3-8 pages, structured like a research
Report paper
8
Now to the good stuff …
9
The goal: automate programming
What is program synthesis?
append:
push ebp
mov ebp, esp
push eax
push ebx
push len
“Any
call malloc
s ufficie
mov ebx, [ebp + 12]
ntly a
d
mov [eax + info], ebx
mov dword [eax + next], 0 vance
from d compiler
mov ebx, [ebp + 8]
cmp dword [ebx], 0
a synt
hesize is indisting
je null_pointer void insert(node *xs, int x) {
mov ebx, [ebx] node *new;
node *temp;
r” ui s ha
b
next_element:
le
node *prev;
cmp dword [ebx + next], 0
je found_last new = (node *)malloc(sizeof(node));
mov ebx, [ebx + next] if(new == NULL) {
jmp next_element printf("Insufficient memory.");
return;
found_last: }
push eax new->val = x;
push addMes new->next = NULL;
call puts if (xs == NULL) {
add esp, 4 xs = new;
pop eax } else if(x < xs->val) {
mov [ebx + next], eax new->next = xs;
xs = new;
go_out: } else {
pop ebx prev = xs;
pop eax temp = xs->next;
mov esp, ebp while(temp != NULL && x > temp->val) {
pop ebp prev = temp;
ret 8 temp = temp->next;
}
null_pointer: if(temp == NULL) {
?
push eax prev->next = new;
push nullMes } else {
call puts new->next = temp;
add esp, 4 prev->next = new; insert x [] = [x]
pop eax } insert x (y:ys)
mov [ebx], eax } | x ≤ y = x:y:ys
jmp go_out } | otherwise = y:(insert x ys)
[Gulwani 2011]
FlashFill: a feature of Excel 2013
FlashFill: a feature of Excel 2013
Modern program synthesis: Sketch
• Problem: isolate the least significant zero bit in a word
• example: 0010 0101 à 0000 0010
• Easy to implement with a loop
int W = 32;
bit[W] isolate0 (bit[W] x) { // W: word size
bit[W] ret = 0;
for (int i = 0; i < W; i++)
if (!x[i]) { ret[i] = 1; return ret; }
}
[Solar-Lezama 2013]
Sketch: space of possible
implementations
/**
* Generate the set of all bit-vector expressions
* involving +, &, xor and bitwise negation (~).
*/
&
0000 0010
Modern program synthesis: Synquid
• Problem: intersection of sets represented as strictly sorted
lists
• example: intersect [4, 8, 15, 16, 23, 42] [8, 16, 32, 64] à [8, 16]
• Also: we want a guarantee that it’s correct on all inputs!
intersect
intersect ::
:: xs:List
xs:SLista a→ ys:List a
→ ys:SList a
v:SList
→→ {List a a | elems v = elems xs ∩ elems ys}
the set of
elements
program
space
24
Dimensions in program synthesis
Behavioral spec:
what should the program should do?
Search strategy:
How does the system find Structural spec:
the program you want? what is the space of programs to
explore?
[Gulwani 2010]
Behavioral spec
• How do you tell the system what the program
should do?
• What is the input language / format?
• What is the interaction model?
• What happens when the intent is ambiguous?