RESULT = Fred&Teddy&(Fred|Teddy)|(Fred)&(John) RESULT now should contain RESULT = (Fred&John)|(Teddy&Fred&John)