Pattern Matching vs Logical Inference: A Deep Dive