Type inference algorithm implemented.