% test for ordered logic

test :-
    % identity
    prove(a \ a),
    prove(a / a),
    % composition
    prove((b \ c) \ ((a \ b) \ (a \ c))),
    prove(((c / a) / (b / a)) / (c / b)),
    \+ prove((a \ b) \ ((a \ c) / (c / b))),
    % associativity
    equiv((a * b) * c, a * (b * c)),
    equiv((a + b) + c, a + (b + c)),
    equiv((a & b) & c, a & (b & c)),
    % commutativity
    equiv(a + b, b + a),
    equiv(a & b, b & a),
    \+ equiv(a * b, b * a),
    % unit
    equiv(1 \ a, a),
    equiv(a / 1, a),
    equiv(a * 1, a),
    equiv(1 * a, a),
    equiv(a & t, a),
    equiv(a + 0, a),
    % idempotence
    equiv(a + a, a),
    equiv(a & a, a),
    \+ equiv(a * a, a),
    % distributivity
    % a + b
    equiv((a + b) \ c, (a \ c) & (b \ c)),
    \+ equiv(a \ (b + c), (a \ b) + (a \ c)),
    equiv(c / (a + b), (c / a) & (c / b)),
    \+ equiv((b + c) / a, (b / a) + (c / a)),
    equiv((a + b) * c, (a * c) + (b * c)),
    \+ equiv((a + b) & c, (a & c) + (b & c)),
    % a & b
    \+ equiv((a & b) \ c, (a \ c) & (b \ c)),
    equiv(a \ (b & c), (a \ b) & (a \ c)),
    \+ equiv(c / (a & b), (c / a) & (c / b)),
    equiv((a & b) / c, (a / c) & (b / c)),
    \+ equiv((a & b) * c, (a * c) & (b * c)),
    % a * b
    equiv((a * b) \ c, b \ (a \ c)),
    \+ equiv(a \ (b * c), (a \ b) * (a \ c)),
    equiv(c / (a * b), (c / b) / a),
    \+ equiv((a * b) / c, (a * c) / (b * c)),
    \+ equiv((a * b) & c, (a & c) * (b & c)),
    \+ equiv((a * b) + c, (a + c) * (b + c)),
    % a \ b
    \+ equiv((a \ b) \ c, (a + c) * (b \ c)),
    \+ equiv(a \ (b \ c), b \ (a \ c)),
    equiv((a \ b) / c, a \ (b / c)),
    \+ equiv((a \ b) * c, (c \ a) \ (b * c)),
    \+ equiv((a \ b) + c, b + (a \ c)),
    % a / b
    \+ equiv((a / b) \ c, (a + c) * (b \ c)),
    equiv(a \ (b / c), (a \ b) / c),
    \+ equiv((a / b) / c, (a / c) / b),
    \+ equiv(a / (b / c), (c + a) * (a / b)),
    \+ equiv((a / b) * c, (b / c) * (a + c)),
    \+ equiv((a / b) + c, b + (a / c)),
    % 0
    equiv(0 \ c, t),
    \+ equiv(c \ 0, 0),
    equiv(c / 0, t),
    \+ equiv(0 / c, 0),
    equiv(0 * c, 0),
    equiv(0 & c, 0),
    % t
    \+ equiv(t \ c, t),
    equiv(a \ t, t),
    \+ equiv(c / t, t),
    equiv(t / c, t),
    \+ equiv(t * c, t),
    % 1
    equiv(1 \ c, c),
    \+ equiv(a \ 1, 1),
    equiv(c / 1, c),
    \+ equiv(1 / c, 1),
    \+ equiv(1 & c, c),
    \+ equiv(1 + c, c),
    %
    true.
