Foundations of Superintelligence