Re: Lists in Learn Prolog Now




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 ?-

.



Relevant Pages

  • Re: Lists in Learn Prolog Now
    ... Lawrence Oluyede wrote: ... >> I cannot reproduce the result asserted in section 4.3 of Learn Prolog ... Prev by Date: ...
    (comp.lang.prolog)
  • Lists in Learn Prolog Now
    ... I cannot reproduce the result asserted in section 4.3 of Learn Prolog ... SWI-Prolog. ... Prev by Date: ...
    (comp.lang.prolog)
  • Lists in Learn Prolog Now
    ... I cannot reproduce the result asserted in section 4.3 of Learn Prolog ... SWI-Prolog. ... Prev by Date: ...
    (comp.lang.prolog)