import sage.symbolic.random_tests
def assert_strict_weak_order(a,b,c, cmp_func):
r"""
Checks that ``cmp_func`` is a strict weak order.
A strict weak order is a binary relation ``<`` such that
* For all `x`, it is not the case that `x < x` (irreflexivity).
* For all `x\not=y`, if `x < y` then it is not the case that `y <
x` (asymmetric).
* For all `x`, `y`, and `z`, if `x < y` and `y < z` then `x < z`
(transitivity).
* For all `x`, `y`, and `z`, if x is incomparable with `y`, and
`y` is incomparable with `z`, then `x` is incomparable with `z`
(transitivity of equivalence).
INPUT:
- ``a``, ``b``, ``c`` -- anything that can be compared by ``cmp_func``.
- ``cmp_func`` -- function of two arguments that returns their
comparison (i.e. either ``True`` or ``False``).
OUTPUT:
Does not return anything. Raises a ``ValueError`` if ``cmp_func``
is not a strict weak order on the three given elements.
REFERENCES:
http://en.wikipedia.org/wiki/Strict_weak_ordering
EXAMPLES::
sage: a, b, c = [ randint(-10,10) for i in range(0,3) ]
sage: assert_strict_weak_order(a,b,c, lambda x,y: x