I'm working on a simple Prolog example I saw in one of my classes, working with and re-implementing 'append'. This is what I have (from the class):
append1([],L,L).
append1([X|L1],L2,[X|L3]) :-
append1(L1,L2,L3).
When I do this, results in false:
append1([a,b],[c,d],L).
false.
But when I do this (with the built-in append), results in true:
append([a,b],[c,d],L).
true.
Why is there a difference?
And why do both of these following append examples even result in 'true'? For some reason I expected to see a list of values for the Ls ...
append(L1,L2,[a,b,c]).
true.
append([a,b],[c,d],L).
true.