Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. % length of the list
  2. len([], 0).
  3. len([H|T], B) :-len(T, NT), B is NT + 1.
  4. % return the ith element of the list
  5. match([H|_],0,H) :-!.
  6. match([_|T],N,H) :-N > 0,N1 is N-1,match(T,N1,H).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement