PROGRAM SYNTHESIS FOR DECLARATIVE SYSTEMS