Introduce solvedPatterns to LogicalPlans

This will be used to track which patterns have been solved similar to how IdNames are used and is required for var length patterns.