Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Max of three
- predicates
- max(integer, integer, integer, integer)
- clauses
- max(X,Y,Z,X) :- X > Y, X > Z, !.
- max(X,Y,Z,Y) :- Y > Z, !.
- max(_,_,Z,Z).
- goal
- max(1, 2, 3, R1),
- max(2, 1, 3, R2),
- max(1, 3, 2, R3),
- max(3, 1, 2, R4),
- max(2, 3, 1, R5),
- max(3, 2, 1, R6).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement