Learning programs by learning from failures