1. A method for abstraction-guided synthesis, comprising: enumerating abstract traces of a program P; determining, using a processor, a trace in the abstract traces violating a specification S that describes the program P; computing one or more constraints that avoid the trace T that violates the specification S, and adding the constraint to constraint C; repeating the steps of enumerating, determining and computing; and in response to determining that there is no trace that violates the specification S, generating program P′ that modifies the program P by including one or more constraints specified in the constraint C.