Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!ptsfa!ihnp4!drutx!druhi!kam From: kam@druhi.ATT.COM (MorrisseyKA) Newsgroups: comp.lang.prolog Subject: naive reverse Message-ID: <2080@druhi.ATT.COM> Date: Tue, 28-Jul-87 18:12:01 EDT Article-I.D.: druhi.2080 Posted: Tue Jul 28 18:12:01 1987 Date-Received: Thu, 30-Jul-87 04:20:03 EDT Distribution: comp Organization: AT&T, Denver, CO Lines: 17 Keywords: lips,benchmark,prolog Here's a naive (:-) question: What is the formula for determining the number of LIs needed to reverse a list of length N, using the following definition? nairev([],[]). nairev([X|Xs],Zs) :- nairev(Xs,Ys), append(Ys,[X],Zs). append([],L,L). append([X|L1],L2,[X|L3]) :- append(L1,L2,L3). It seems that the answer should be easy to determine, but I'm having a heck of a time coming up with an answer that I feel confident about. Karen A. Morrissey