1 Replies - 348 Views - Last Post: 10 May 2009 - 03:43 AM

#1 mostyfriedman   User is offline

  • The Algorithmi
  • member icon

Reputation: 729
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

reversing a list (PROLOG)

Posted 08 April 2009 - 10:35 PM

Description: a simple snippet to reverse a list in prolog
append([], R, R).

append([H|T], R, [H|X]):-
	append(T, R, X).

reverse([X], [X]).

reverse([H|T], R):-
	reverse(T, X), append(X, [H], R).

Is This A Good Question/Topic? 0
  • +

Replies To: reversing a list (PROLOG)

#2 MasterDog   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-March 09

Re: reversing a list (PROLOG)

Posted 10 May 2009 - 03:43 AM

hey there, do you have any experience with prolog's flex system?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1