Now question is whether compare_rat/2
can
be extended to a total order or not. On the positive side
we find that a partial order can always be extended:
Szpilrajn Extension Theorem
https://en.wikipedia.org/wiki/Szpilrajn_extension_theorem
But what if compare_rat/2
by @kuniaki.mukai is not a partial
order? What if it is only a preorder, or even worse only
a binary relation. Returning 4 values doesn’t guarantee
that it is a partial order. We have help from here:
Szpilrajn, Arrow and Suzumura
https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-999X.2011.04130.x
A binary relation needs to be Suzumura consistent,
so that it can be extended into a total preorder. And
compare_rat/2
is not Suzumura consistent, as
the following cycle a < c < b < a
shows:
?- repeat, fuzzy(A), fuzzy(C), compare_rat(_X, A, C), _X = (<),
fuzzy(B), compare_rat(_Y, C, B), _Y = (<),
compare_rat(_Z, B, A), _Z = (<).
A = s(s(A, A), 1), _A = s(_A, s(_, 1)), C = s(_A, _),
_B = s(1, _B), B = s(B, s(1, _B))
Was only testing with compare_rat/3
, but the theorem applies
also to other compare proposals, and can be used to exclude
them, as soon as a Suzumura inconsistency is found.