Squeezing the most out of interference: An optimization framework for joint interference exploitation and avoidance