Program Synthesis Using Statistical Models And Logical Reasoning