//@Description A toy Sketch to synthesize a polynomial of degree 4.

int W = 5;
// This benchmark requires --inlineamnt  ≥ 5 in order to resolve.

generator bit [W] mult(bit[W] in1, bit[W] in2){ /* automatically rewritten */
	bit [W] result = 0;
	for(int i=0; i<W; ++i){
		if(in2[i]==1){
			result = result + in1;
		}
		in1 = in1 << 1;
	}
	return result;
}


generator bit[W] poly(bit[W] n, bit[W] x) { /* automatically rewritten */
	bit[W] minusone = 0;
	minusone = !minusone;
		
	if (!n[0]&!n[1]&!n[2]&!n[3]&!n[4]) return ??; 
	else return mult(x, poly(n+minusone, x)) + ??;
}


bit[W] spec (bit[W] x) {
	bit[W] one = 0; one[0] = 1;
	bit[W] two = 0; two[1] = 1;

	return mult(mult(x+two,x+one),mult(x,x+one+two));
}


bit[W] p1Sk (bit[W] x) implements spec {
	bit[W] one = 0; one[0] = 1;
	bit[W] two = 0; two[1] = 1;
	bit[W] three = one+two;
	bit[W] four = two+two;

	return poly(four,x);
}