The idea is to use the following piece of code: Resolve@Exists[{i, j, k}, i < j && j < k && i < k] (* True *) Resolve@Exists[{i, j, k}, i < j && j == k && i == k] (* False *) Here is a complete solution. I'm sure there are more efficient ways. lex[{i_, j_}, {k_, l_}] := i < j && k < l && (i < k || i == k && j < l) splitAt[set_List, {}] := {set} splitAt[set_List, {p_, r___}] := {Take[set, p]} ~ Join ~ splitAt[Drop[set, p], {r} - p] partitions[set_List, n_Integer?Positive] /; n <= Length[set] := splitAt[set, #] & /@ Subsets[Range[Length[set] - 1], {n - 1}] configuration[part_List] := And @@ Join[Equal @@@ part, MapThread[Less, {Last /@ Most@part, First /@ Rest@part}]] isConsistent[vars_, cond_, config_] := Resolve@Exists[vars, cond && config] These are rather general functions. The following part is more specific instead. vars = {i, j, k, l, m, n}; condition = lex[{i, j}, {k, l}] && lex[{k, l}, {m, n}]; permutations = Cases[Permutations[{i, j, k, l, m, n}], Except[{___, j, ___, i, ___} | {___, l, ___, k, ___} | {___, n, ___, m, ___}]]; table = Table[{card, Select[configuration /@ Flatten[partitions[#, card] & /@ permutations, 1], isConsistent[vars, condition, #] &]}, {card, 1, 6}]; Now the variable `table` holds the solutions, gathered by cardinality. If you want, you can print the solutions this way: string = StringJoin@Flatten[Riffle[ Table[{ToString@i <> ":\n", "\t" <> # <> "\n" & /@ ToString /@ table[[i, 2]]}, {i, 1, 6}], "\n"]] If someone needs help, I can clarify any part of the code. By the way, the number of solutions for cardinality 1 through 6 are `{0, 0, 8, 72, 60, 15}`.