A Complexity-Based Theory of Compositionality