Foundations of Complex-System Theories