Toward a Theory of Intelligence