Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ncar!tank!uxc!uxc.cso.uiuc.edu!clio!gerdeman From: gerdeman@clio.las.uiuc.edu Newsgroups: comp.lang.prolog Subject: Re: In defence of difference-lists. Message-ID: <16400002@clio> Date: 20 Oct 88 16:47:00 GMT References: <3002@mulga.oz> Lines: 18 Nf-ID: #R:mulga.oz:3002:clio:16400002:000:453 Nf-From: clio.las.uiuc.edu!gerdeman Oct 20 11:47:00 1988 Did something go wrong in the Eureka step here? What does the variable X do? double(X0, X, Y0, Y) :- double(X0, X, Y0, Y1, Y1, Y). double(X, X, Y, Y, Z, Z). double([E|X1], X, [E|Y1], Y, [E|Z1], Z) :- double(X1, X, Y1, Y, Z1, Z). Why not write ; double(X0,Y0,Y):- double(X0,Y0,Y1,Y1,Y). double([],Y,Y,Z,Z). double([E|X1],[E|Y1],Y,[E|Z1],Z):- double(X1,Y1,Y,Z1,Z).