If-then-else
Hello,
Can someone please explain to me how the if-then-else in Prolog works?
I'm trying this but I must be doing something wrong:
found(X,.(X,Y)) :- true, write(X), ! ; found('Not Found').
found(X,.(Y,Z)) :- found(X,Z).
If X is found in the list Y, it will print X, else it should print 'Not Found'.
What am I doing wrong?
|