%% Product: Reals * {a,b,c,d}

:- dynamic and_comb/3.

member(pair(X,Y)):- number(X),0=<X,X=<1, con(Y).
con(a).
con(b).
con(c).
con(d).

top(pair(1,d)).
bot(pair(0,a)).

leq(pair(X1,Y2),pair(X2,Y2)):- X1 < X2,leq2(Y1,Y2).
leq2(a,_).
leq2(_,d).

and_comb(pair(X1,Y1),pair(X2,Y2),pair(X3,Y3)):-X3 is X1*X2, and2(Y1,Y2,Y3).
and2(d,X,X):-!.
and2(X,d,X):-!.
and2(b,b,b):-!.
and2(c,c,c):-!.
and2(_,_,a).