Analogy and multi-level selection in the formation of a case grammar door