compute predecessors