deal with loops in matrix of predicates