Principles of Cognition as Adaptations to the World