Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is_zero(zero_int).
- is_pos(pos_int).
- is_neg(neg_int).
- is_int(zero_int). is_int(pos_int). is_int(neg_int).
- gt(X,Y,Z) :- is_neg(X), + is_neg(Y), is_false(Z).
- gt(X,Y,Z) :- + is_neg(X), is_neg(Y), is_true(Z).
- gt(X,Y,Z) :- is_zero(X), is_zero(Y), is_false(Z).
- gt(X,Y,Z) :- is_pos(X), is_pos(Y), is_bool(Z).
- gt(X,Y,Z) :- is_neg(X), is_neg(Y), is_bool(Z).
- ...
- is_int((_,zero_int)). is_int((_,pos_int)). is_int((_,neg_int)).
- is_pos((_,pos_int)).
- is_zero((_,zero_int)).
- is_neg((_,neg_int)).
- gt((L1,_),(L1,_),(L3,Z)) :- is_false((L3,Z)).
- gt(X,Y,Z) :- is_pos(X), + is_pos(Y), is_true(Z).
- ?- gt(X,Y,Z).
- X = (_17376, _17378),
- Y = (_17376, _17384),
- Z = (_17388, bot) ; # bot is just my false wrapped in the same way
- false.
- %% I would expect it to find some satisfying binding.
- ?- gt(X,(L2,zero_int),Z).
- X = (L2, _17802),
- Z = (_17806, bot) ;
- X = (_17800, pos_int),
- Z = (_17806, top). # top is just my true wrapped in the same way
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement