Re: Why does this recursion not work?
- From: "George Sp" <nobots@xxxxxxxxxxxx>
- Date: Mon, 18 Apr 2005 21:52:11 +0000 (UTC)
Hi, May be it does not work because there is no clause for last(tail(Something, SomethingElse), SomethingElse)
"Anders Lindén" <xxxx@xxxxxx> wrote in message news:42624b12$1@xxxxxxxxxxxxxxxxxxxx
%to get the tail of the sequence
tail(sekv(D,T),T).
%find the last element:
last(nil,nil).
last(sekv(D,nil),D). %only one element left
%the recursion
last(sekv(D,R),R2):- last(tail(R,R2),R2).
Why does this recursion not work?
.
- References:
- Why does this recursion not work?
- From: Anders Lindén
- Why does this recursion not work?
- Prev by Date: Re: Graph to tree structure
- Next by Date: Re: Why does this recursion not work?
- Previous by thread: Re: Why does this recursion not work?
- Next by thread: Re: Why does this recursion not work?
- Index(es):