Guest User

Untitled

a guest
May 28th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. power(_, 0, 1). % if instead _ is X, 'warning singleton variable [X]'
  2. power(X, 1, X).
  3. power(X, K, N) :-
  4. K > 1,
  5. K1 is K - 1,
  6. power(X, K1, N1),
  7. N is X * N1.
Add Comment
Please, Sign In to add comment