Pattern Theory From Representation To Inference