Prolog can be a convenient language for implementation, but some people think about algorithms, which can be a profitable specialized approach.
Among operators of this kind (equality between two variables or between one variable and one constant), the only inconsistency that can arise is the path connecting the two different constants.
Thus, if we find all the inconsistency paths that connect pairs of different constants, it is necessary and sufficient to find a set of edges (initial equalities) that disconnect all these paths.
It is tempting to think that the greedy algorithm here is optimal: always choose the edge to delete, which is common to the largest number of remaining "inconsistent" paths. So I suggest:
1) Find all the simple paths P connecting two different constants (without going through any third constant) and create a connection structure between these paths and their edges.
2) Count the frequencies of the edges E appearing along these "inconsistent" paths P
3) Find a sufficient number of edges to remove by pursuing a greedy strategy, deleting the next edge that appears most often, and accordingly update the edge counts on the remaining paths.
4) Given that the upper bound is on the edges needed for deletion (to leave a consistent subset of operators), apply a backtracking strategy to determine if fewer edges are enough.
As applicable to the example in the Question, there are exactly two ways of "inconsistency":
2 -- b -- z -- 3 2 -- b -- z -- c -- 3
Removing one of the two edges, 2 -- b or b -- z , common to both of these paths is enough to disable both paths of inconsistency (removing all inconsistencies among other operators).
In addition, it is obvious that for this there would be no other removal of one edge.