Theory of real-time hierarchical control of manufacturing systems