Hi Mangpo,
I tried to get to the root of the problem this morning but I failed. It’s quite possible that there is a bug in the SKETCH compiler. It is a complex system and sometimes diagnosing it is difficult. This is one reason why cs294 teaches you how to build a small, lightweight synthesizer.
Your Python-based verification is a good way to verify this particular program.
Another approach for verifying your solution would be to create a verification formula, as explained in Lecture 2: translate the spec to a formula; translate the sketch to a formula; set holes to your solution; and ask the solver if there is an input on which the spec and the completed sketch disagree.
--Ras
--
--