An adaptive model of category construction with similarity defined by internally generated constraints