Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!scramble.lm.com!news.math.psu.edu!news.cse.psu.edu!uwm.edu!lll-winken.llnl.gov!enews.sgi.com!decwrl!waikato!canterbury.ac.nz!TOKE!pc110111.lincoln.ac.nz!rayududp
From: rayududp@lincoln.ac.nz (Durganagendra Prasad Rayudu)
Subject: Please Help: Coding a for loop in prolog
Message-ID: <rayududp.2.000D49B6@lincoln.ac.nz>
Date: Wed, 15 May 1996 13:17:11
Organization: Lincoln University, New Zealand
X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
Lines: 27

Hi Netters,

I pressed a wrong key and my previous message got posted without finishing it.

So Here it goes again.

I am trying to implement a for loop which my coding is as follows:

for(X, X, M).
for(X,Y,M:- Y<M, Y2 is Y+1, for(X,Y2,M).

my use of it in my program is as follows:

some:-

(for(I,0,10),bb_put(x,I), fail;true).

But then I see it is wasting lot of time backtracking. 

Is there a better way to code this. I need this for loop to code a neural net 
on prolog.

Any round abouts would also be much appreciated.

Thank You in advance,

Ramesh Rayudu 

