Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maximum(X,Y,X):-
- X>=Y.
- maximum(X,Y,Y):-
- X<Y.
- min(X,Y,X):-
- X=<Y,
- !.
- min(_,Y,Y).
- abs2(X,X) :- X >= 0, !.
- abs2(X,Y) :- Y is -X.
- fib(0,X):-X is 0.
- fib(1,X):-X is 1.
- fib(X,Y):-
- X>=2,
- X_Prime is X-1,
- X_PrimeTwo is X-2,
- fib(X_Prime,Y_Prime),
- fib(X_PrimeTwo,Y_PrimeTwo),
- Y is Y_Prime+Y_PrimeTwo.
- divisor(X,Y,Z):-
Add Comment
Please, Sign In to add comment