First Task

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

 
x,y,i,j.  0f(x,y)2    
f(x,y)=0 x=y
f(x,y)=01i,j2 |x-y|(x-y)(j-i)f(x+i,y+j)=0
f(x,y)0 f(x+f(x,y),y+f(x,y))0|x-y|>0

In response, the synthesizer produces the following implementation :

Implementation


f(x,y)= if x=y then 0 else 1


Question 1

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

Question 2

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

Question 3

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

Question 4

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