Implemented a function to extract all variable nodes from a given instance link according to its pattern link.
Only extend patterns with shared variable nodes.