treat AND and COND more optimistic in pool_addrelproviders

Also keep result sorted in the OR case.