Effects of galaxy--satellite interactions on bar formation