Applying Program Transformation to Type Inference for a Logic Language