Added PatternsToInstances map.
Merge pull request #511 from shujingke/shujing

Added PatternsToInstances map.