[BenweiZhu] add condition pq pp pq and pq pr or ps pq