Second Task

Our second task will be in the context of programming-by-example, a popular application of program synthesis. For this task, you will not have access to sub-specifications.

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


f(11, 45)=1f(1, 26)=3f(39, 29)=1f(1, 36)=3f(15, 12)=1
f(37, 1)=3f(40, 29)=1f(1, 33)=3f(34, 39)=1f(10, 1)=3
f(5, 7)=1f(1, 4)=3f(7, 21)=1f(26, 1)=3f(50, 33)=1
f(50, 1)=3f(13, 10)=1f(1, 39)=3f(46, 18)=1f(7, 1)=3

In response, the synthesizer produces the following implementation :

Implementation


f(x,y)= if x1 then 3x elif y1 then 3y else 1


Question 1

Consider the following sub-expression in the implementation :
f(x,y)= if x1 then 3x elif y1 then 3y else 1
Which input-output examples are relevant to the sub-expression?

Question 2

Consider the following sub-expression in the implementation :
f(x,y)= if x1 then 3x elif y1 then 3y else 1
Which input-output examples are relevant to the sub-expression?

Question 3

Consider the following sub-expression in the implementation :
f(x,y)= if x1 then 3x elif y1 then 3y else 1
Which input-output examples are relevant to the sub-expression?