fixed replace_edge predicate

there's still a minor bug regarding the list format