Towards Automatic Inference of Task Hierarchies in Complex Systems