Finish the compilation of pattern matching for the backend
Rename map_patterns to results