A TOOL FOR THE AUTOMATIC ADAPTATION OF SOFTWARE COMPONENTS BASED ON SEMANTIC SPECIFICATIONS We describe the design and methods of a tool that, based on behavioral specifications in interfaces, automatically generates simple adaptation functors to overcome minor incompatibilities between SML modules. The transformations that get generated can be expressed in a small recursion-free sublanguage of SML, namely a typed lambda-calculus with function and record types, ML polymorphism, first-order type functions and SML equality types. The transformations are correct, they transform type- and behaviorally correct implementations of an interface A into type- and behaviorally correct implementations of an interface B. The hope is that a tool of this kind can be useful for automatically overcoming incompatibilities that result from certain common interface changes in the evolution of software systems. Examples are changes that generalize functions by adding extra parameters, or changes that give functions different, but isomorphic, types. Such changes alter the types. The behavioral specifications, on the other hand, remain similar, and in many cases the similarities can be automatically recognized and the differences automatically overcome. Another possible application domain is in automatic library retrieval based on semantic specifications.