Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mul(0,_,0):-!.
- mul(X,_,_):- X < 0,!.
- mul(1,X,X).
- mul(X,Y,R) :- X1 is X-1, mul(X1,Y,R1),!, R is R1 + Y.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement