Introduction

First Video

Thank you for participating in this study! Let's begin by watching the following short video.


First Quiz

Say the user wishes to synthesize a function f which accepts two integer-valued arguments as input and produces an integer as output. They specify the function f as follows :

Specification


x,y. f(x,y)xf(x,y)y

In response, the synthesizer produces the following implementation :

Implementation


f(x,y)= if xy then x+2 else y+3

Question 1

Consider the following sub-expression in the implementation :
f(x,y)= if xy then x+2 else y+3
Say we change the sub-expression from x+2 to x-2 :
f'(x,y)= if xy then x-2 else y+3
Will this new implementation still satisfy the specification?

Question 2

Consider the same sub-expression as before :
f(x,y)= if xy then x+2 else y+3
Say we change the sub-expression from x+2 to x+1 instead :
f'(x,y)= if xy then x+1 else y+3
Will this new implementation satisfy the original specification?

Second Video

Let's watch the following video.


Example

Say the user wishes to synthesize a function f which accepts a list of numbers as input and produces a list of numbers as output. They specify the function f as follows :

Specification


f([1, 2, 3, 4]) = [-11, -12, -13, -14]

In response, the synthesizer produces the following implementation :

Implementation and Sub-specifications

Please hover over different parts of the implementation to see the corresponding sub-specifications.


import numpy
import operator

def f(l):
  return g2(g1(l)) f([1, 2, 3, 4]) = [-11, -12, -13, -14]


def g1(l):
  return list(map(numpy.reciprocal, l)) g1([-1, -2, -3, -4]) = [-11, -12, -13, -14]


def g2(l):
  return list(map(operator.neg, l)) g2([11, 12, 13, 14]) = [-11, -12, -13, -14]