Quiz 6: Equivalent lambda (function) definitions
Question 1
Are
id1 and id2 alpha-equivalent?JavaScript
const id1 = x => x;
const id2 = y => y;Question 2
Given
id, is a1 a proper beta expansion of a2?JavaScript
const id = x => x;
const a1 = y => id(y);
const a2 = y => y;Question 3
Given
id, is a2 a proper beta reduction of a1?JavaScript
const id = x => x;
const a1 = y => id(y);
const a2 = y => y;Question 4
Given
id and konst, is F2 a proper eta reduction ofF1?JavaScript
const id = x => x;
const konst = x => y => x;
const F1 = x => y => konst(id)(x)(y);
const F2 = x => konst(id)(x);
const F3 = konst(id);Question 5
Given
id and konst, is F3 a proper eta reduction ofF2?JavaScript
const id = x => x;
const konst = x => y => x;
const F1 = x => y => konst(id)(x)(y);
const F2 = x => konst(id)(x);
const F3 = konst(id);Question 6
Are
F1 and F2 alpha-equivalent?JavaScript
const F1 = x => (x => x);
const F2 = y => (x => y);