Re: Lists in Learn Prolog Now
- From: "wooks" <wookiz@xxxxxxxxxxx>
- Date: 9 Jan 2006 12:41:31 -0800
Lawrence Oluyede wrote:
> Il 2006-01-06, wooks <wookiz@xxxxxxxxxxx> ha scritto:
> > I cannot reproduce the result asserted in section 4.3 of Learn Prolog
> > Now for
> >
> > a2b([a|Ta],[b|Tb]) :- a2b(Ta,Tb).
>
> You forgot to add
>
> a2b([], []).
>
>
> --
> Lawrence - http://www.oluyede.org/blog
> "Anyone can freely use whatever he wants but the light at the end
> of the tunnel for most of his problems is Python"
still doesn't work.
1 ?- listing.
a2b([a|A], [b|B]) :-
a2b([], []).
a2b([a|A], [b|B]) :-
a2b(A, B).
Yes
2 ?- a2b([a,a,a],[b,b,b]).
No
3 ?-
.
- Follow-Ups:
- Re: Lists in Learn Prolog Now
- From: student
- Re: Lists in Learn Prolog Now
- From: kevin
- Re: Lists in Learn Prolog Now
- From: Bart Demoen
- Re: Lists in Learn Prolog Now
- References:
- Lists in Learn Prolog Now
- From: wooks
- Re: Lists in Learn Prolog Now
- From: Lawrence Oluyede
- Lists in Learn Prolog Now
- Prev by Date: Re: Command "listing" in SWI prolog
- Next by Date: assertment with list vs multiple assertments
- Previous by thread: Re: Lists in Learn Prolog Now
- Next by thread: Re: Lists in Learn Prolog Now
- Index(es):
Relevant Pages
|
|