A unified framework for heterogeneous patterns