Automatic Inference of Code Transforms and Search Spaces for Automatic Patch Generation Systems