there are some researches on the right track already https://www.se.cs.uni-saarland.de/projects/congruence/