Transforming semantics by abstract interpretation