Foundations of Complex-system Theories