I am just now learning Prolog and am quite bad at it.
notMember(X,[]).
notMember(X,[H|T]) :- X =\= H, notMember(X,T).
I can't figure out why this does not work. It give me error: undefined procedure: notMember/2.
If my understanding is correct, the first line says: notMember is true (X is not in the list) when the list is empty. The second line says that X is not in the list with Head H and Tail T, when X does not equal H and is not a member of Tail.
Prolog Question
Started by Nacre, Nov 19 2008 12:12 PM
6 replies to this topic
#1
Posted 19 November 2008 - 12:12 PM
|
|
|
#2
Posted 19 November 2008 - 01:12 PM
I don't think there are any prolog programmers on this forum.
#3
Posted 19 November 2008 - 02:46 PM
Sorry, but I'm not a prolog programmer. I don't know what prolog even is.
The only thing I can think of is your trying to use a procedure that you haven't made yet.
I found a few prolog tutorials that might be of more help:
Prolog Tutorials
prolog
The only thing I can think of is your trying to use a procedure that you haven't made yet.
I found a few prolog tutorials that might be of more help:
Prolog Tutorials
prolog
#4
Posted 19 November 2008 - 05:46 PM
#6
Posted 20 November 2008 - 12:59 PM
Prolog is a fairly strange language based on first order logic. It's sort of a recursion on steroids waiting to happen. I don't know how powerful it is, though.


Sign In
Create Account

Back to top









