Towards a Theory of Planned Economy