Foundations of Complex Systems