Compositional generalization in minds and machines